/* ==========================================================================
   MAELLWOE V4 — OBSIDIAN MONOCHROME EDITORIAL DESIGN SYSTEM
   A1 (Pure White Accent) · 4px/8px Grid · Emil Kowalski Motion Curve
   ========================================================================== */

:root {
    /* 1. Obsidian Neutral Ramp */
    --bg: #08080A;
    --surface-1: #0F0F12;
    --surface-2: #16161B;
    --surface-3: #1E1E24;
    --surface-glass: rgba(10, 10, 13, 0.84);

    /* 2. Borders (Quiet Hairlines) */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --border-strong: rgba(255, 255, 255, 0.28);

    /* 3. Three Text Roles */
    --text-1: #F4F4F5;
    --text-2: #A1A1AA;
    --text-3: #71717A;

    /* 4. Primary Accent (A1 — Pure White) & Semantic Roles */
    --accent: #F4F4F5;
    --accent-ink: #08080A;
    --accent-soft: rgba(244, 244, 245, 0.08);
    --live: #22C55E;
    --danger: #EF4444;
    --ember: #E06D3B;
    --ember-soft: rgba(224, 109, 59, 0.12);
    --ember-border: rgba(224, 109, 59, 0.32);

    /* 5. Typography */
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* 6. Spacing & Layout */
    --container-max: 1180px;
    --container-pad: clamp(20px, 4vw, 36px);
    --section-gap: clamp(72px, 9vw, 120px);

    /* 7. Nested Radii */
    --r-panel: 16px;
    --r-card: 14px;
    --r-control: 9px;
    --r-key: 6px;

    /* 8. Motion (Emil Kowalski Snappy Ease-Out) */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --dur-press: 140ms;
    --dur-ui: 180ms;
    --dur-panel: 240ms;
}

/* ================= BASE & RESET ================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--bg);
    color: var(--text-1);
    font-family: var(--font-sans);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg);
    color: var(--text-1);
    line-height: 1.6;
    min-height: 100svh;
    overflow-x: hidden;
    position: relative;
}

/* ================= AMBIENT ANIMATED BACKGROUND ================= */
.ambient-bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.ambient-beam {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    will-change: transform;
    opacity: 0.55;
}
.ambient-beam-1 {
    width: 62vw;
    height: 44vh;
    top: -18vh;
    left: -10vw;
    background: radial-gradient(circle, rgba(244, 244, 245, 0.11) 0%, rgba(244, 244, 245, 0.02) 55%, transparent 75%);
    animation: beamDrift1 18s ease-in-out infinite alternate;
}
.ambient-beam-2 {
    width: 56vw;
    height: 46vh;
    bottom: -16vh;
    right: -12vw;
    background: radial-gradient(circle, rgba(212, 212, 216, 0.09) 0%, rgba(212, 212, 216, 0.02) 55%, transparent 75%);
    animation: beamDrift2 22s ease-in-out infinite alternate;
}
body[data-page="immortal"] .ambient-beam-1 {
    background: radial-gradient(circle, rgba(224, 109, 59, 0.16) 0%, rgba(224, 109, 59, 0.03) 55%, transparent 75%);
}
body[data-page="immortal"] .ambient-beam-2 {
    background: radial-gradient(circle, rgba(234, 88, 12, 0.11) 0%, rgba(234, 88, 12, 0.02) 55%, transparent 75%);
}
@keyframes beamDrift1 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(14vw, 8vh, 0) scale(1.12); }
}
@keyframes beamDrift2 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-12vw, -10vh, 0) scale(1.1); }
}
#ambientFieldCanvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 1;
}
.ambient-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse 75% 45% at 50% 0%, rgba(244, 244, 245, 0.05) 0%, transparent 65%),
        radial-gradient(ellipse 90% 90% at 50% 50%, transparent 48%, rgba(8, 8, 10, 0.72) 100%);
}
body[data-page="immortal"] .ambient-vignette {
    background:
        radial-gradient(ellipse 75% 45% at 50% 0%, rgba(224, 109, 59, 0.08) 0%, transparent 65%),
        radial-gradient(ellipse 90% 90% at 50% 50%, transparent 48%, rgba(8, 8, 10, 0.76) 100%);
}
main, .site-footer {
    position: relative;
    z-index: 2;
}

/* ================= KINETIC MONOCHROME MARQUEE ================= */
.marquee-band {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(15, 15, 18, 0.55);
    backdrop-filter: blur(8px);
    padding: 15px 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
    gap: 36px;
    animation: marqueeScroll 32s linear infinite;
}
.marquee-band:hover .marquee-track {
    animation-play-state: paused;
}
.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 36px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-2);
    white-space: nowrap;
}
.marquee-item::after {
    content: "·";
    color: var(--text-3);
}
@keyframes marqueeScroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

/* Interactive Card Pointer Sheen & Apple-Grade Top Specular Rim */
.work-card,
.bento-card,
.immortal-showcase,
.code-panel,
.hud-sim-panel,
.contact-box,
.im-spec-card,
.avatar-frame,
.now-status-card,
.console-window {
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.075), 0 12px 32px -12px rgba(0, 0, 0, 0.55);
}
.work-card::before,
.bento-card::before,
.immortal-showcase::before,
.contact-box::before,
.im-spec-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(244, 244, 245, 0.065), transparent 60%);
    transition: opacity 220ms var(--ease-out);
    z-index: 0;
}
.immortal-showcase::before {
    background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), rgba(224, 109, 59, 0.1), transparent 60%);
}
.work-card:hover::before,
.bento-card:hover::before,
.immortal-showcase:hover::before,
.contact-box:hover::before,
.im-spec-card:hover::before {
    opacity: 1;
}
.work-card > *,
.bento-card > *,
.immortal-showcase > *,
.contact-box > *,
.im-spec-card > * {
    position: relative;
    z-index: 1;
}

/* Choreographed Hero Entrance (One Intentional Wave) */
@keyframes heroRise {
    from { opacity: 0; transform: translateY(var(--rise, 10px)); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes heroFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.hero-kicker {
    animation: heroFade 380ms var(--ease-out) both;
}
.hero-title {
    --rise: 12px;
    animation: heroRise 540ms var(--ease-out) both;
}
.hero-lead {
    --rise: 8px;
    animation: heroRise 480ms var(--ease-out) 70ms both;
}
.hero-actions,
.hero-metrics {
    --rise: 6px;
    animation: heroRise 460ms var(--ease-out) 130ms both;
}
.hero-visual-stack,
.im-hero-banner {
    --rise: 10px;
    animation: heroRise 540ms var(--ease-out) 90ms both;
}

/* Button Copy Success Morph */
.btn.is-copied {
    border-color: rgba(34, 197, 94, 0.45) !important;
    color: #86EFAC !important;
}
.btn-primary.is-copied {
    background: #22C55E !important;
    color: #052E16 !important;
}

/* Miniature Crafted UI Previews Inside Work Cards */
.work-preview-stage {
    transition: transform 280ms var(--ease-out), border-color 220ms var(--ease-out);
}
.work-card:hover .work-preview-stage {
    transform: scale(1.02);
    border-color: var(--border-hover);
}
.pv-ui-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}
.pv-ui-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--text-2);
}
.pv-ui-bars {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.8fr;
    gap: 6px;
    margin-top: 10px;
}
.pv-ui-bar {
    height: 22px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.pv-ui-bar.warm {
    background: linear-gradient(135deg, rgba(214, 178, 134, 0.18), rgba(214, 178, 134, 0.04));
    border-color: rgba(214, 178, 134, 0.22);
}
.pv-ui-bar.stone {
    background: linear-gradient(135deg, rgba(224, 152, 99, 0.18), rgba(224, 152, 99, 0.04));
    border-color: rgba(224, 152, 99, 0.22);
}
.pv-pulse-track {
    height: 3px;
    width: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: 10px;
    overflow: hidden;
    position: relative;
}
.pv-pulse-runner {
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 244, 245, 0.85), transparent);
    animation: pvFlow 3.2s linear infinite;
}
@keyframes pvFlow {
    to { left: 100%; }
}

/* Crisp Scroll Reveal Choreography */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}
.reveal.is-in {
    opacity: 1;
    transform: translateY(0);
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-1);
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font-family: inherit;
    color: inherit;
}

button, a, [role="button"] {
    touch-action: manipulation;
}

button {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

::selection {
    background: var(--text-1);
    color: var(--bg);
}

:focus-visible {
    outline: 2px solid var(--text-1);
    outline-offset: 2px;
}

@media (pointer: coarse) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

.skip-to-content {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 999;
    background: var(--text-1);
    color: var(--bg);
    padding: 8px 14px;
    border-radius: var(--r-control);
    font-size: 13px;
    font-weight: 600;
}
.skip-to-content:focus {
    top: 16px;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--container-pad);
}

/* Scroll Progress Line */
.scroll-progress-track {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 120;
    pointer-events: none;
}
.scroll-progress-bar {
    width: 100%;
    height: 100%;
    background: var(--text-1);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* Keycap Standard */
kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: var(--r-key);
    background: var(--surface-2);
    border: 1px solid var(--border-hover);
    color: var(--text-2);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: var(--r-control);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: transform var(--dur-press) var(--ease-out),
                background var(--dur-ui) var(--ease-out),
                border-color var(--dur-ui) var(--ease-out),
                color var(--dur-ui) var(--ease-out);
    white-space: nowrap;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}
.btn-primary:hover {
    background: #FFFFFF;
}
.btn-secondary {
    background: var(--surface-1);
    border-color: var(--border-hover);
    color: var(--text-1);
}
.btn-secondary:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-2);
}
.btn-ghost:hover {
    background: var(--surface-1);
    border-color: var(--border-hover);
    color: var(--text-1);
}
.btn-ember {
    background: var(--ember);
    color: #0B0807;
    font-weight: 600;
}
.btn-ember:hover {
    background: #EA7B4A;
}
.btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
}
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ================= SHARED HEADER (B4) ================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.brand-mark {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--text-1);
    flex-shrink: 0;
}
body[data-page="immortal"] .brand-mark {
    background: var(--ember);
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.nav-pill-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    height: 32px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border-hover);
    transform: translate3d(0, -50%, 0);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: transform 240ms var(--ease-out), width 240ms var(--ease-out), opacity 180ms var(--ease-out);
}
.nav-link {
    position: relative;
    z-index: 1;
    font-size: 13.5px;
    color: var(--text-2);
    padding: 6px 12px;
    border-radius: 8px;
    transition: color var(--dur-ui) var(--ease-out);
}
.nav-link:hover,
.nav-link.is-active {
    color: var(--text-1);
}
.nav-immortal-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 6px;
    padding: 5px 11px;
    border-radius: 8px;
    background: var(--surface-1);
    border: 1px solid var(--border-hover);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-1);
    transition: border-color var(--dur-ui) var(--ease-out), background var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.nav-immortal-pill:hover {
    border-color: var(--ember-border);
    background: var(--surface-2);
}
.nav-immortal-pill:active {
    transform: scale(0.97);
}
.nav-immortal-pill img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cmd-trigger-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12.5px;
    transition: border-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.cmd-trigger-pill:hover {
    border-color: var(--border-hover);
    color: var(--text-1);
}
.cmd-trigger-pill:active {
    transform: scale(0.97);
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    height: 34px;
}
.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    padding: 0 8px;
    height: 28px;
    border-radius: 6px;
    transition: background var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out);
}
.lang-btn.is-active {
    background: var(--surface-3);
    color: var(--text-1);
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    color: var(--text-1);
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(8, 8, 10, 0.72);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-panel) var(--ease-out);
    display: flex;
    justify-content: flex-end;
}
.mobile-drawer.is-open {
    opacity: 1;
    pointer-events: auto;
}
.mobile-drawer-panel {
    width: min(320px, 86vw);
    height: 100%;
    background: var(--surface-1);
    border-left: 1px solid var(--border-hover);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateX(16px);
    transition: transform var(--dur-panel) var(--ease-out);
}
.mobile-drawer.is-open .mobile-drawer-panel {
    transform: translateX(0);
}
.drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-2);
    transition: background var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out);
}
.drawer-link:hover {
    background: var(--surface-2);
    color: var(--text-1);
}
.drawer-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
}

/* ================= SECTIONS COMMON ================= */
.section {
    padding-block: var(--section-gap);
    border-top: 1px solid var(--border);
    scroll-margin-top: 64px;
}
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 36px;
}
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 8px;
    display: block;
}
.section-title {
    font-size: clamp(26px, 3.2vw, 38px);
    line-height: 1.15;
}
.section-subtitle {
    font-size: 15px;
    color: var(--text-2);
    max-width: 52ch;
    margin-top: 10px;
}

/* ================= HERO (B1 + C3) ================= */
.hero-section {
    padding-top: clamp(48px, 7vw, 88px);
    padding-bottom: clamp(64px, 8vw, 104px);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.78fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-2);
    margin-bottom: 18px;
}
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live);
    flex-shrink: 0;
}
.hero-title {
    font-size: clamp(34px, 4.6vw, 56px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-bottom: 20px;
}
.hero-lead {
    font-size: 16.5px;
    color: var(--text-2);
    max-width: 52ch;
    margin-bottom: 28px;
}
.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}
.hero-metrics {
    display: flex;
    align-items: center;
    gap: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.metric-val {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.metric-label {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 4px;
}

/* Right Column: Clean Avatar + C3 Now/Status Card */
.hero-visual-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.avatar-frame {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-panel);
    padding: 12px;
}
.avatar-img-box {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
}
.avatar-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* C3: Now / Status Card */
.now-status-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.now-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-2);
}
.now-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-1);
}
.now-clock {
    font-variant-numeric: tabular-nums;
    color: var(--text-3);
}
.now-focus {
    font-size: 13.5px;
    color: var(--text-2);
}
.now-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.now-handle {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-1);
}

/* ================= WORKS PORTFOLIO (4 REAL PROJECTS) ================= */
.works-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.work-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-panel);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color var(--dur-ui) var(--ease-out), background var(--dur-ui) var(--ease-out), transform var(--dur-ui) var(--ease-out);
}
.work-card:hover {
    border-color: var(--border-hover);
    background: #121216;
    transform: translateY(-2px);
}
.work-preview {
    height: 184px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.work-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
}
.work-preview-dots {
    display: flex;
    gap: 5px;
}
.work-preview-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}
.work-preview-stage {
    margin-top: auto;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(8, 8, 10, 0.72);
    border: 1px solid var(--border);
}
.work-preview-domain {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.work-preview-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}
/* Subtle tonal variations inside each project preview */
.work-preview.pv-avanora {
    background: linear-gradient(155deg, #1B1917 0%, #11100F 100%);
}
.work-preview.pv-lara {
    background: linear-gradient(155deg, #1D1814 0%, #110F0D 100%);
}
.work-preview.pv-maellwoe {
    background: linear-gradient(155deg, #17171B 0%, #0D0D10 100%);
}
.work-preview.pv-glua {
    background: linear-gradient(155deg, #13161B 0%, #0C0E12 100%);
}

.work-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-3);
}
.work-title {
    font-size: 20px;
    line-height: 1.25;
}
.work-desc {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.55;
}
.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-chip {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 3px 9px;
    border-radius: 6px;
}
.work-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* ================= INTERACTIVE CRAFT STUDIO & 3D PLAYGROUND ================= */
.craft-split {
    display: grid;
    grid-template-columns: 0.88fr 1.12fr;
    gap: 20px;
    align-items: stretch;
}
.process-rail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.process-step {
    width: 100%;
    text-align: left;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color var(--dur-ui) var(--ease-out), background var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.process-step:hover {
    border-color: var(--border-hover);
    background: #131317;
}
.process-step:active {
    transform: scale(0.985);
}
.process-step.is-active {
    border-color: var(--border-strong);
    background: linear-gradient(180deg, rgba(244, 244, 245, 0.055), var(--surface-1) 70%);
}
.process-step-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-3);
}
.process-step.is-active .process-step-top {
    color: var(--text-1);
}
.process-step h3 {
    font-size: 17px;
}
.process-step p {
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.55;
}

.playground-panel {
    background: var(--surface-1);
    border: 1px solid var(--border-hover);
    border-radius: var(--r-panel);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 48px -18px rgba(0, 0, 0, 0.7);
}
.playground-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.playground-modes {
    display: flex;
    gap: 4px;
}
.pg-mode-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 7px;
    transition: background var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out), border-color var(--dur-ui) var(--ease-out);
}
.pg-mode-btn:hover { color: var(--text-1); }
.pg-mode-btn.is-active {
    background: var(--surface-1);
    border-color: var(--border-hover);
    color: var(--text-1);
}
.playground-hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
}
.playground-stage {
    position: relative;
    flex: 1;
    min-height: 360px;
    background: radial-gradient(circle at 50% 50%, #141419 0%, #09090B 80%);
    cursor: grab;
    touch-action: none;
}
.playground-stage:active {
    cursor: grabbing;
}
#craftPlaygroundCanvas {
    width: 100%;
    height: 100%;
    display: block;
}
.playground-overlay-bar {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-3);
    pointer-events: none;
}

/* ================= IMMORTAL ROLEPLAY FEATURED SHOWCASE ================= */
.immortal-showcase {
    background: var(--surface-1);
    border: 1px solid var(--ember-border);
    border-radius: var(--r-panel);
    padding: clamp(22px, 3.5vw, 36px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
    align-items: center;
}
.im-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.im-logo-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ember-soft);
    border: 1px solid var(--ember-border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.im-logo-box img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.im-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 999px;
}
.im-title {
    font-size: clamp(26px, 3vw, 36px);
    margin-bottom: 12px;
}
.im-desc {
    font-size: 15px;
    color: var(--text-2);
    margin-bottom: 20px;
}
.im-credits {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 24px;
}
.im-media-frame {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-hover);
    background: var(--surface-2);
    display: block;
}
.im-media-frame img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform 280ms var(--ease-out);
}
.im-media-frame:hover img {
    transform: scale(1.025);
}

/* ================= BENTO IDENTITY & SOCIAL NETWORK (B2) ================= */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}
.bento-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-panel);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: border-color var(--dur-ui) var(--ease-out), background var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.bento-card.is-interactive:hover {
    border-color: var(--border-hover);
    background: #131317;
}
.bento-card.is-interactive:active {
    transform: scale(0.985);
}
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

.focus-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.focus-row {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.focus-row:first-child {
    padding-top: 0;
    border-top: none;
}
.focus-num {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
    padding-top: 2px;
}
.focus-row h3 {
    font-size: 16px;
    margin-bottom: 4px;
}
.focus-row p {
    font-size: 13.5px;
    color: var(--text-2);
}

.social-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-1);
}
.social-handle {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-2);
    margin-top: 2px;
}
.social-cta {
    font-size: 13px;
    color: var(--text-1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ================= MODERNIZED TERMINAL (C5) ================= */
.terminal-grid {
    display: grid;
    grid-template-columns: 0.78fr 1.22fr;
    gap: 20px;
    align-items: start;
}
.keycap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}
.cmd-keycap-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    text-align: left;
    transition: border-color var(--dur-ui) var(--ease-out), background var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.cmd-keycap-btn:hover {
    border-color: var(--border-hover);
    background: var(--surface-2);
}
.cmd-keycap-btn:active {
    transform: scale(0.97);
}
.cmd-keycap-hint {
    font-size: 12px;
    color: var(--text-3);
}

.console-window {
    background: var(--surface-1);
    border: 1px solid var(--border-hover);
    border-radius: var(--r-panel);
    overflow: hidden;
}
.console-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
}
.console-output {
    padding: 18px;
    height: 290px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.term-line { color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.term-line.is-cmd { color: var(--text-1); font-weight: 500; }
.term-line.is-err { color: #FCA5A5; }
.term-line a { color: var(--text-1); text-decoration: underline; text-underline-offset: 3px; }

.console-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #0B0B0E;
}
.console-prompt {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-3);
    white-space: nowrap;
}
.console-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--text-1);
}

/* ================= CONTACT & FOOTER ================= */
.contact-box {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-panel);
    padding: clamp(28px, 5vw, 52px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
}
.contact-box h2 {
    font-size: clamp(26px, 3.5vw, 40px);
    margin-bottom: 10px;
}
.contact-box p {
    color: var(--text-2);
    max-width: 50ch;
}
.contact-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-3);
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.footer-links a,
.footer-links button {
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 13px;
    transition: color var(--dur-ui) var(--ease-out);
}
.footer-links a:hover,
.footer-links button:hover {
    color: var(--text-1);
}

/* ================= MODALS & COMMAND PALETTE (C1) ================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-ui) var(--ease-out);
}
.modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
.modal-dialog {
    width: min(680px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--surface-1);
    border: 1px solid var(--border-hover);
    border-radius: var(--r-panel);
    transform: scale(0.96);
    transition: transform var(--dur-panel) var(--ease-out);
}
.modal-backdrop.is-open .modal-dialog {
    transform: scale(1);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
}
.modal-body {
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.case-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.case-cell {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}
.case-cell-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 6px;
    display: block;
}
.case-cell-text {
    font-size: 13.5px;
    color: var(--text-2);
}

/* Command Palette Specific */
.cmd-backdrop {
    align-items: flex-start;
    padding-top: 13vh;
}
.cmd-dialog {
    width: min(560px, 100%);
}
.cmd-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.cmd-search-row input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14.5px;
    color: var(--text-1);
}
.cmd-results {
    padding: 8px;
    max-height: 340px;
    overflow-y: auto;
}
.cmd-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    color: var(--text-2);
    transition: background 120ms var(--ease-out), color 120ms var(--ease-out);
}
.cmd-item:hover,
.cmd-item.is-focused {
    background: var(--surface-2);
    color: var(--text-1);
}
.cmd-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cmd-item-left i {
    width: 16px;
    text-align: center;
    color: var(--text-3);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text-1);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity var(--dur-ui) var(--ease-out), transform var(--dur-ui) var(--ease-out);
}
.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================= IMMORTAL ROLEPLAY PAGE STYLES ================= */
.im-hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
}
.im-hero-banner {
    border-radius: var(--r-panel);
    overflow: hidden;
    border: 1px solid var(--ember-border);
    background: var(--surface-1);
}
.im-hero-banner img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}
.im-hero-banner-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-2);
}
.im-specs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.im-spec-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 16px;
}
.im-spec-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
    display: block;
    margin-bottom: 6px;
}
.im-spec-val {
    font-size: 15px;
    font-weight: 600;
}
.im-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.gallery-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-panel);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.gallery-card:hover {
    border-color: var(--border-hover);
}
.gallery-card:active {
    transform: scale(0.99);
}
.gallery-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.gallery-card figcaption {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--text-2);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 960px) {
    .primary-nav { display: none; }
    .mobile-menu-btn { display: inline-flex; }
    .hero-grid,
    .works-grid,
    .craft-split,
    .immortal-showcase,
    .terminal-grid,
    .im-hero-grid,
    .im-specs-grid,
    .im-gallery-grid,
    .case-grid {
        grid-template-columns: 1fr;
    }
    .span-7, .span-5, .span-4 {
        grid-column: span 12;
    }
    .cmd-trigger-pill span { display: none; }
}

/* ================= MINIMAL OBSIDIAN SPLASH SCREEN ================= */
.site-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 48%, rgba(244, 244, 245, 0.055) 0%, rgba(8, 8, 10, 0) 48%),
        var(--bg);
    transition: opacity 460ms var(--ease-out), visibility 460ms var(--ease-out);
    will-change: opacity;
}
.site-splash.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 0 24px;
    transition: transform 460ms var(--ease-out), filter 460ms var(--ease-out);
}
.site-splash.is-hidden .splash-inner {
    transform: translateY(-6px) scale(1.015);
    filter: blur(5px);
}
.splash-wordmark {
    position: relative;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 5.2vw, 3.1rem);
    font-weight: 700;
    letter-spacing: 0.28em;
    text-indent: 0.28em;
    color: var(--text-1);
    text-shadow:
        0 0 18px rgba(244, 244, 245, 0.42),
        0 0 44px rgba(244, 244, 245, 0.16),
        0 14px 36px rgba(0, 0, 0, 0.92);
    animation: splashWordIn 560ms var(--ease-out) both;
}
.splash-beam {
    width: min(160px, 44vw);
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    border-radius: 999px;
}
.splash-beam-fill {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(244, 244, 245, 0.95) 50%, transparent 100%);
    box-shadow: 0 0 12px rgba(244, 244, 245, 0.65);
    transform: translateX(-100%);
    animation: splashBeamSweep 680ms var(--ease-out) 60ms forwards;
}
@keyframes splashWordIn {
    from {
        opacity: 0;
        transform: translateY(8px);
        letter-spacing: 0.36em;
        text-indent: 0.36em;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 0.28em;
        text-indent: 0.28em;
    }
}
@keyframes splashBeamSweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .site-splash {
        display: none;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
