/* ===== Self-hosted fonts (latin subsets, woff2) ===== */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/ibm-plex-mono-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/instrument-serif-italic.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/instrument-serif.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/outfit-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg-color: #F3F0EA;
    --bg-elevated: #FFFcf7;
    --text-dark: #141311;
    --text-muted: #5E5A53;
    --accent: #5B45E0;
    --accent-deep: #4330C0;
    --accent-secondary: #0E9F8F;
    --accent-secondary-deep: #0B8275;
    --border-light: rgba(20, 19, 17, 0.08);
    --card-glass: rgba(255, 252, 247, 0.64);
    --card-border: rgba(255, 255, 255, 0.78);
    --header-bg-scrolled: rgba(243, 240, 234, 0.8);
    --card-hover-bg: rgba(255, 252, 247, 0.92);
    --skill-bg: rgba(255, 255, 255, 0.44);
    --pill-bg: rgba(20, 19, 17, 0.045);
    --input-bg: rgba(255, 255, 255, 0.74);
    --cursor-dot: #141311;
    --cursor-ring: rgba(20, 19, 17, 0.45);
    --aurora-opacity: 0.5;
    --header-height: 80px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --blur-amount: 16px;
    --brand-radius: 28px 8px 28px 8px;
    --shadow-soft: 0 18px 50px rgba(20, 19, 17, 0.06);
    --max: 1180px;
    --stream-pill-bg: #ffffff;
    --stream-pill-border: rgba(20, 19, 17, 0.08);
    --stream-pill-shadow: 0 10px 24px -4px rgba(20, 19, 17, 0.06), 0 2px 6px -1px rgba(20, 19, 17, 0.02);
    --pencil-color: #8C8880;
}

[data-theme="dark"] {
    --bg-color: #0A0A0C;
    --bg-elevated: #141416;
    --text-dark: #F4F1EA;
    --text-muted: #A7A39A;
    --accent: #8B7CFF;
    --accent-deep: #6E5CF0;
    --accent-secondary: #2DD4BF;
    --accent-secondary-deep: #14B8A6;
    --border-light: rgba(244, 241, 234, 0.1);
    --card-glass: rgba(20, 20, 24, 0.64);
    --card-border: rgba(255, 255, 255, 0.08);
    --header-bg-scrolled: rgba(10, 10, 12, 0.8);
    --card-hover-bg: rgba(26, 26, 30, 0.9);
    --skill-bg: rgba(255, 255, 255, 0.04);
    --pill-bg: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(255, 255, 255, 0.05);
    --cursor-dot: #F4F1EA;
    --cursor-ring: rgba(244, 241, 234, 0.5);
    --aurora-opacity: 0.58;
    --shadow-soft: 0 22px 60px rgba(0, 0, 0, 0.32);
    --stream-pill-bg: #16161a;
    --stream-pill-border: rgba(255, 255, 255, 0.1);
    --stream-pill-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45);
    --pencil-color: #615E58;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    text-size-adjust: 100%;
}

body {
    background: var(--bg-color);
    color: var(--text-dark);
    font-family: Outfit, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.65;
    transition: background-color 0.45s var(--ease-out), color 0.45s var(--ease-out);
}

html.has-cursor,
html.has-cursor body,
html.has-cursor a,
html.has-cursor button,
html.has-cursor .hover-trigger { cursor: none; }
html.has-cursor input,
html.has-cursor textarea,
html.has-cursor select { cursor: text; }

.svg-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
    stroke-width: 1.75;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.svg-icon.fill-icon { fill: currentColor; stroke: none; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 10px 16px;
    border-radius: 0 0 10px 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

*:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
*:focus:not(:focus-visible) { outline: none; }

.noise-layer,
.grid-layer,
.aurora-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.noise-layer {
    z-index: 8;
    opacity: 0.85;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");
}

.grid-layer {
    z-index: 0;
    opacity: 0.65;
    background-image:
        linear-gradient(var(--border-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 15%, transparent 72%);
}

.aurora-container {
    z-index: 0;
    overflow: hidden;
    filter: blur(64px);
    opacity: var(--aurora-opacity);
}
.aurora-blob {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}
.blob-1 {
    width: 420px; height: 420px;
    top: 8%; left: 22%;
    background: radial-gradient(circle, rgba(91, 69, 224, 0.46) 0%, rgba(236, 72, 153, 0.1) 58%, transparent 100%);
}
.blob-2 {
    width: 340px; height: 340px;
    top: 28%; left: 38%;
    background: radial-gradient(circle, rgba(14, 159, 143, 0.3) 0%, rgba(91, 69, 224, 0.1) 60%, transparent 100%);
}
.blob-3 {
    width: 300px; height: 300px;
    top: -4%; right: 8%;
    background: radial-gradient(circle, rgba(232, 121, 76, 0.2) 0%, rgba(91, 69, 224, 0.08) 60%, transparent 100%);
}

.cursor-dot,
.cursor-ring,
.cursor-label {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none !important;
    z-index: 9999;
    border-radius: 999px;
    will-change: transform;
}
.cursor-dot {
    width: 7px; height: 7px;
    margin: -3.5px 0 0 -3.5px;
    background: var(--cursor-dot);
    mix-blend-mode: difference;
    transition: opacity 0.2s ease;
}
.cursor-ring {
    width: 38px; height: 38px;
    margin: -19px 0 0 -19px;
    border: 1px solid var(--cursor-ring);
    transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), background 0.35s var(--ease-out), border-color 0.35s var(--ease-out), opacity 0.25s ease;
}
.cursor-ring.is-hover {
    width: 50px; height: 50px;
    margin: -25px 0 0 -25px;
    background: rgba(91, 69, 224, 0.06);
    border-color: var(--accent);
}
.cursor-ring.is-view {
    width: 72px; height: 72px;
    margin: -36px 0 0 -36px;
    background: var(--text-dark);
    border-color: var(--text-dark);
}
.cursor-label {
    width: 72px; height: 72px;
    margin: -36px 0 0 -36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-color);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.28s var(--ease-out);
}
.cursor-label.is-on { opacity: 1; }

@media (pointer: coarse) {
    .cursor-dot, .cursor-ring, .cursor-label { display: none !important; }
}

.progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    z-index: 1002;
    pointer-events: none;
}

.header-outer {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: var(--header-height);
    border-bottom: 1px solid transparent;
    transition: background 0.4s var(--ease-out), border-color 0.4s ease, transform 0.5s var(--ease-out);
}
.header-outer.scrolled {
    background: var(--header-bg-scrolled);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom-color: var(--border-light);
}
.header-outer.is-hidden { transform: translateY(-110%); }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    max-width: var(--max);
    min-height: var(--header-height);
    margin: 0 auto;
    padding: 18px 32px;
}
.header-outer.scrolled header { padding: 12px 32px; }

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dark);
    text-decoration: none;
    flex-shrink: 0;
}
.logo-svg { width: 34px; height: 34px; }
.logo-svg .stroke {
    fill: none;
    stroke: var(--text-dark);
    stroke-width: 6;
    stroke-linecap: square;
    stroke-linejoin: miter;
}
.logo-svg .frame { stroke-width: 4; }
.brand-logo-img {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.brand-text .brand-name {
    display: block;
    font-size: 0.92rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    line-height: 1.15;
}
.brand-text span:last-child {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

nav ul { display: flex; align-items: center; gap: 28px; list-style: none; }
nav a {
    position: relative;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    opacity: 0.78;
    transition: opacity 0.25s ease;
}
nav a::after {
    content: "";
    position: absolute;
    left: 0; bottom: -4px;
    width: 100%; height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out);
}
nav a:hover,
nav a[aria-current="page"] { opacity: 1; }
nav a:hover::after,
nav a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
}

.social-icons-header { display: flex; align-items: center; gap: 8px; }
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background .25s ease, border-color .25s ease, color .25s ease, transform .25s ease;
}
.social-btn svg,
.social-btn .social-icon {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
}
.social-btn:hover {
    background: var(--pill-bg);
    border-color: var(--border-light);
    transform: translateY(-2px);
    color: var(--accent);
}

/* ===== Theme Switch — پورت ۱:۱ از theme-toggle.tsx (shadcn/21st.dev) ===== */
.theme-switch {
    box-sizing: border-box;
    width: 64px;                     /* w-16 */
    height: 32px;                    /* h-8 */
    padding: 4px;                    /* p-1 */
    border: 1px solid #27272a;       /* border-zinc-800 */
    border-radius: 999px;            /* rounded-full */
    cursor: pointer;
    background: #09090b;             /* bg-zinc-950 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;       /* transition-all duration-300 */
}
[data-theme="light"] .theme-switch {
    background: #ffffff;             /* bg-white */
    border-color: #e4e4e7;           /* border-zinc-200 */
}
.switch-track {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}
.switch-knob {
    position: absolute;
    top: 50%;
    left: 0;
    width: 24px;                     /* w-6 */
    height: 24px;                    /* h-6 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3f3f46;             /* bg-zinc-800 */
    color: #ffffff;                  /* text-white (Moon در دارک) */
    transform: translateY(-50%) translateX(0);       /* translate-x-0 */
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    z-index: 2;
}
[data-theme="light"] .switch-knob {
    background: #e5e7eb;             /* bg-gray-200 */
    color: #374151;                  /* text-gray-700 (Sun در لایت) */
    transform: translateY(-50%) translateX(30px);    /* translate-x-8 */
}
.switch-knob svg { width: 16px; height: 16px; display: block; }   /* w-4 h-4 */
[data-theme="dark"]  .switch-knob .icon-sun  { display: none; }   /* knob دارک = Moon */
[data-theme="light"] .switch-knob .icon-moon { display: none; }   /* knob لایت = Sun */
.switch-side {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;         /* bg-transparent */
    transition: transform 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}
.switch-side svg { width: 16px; height: 16px; display: block; }
.switch-side-left  { color: #000000; }   /* text-black — Moon در لایت */
.switch-side-right { color: #71717a; }   /* text-gray-500 — Sun در دارک */
[data-theme="dark"]  .switch-side-left  { opacity: 0; }
[data-theme="light"] .switch-side-right { opacity: 0; }

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    z-index: 1001;
}
.hamburger span {
    display: block;
    width: 18px;
    height: 1.75px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--text-dark);
    transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(6.75px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.hamburger.active span:nth-child(3) { transform: translateY(-6.75px) rotate(-45deg); }

.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    height: 100dvh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: color-mix(in srgb, var(--bg-color) 86%, transparent);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
}
.mobile-nav.open { opacity: 1; pointer-events: auto; }
.mobile-nav a {
    padding: 6px 12px;
    color: var(--text-dark);
    font-family: "Instrument Serif", serif;
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    text-decoration: none;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), color 0.25s ease;
}
.mobile-nav.open a { opacity: 1; transform: none; }
.mobile-nav.open a:nth-child(1) { transition-delay: 0.06s; }
.mobile-nav.open a:nth-child(2) { transition-delay: 0.12s; }
.mobile-nav.open a:nth-child(3) { transition-delay: 0.18s; }
.mobile-nav.open a:nth-child(4) { transition-delay: 0.24s; }
.mobile-nav a:hover { color: var(--accent); }
.mobile-nav .social-mobile { display: flex; gap: 12px; margin-top: 22px; }
.mobile-nav .social-btn { width: 40px; height: 40px; border-color: var(--border-light); }

.page-wrapper {
    position: relative;
    z-index: 2;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 32px);
    padding-left: max(clamp(18px, 4vw, 32px), env(safe-area-inset-left));
    padding-right: max(clamp(18px, 4vw, 32px), env(safe-area-inset-right));
}

.line-mask { display: block; overflow: hidden; }
.hero-headline .line-mask {
    padding: 0.02em 0 0.12em;
    margin: -0.02em 0;
}
.line-mask .line {
    display: block;
    transform: translate3d(0, 115%, 0);
    animation: lineRise 1.05s var(--ease-out) forwards;
}
@keyframes lineRise { to { transform: none; } }

[data-reveal] {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    filter: blur(4px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out), filter 0.9s var(--ease-out);
    transition-delay: var(--d, 0ms);
}
[data-reveal].is-in {
    opacity: 1;
    transform: none;
    filter: blur(0);
}

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(24px, 4vw, 48px);
    align-items: center;
    min-height: calc(100svh - var(--header-height));
    padding: clamp(24px, 5vh, 56px) 0 clamp(32px, 5vh, 48px);
}

.google-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin-bottom: 22px;
    padding: 6px 14px 6px 10px;
    border: 1px solid rgba(91, 69, 224, 0.18);
    border-radius: 999px;
    background: rgba(91, 69, 224, 0.08);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.hero-label {
    margin-bottom: 16px;
    color: var(--text-muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.hero-label .line { animation-delay: 0.12s; }

.hero-headline {
    margin-bottom: 22px;
    color: var(--text-dark);
    font-family: "Instrument Serif", serif;
    font-size: clamp(2.7rem, 5.6vw, 4.8rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.hero-headline em { font-style: italic; color: var(--accent); }
.hero-headline .line-mask:nth-child(1) .line { animation-delay: 0.2s; }
.hero-headline .line-mask:nth-child(2) .line { animation-delay: 0.34s; }

.typewriter-wrap {
    max-width: 34rem;
    min-height: 4.6em;
    margin-bottom: 28px;
}
.typewriter-line {
    display: block;
    min-height: 1.45em;
    color: var(--text-muted);
    font-size: clamp(1.02rem, 1.7vw, 1.22rem);
    font-weight: 400;
    line-height: 1.55;
}
.typewriter-line .caret {
    display: inline-block;
    width: 1.5px;
    height: 0.95em;
    margin-left: 2px;
    background: var(--accent);
    vertical-align: -0.12em;
    animation: caretBlink 1s steps(1) infinite;
}
.typewriter-line.done .caret { opacity: 0; animation: none; }
@keyframes caretBlink {
    0%, 45% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.9s var(--ease-out) 1.05s forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: none; } }

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 13px 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.45s var(--ease-out), background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.45s var(--ease-out);
    will-change: transform;
}
.btn-primary {
    background: var(--text-dark);
    color: var(--bg-color);
    box-shadow: 0 10px 24px rgba(20, 19, 17, 0.12);
}
.btn-primary:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 14px 32px rgba(91, 69, 224, 0.28);
}
.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border-color: var(--border-light);
}
.btn-secondary:hover {
    background: rgba(14, 159, 143, 0.06);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary-deep);
}

/* —— Kinetic Stream Stage —— */
.stream-stage {
    position: relative;
    width: 100%;
    height: min(500px, 66vh);
    min-height: 420px;
    display: flex;
    justify-content: center;
    gap: 22px;
    padding: 12px 10px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
    opacity: 0;
    animation: fadeUp 1.1s var(--ease-out) 0.4s forwards;
}

.stream-col {
    display: flex;
    flex-direction: column;
    overflow: visible;
    height: 100%;
}

.stream-track {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.stream-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 16px;
}

@keyframes streamUpSmooth {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(0, -50%, 0); }
}

@keyframes streamDownSmooth {
    0% { transform: translate3d(0, -50%, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.stream-up .stream-track { animation: streamUpSmooth 68s linear infinite; }
.stream-down .stream-track { animation: streamDownSmooth 50s linear infinite; }

.stream-col:hover .stream-track,
.stream-col:focus-within .stream-track {
    animation-play-state: paused;
}

@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

.icon-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--stream-pill-bg);
    box-shadow: var(--stream-pill-shadow);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease;
    border: 1.5px solid var(--stream-pill-border);
}

.icon-pill::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    padding: 2px;
    background: conic-gradient(
        from var(--gradient-angle),
        #5B45E0,
        #0E9F8F,
        #E8794C,
        #8B7CFF,
        #5B45E0
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.icon-pill:hover::before,
.icon-pill:focus-visible::before {
    opacity: 1;
    animation: rotateBorder 3s linear infinite;
}

.icon-pill img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    position: relative;
    z-index: 1;
}
.icon-pill img.rounded-logo { border-radius: 7px; }

.icon-pill .ux-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--accent);
    transition: color 0.25s ease;
    position: relative;
    z-index: 1;
}

.stream-down .icon-pill:nth-child(even) .ux-icon {
    color: var(--accent-secondary);
}

.icon-pill::after {
    content: attr(data-name);
    position: absolute;
    top: 50%;
    background: var(--text-dark);
    color: var(--bg-color);
    font-family: Outfit, sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.stream-up .icon-pill::after {
    left: auto;
    right: calc(100% + 12px);
    transform: translateY(-50%) translateX(6px);
}

.stream-down .icon-pill::after {
    left: calc(100% + 12px);
    right: auto;
    transform: translateY(-50%) translateX(-6px);
}

.icon-pill:hover,
.icon-pill:focus-visible {
    transform: scale(1.06);
    border-color: transparent;
    box-shadow: 0 10px 24px -4px rgba(91, 69, 224, 0.22);
    z-index: 50;
}

.icon-pill:hover::after,
.icon-pill:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* =======================================================
   PURE PENCIL & WIREFRAME SKETCH ACCENTS (FLOATING)
======================================================= */
.pencil-sketch {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    color: var(--pencil-color);
    will-change: transform;
    opacity: 0.65;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .pencil-sketch { opacity: 0.35; }

@keyframes floatPencil1 {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-1deg); }
    50% { transform: translate3d(-8px, -14px, 0) rotate(2deg); }
}
@keyframes floatPencil2 {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(1deg); }
    50% { transform: translate3d(10px, 12px, 0) rotate(-2deg); }
}

.anim-pencil-1 { animation: floatPencil1 7.2s ease-in-out infinite; }
.anim-pencil-2 { animation: floatPencil2 8.4s ease-in-out infinite; }

.sk-project-arrow {
    top: 4px;
    right: -20px;
    width: 170px;
    height: 90px;
}

.sk-method-wireframe-rot {
    top: 80px;
    right: 28px;
    width: 135px;
    height: 65px;
    transform: rotate(-14deg);
}

.sk-resume-centered-card {
    top: -32px;
    left: 360px;
    width: 120px;
    height: 75px;
}

.sk-contact-wireframe-browser {
    top: 10px;
    right: -36px;
    width: 240px;
    height: 145px;
    transform: rotate(7deg);
}

section {
    position: relative;
    padding: clamp(72px, 11vh, 120px) 0;
    border-top: 1px solid var(--border-light);
    scroll-margin-top: calc(var(--header-height) + 12px);
}
.section-header { max-width: 640px; margin-bottom: clamp(32px, 5vw, 52px); }
.section-kicker {
    margin-bottom: 10px;
    color: var(--accent);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.section-title {
    margin-bottom: 10px;
    font-family: "Instrument Serif", serif;
    font-size: clamp(2.1rem, 4.4vw, 3.2rem);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.12;
}
.section-desc { max-width: 46ch; color: var(--text-muted); font-size: 1rem; }
.section-title em { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; color: var(--accent); }

.projects-stack { display: flex; flex-direction: column; gap: 28px; }
.case-card {
    display: grid;
    grid-template-columns: 0.92fr 1.08fr;
    overflow: hidden;
    border: 1px solid var(--card-border);
    border-radius: var(--brand-radius);
    background: var(--card-glass);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    box-shadow: var(--shadow-soft);
    transition: transform 0.6s var(--ease-out), background 0.4s ease, box-shadow 0.6s var(--ease-out);
}
.case-card:hover {
    transform: translateY(-6px);
    background: var(--card-hover-bg);
    box-shadow: 0 28px 70px rgba(91, 69, 224, 0.08);
}
.case-card.is-alt { grid-template-columns: 1.08fr 0.92fr; }
.case-card.is-alt .case-visual { order: 2; }

.case-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 28px;
    overflow: hidden;
}
.case-visual.v1 {
    background: radial-gradient(circle at 20% 20%, rgba(91, 69, 224, 0.16), transparent 46%),
                radial-gradient(circle at 80% 80%, rgba(14, 159, 143, 0.14), transparent 42%);
}
.case-visual.v2 {
    background: radial-gradient(circle at 80% 18%, rgba(91, 69, 224, 0.16), transparent 48%),
                radial-gradient(circle at 20% 86%, rgba(232, 121, 76, 0.12), transparent 40%);
}
.case-visual.v3 {
    background: radial-gradient(circle at 20% 80%, rgba(14, 159, 143, 0.16), transparent 48%),
                radial-gradient(circle at 80% 20%, rgba(91, 69, 224, 0.14), transparent 44%);
}

.mock {
    width: min(100%, 250px);
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 28px;
    background: var(--bg-elevated);
    box-shadow: 0 20px 50px rgba(20, 19, 17, 0.12);
    transform: rotate(-6deg) translateY(8px);
    transition: transform 0.7s var(--ease-out);
}
.case-card:hover .mock { transform: rotate(-2deg) translateY(0) scale(1.03); }
.is-alt .mock { transform: rotate(6deg) translateY(8px); }
.case-card.is-alt:hover .mock { transform: rotate(2deg) translateY(0) scale(1.03); }
.mock-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 18px;
    padding: 0 12px;
    background: rgba(20, 19, 17, 0.04);
}
[data-theme="dark"] .mock-bar { background: rgba(255,255,255,0.04); }
.mock-bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-light); }
.mock-body { display: grid; gap: 10px; padding: 14px; }
.sk { border-radius: 8px; background: var(--pill-bg); }
.sk.lg { height: 72px; }
.sk.md { height: 10px; width: 72%; }
.sk.sm { height: 8px; width: 46%; }
.sk.cta { height: 32px; border-radius: 999px; background: var(--accent); opacity: 0.85; }

.dash-mock {
    width: min(100%, 260px);
    padding: 16px;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: var(--bg-elevated);
    box-shadow: 0 20px 50px rgba(20, 19, 17, 0.12);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: rotate(-4deg) translateY(6px);
    transition: transform 0.7s var(--ease-out);
}
.case-card:hover .dash-mock { transform: rotate(-1deg) translateY(0) scale(1.03); }
.dash-row { display: flex; gap: 10px; }
.dash-chart {
    height: 70px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(14, 159, 143, 0.15) 0%, transparent 100%);
    border: 1px dashed var(--accent-secondary);
    display: flex;
    align-items: flex-end;
    padding: 8px;
    gap: 6px;
}
.dash-bar { flex: 1; background: var(--accent-secondary); border-radius: 4px; }

.token-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: min(100%, 250px);
}
.token {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
    color: var(--text-muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.62rem;
    transform: translateY(var(--ty, 0));
    transition: transform 0.6s var(--ease-out);
}
.case-card:hover .token { transform: none; }
.token b { display: block; width: 18px; height: 18px; margin-bottom: 8px; border-radius: 6px; }

.case-body { padding: clamp(24px, 3.4vw, 40px); }
.case-tag {
    margin-bottom: 12px;
    color: var(--accent);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.case-body h3 {
    margin-bottom: 12px;
    font-family: "Instrument Serif", serif;
    font-size: clamp(1.55rem, 2.6vw, 2.05rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.2;
}
.case-body > p { max-width: 48ch; margin-bottom: 18px; color: var(--text-muted); font-size: 0.95rem; }

.case-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 22px;
    margin: 6px 0 18px;
    padding: 16px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.metric-item { display: flex; align-items: center; gap: 10px; }
.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(14, 159, 143, 0.1);
    color: var(--accent-secondary);
    flex-shrink: 0;
}
.metric-text { color: var(--text-muted); font-size: 0.75rem; line-height: 1.35; }
.metric-text strong {
    display: block;
    color: var(--text-dark);
    font-family: "Instrument Serif", serif;
    font-size: 1.05rem;
    font-weight: 400;
}

.narrative-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}
.narrative-item h4 {
    margin-bottom: 4px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.narrative-item p { color: var(--text-muted); font-size: 0.82rem; line-height: 1.55; }

.case-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}
.case-link .arr { transition: transform 0.35s var(--ease-out); }
.case-link:hover .arr { transform: translateX(5px); }

/* —— Method waves —— */
.process-wrap { position: relative; }
.process-waves {
    pointer-events: none;
    overflow: hidden;
}
.process-waves svg {
    display: block;
    will-change: transform;
    backface-visibility: hidden;
    animation-play-state: paused;
}
.process-wrap.is-live .process-waves svg { animation-play-state: running; }

.process-waves-x {
    position: absolute;
    left: -6%;
    right: -6%;
    top: 4px;
    height: 72px;
    z-index: 0;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.process-waves-x svg {
    width: 200%;
    height: 100%;
    animation: sineX 28s linear infinite;
}
@keyframes sineX {
    from { transform: translate3d(-50%, 0, 0); }
    to { transform: translate3d(0, 0, 0); }
}

.process-waves-y {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 52px;
    z-index: 0;
    mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
}
.process-waves-y svg {
    width: 100%;
    height: 200%;
    animation: sineY 26s linear infinite;
}
@keyframes sineY {
    from { transform: translate3d(0, -50%, 0); }
    to { transform: translate3d(0, 0, 0); }
}

.sine { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.s1 { stroke: url(#waveA); stroke-width: 1.7; opacity: 0.95; }
.s2 { stroke: url(#waveB); stroke-width: 1.25; opacity: 0.55; }
.s3 { stroke: url(#waveC); stroke-width: 1; opacity: 0.36; }

.process {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    position: relative;
    z-index: 1;
    padding-top: 18px;
}
.process-step {
    position: relative;
    padding-top: 8px;
    text-align: center;
    opacity: 0.28;
    transform: translateY(14px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.process-wrap.is-live .process-step { opacity: 1; transform: none; }
.process-wrap.is-live .process-step:nth-child(1) { transition-delay: 0.05s; }
.process-wrap.is-live .process-step:nth-child(2) { transition-delay: 0.18s; }
.process-wrap.is-live .process-step:nth-child(3) { transition-delay: 0.31s; }
.process-wrap.is-live .process-step:nth-child(4) { transition-delay: 0.44s; }
.process-wrap.is-live .process-step:nth-child(5) { transition-delay: 0.57s; }

.process-dot {
    width: 11px;
    height: 11px;
    margin: 0 auto 16px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--bg-color);
    box-shadow: 0 0 0 6px var(--bg-color);
    position: relative;
    z-index: 2;
}
.process-idx {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
}
.process-step h3 { margin-bottom: 4px; font-size: 0.92rem; font-weight: 600; }
.process-step p { color: var(--text-muted); font-size: 0.78rem; }

.about-card,
.resume-card,
.contact-info,
.contact-form,
.article-card {
    border: 1px solid var(--card-border);
    border-radius: var(--brand-radius);
    background: var(--card-glass);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    box-shadow: var(--shadow-soft);
}

.about-card { padding: clamp(28px, 4vw, 48px); }
.about-lead {
    max-width: 28ch;
    margin-bottom: 16px;
    font-family: "Instrument Serif", serif;
    font-size: clamp(1.45rem, 2.6vw, 2rem);
    letter-spacing: -0.025em;
    line-height: 1.28;
}
.about-card p { max-width: 62ch; margin-bottom: 14px; color: var(--text-muted); font-size: 1.02rem; }
.about-card p strong { color: var(--text-dark); font-weight: 600; }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 32px;
}
.skill-category {
    padding: 18px 18px 16px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--skill-bg);
}
.skill-category h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--pill-bg);
    font-size: 0.74rem;
    font-weight: 500;
}

.resume-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: clamp(24px, 3vw, 36px);
}
.resume-card h3 {
    font-family: "Instrument Serif", serif;
    font-size: 1.7rem;
    font-weight: 400;
    letter-spacing: -0.03em;
}
.resume-card p { color: var(--text-muted); font-size: 0.92rem; }

.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 22px;
}
.contact-info,
.contact-form { padding: clamp(24px, 3vw, 36px); }
.contact-info h3, .contact-form h3 {
    margin-bottom: 12px;
    font-family: "Instrument Serif", serif;
    font-size: 1.7rem;
    font-weight: 400;
}
.contact-info p { margin-bottom: 22px; color: var(--text-muted); }
.contact-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.92rem;
}
.contact-detail .svg-icon { color: var(--accent-secondary); }
.contact-detail a { color: var(--text-dark); font-weight: 500; text-decoration: none; word-break: break-word; }
.contact-detail a:hover { text-decoration: underline; }
.contact-social { display: flex; gap: 12px; margin-top: 22px; }
.contact-social .social-btn { width: 42px; height: 42px; border-color: var(--border-light); }
.contact-social .social-btn svg { width: 20px; height: 20px; }
.contact-social .social-btn:hover { background: var(--text-dark); color: var(--bg-color); }

.contact-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.field-group { margin-bottom: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: var(--input-bg);
    color: var(--text-dark);
    font: inherit;
    appearance: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 4px rgba(14, 159, 143, 0.12);
}
.contact-form .error { border-color: #D64545; }
.error-msg { display: none; margin-top: 5px; color: #D64545; font-size: 0.72rem; }
.error-msg.visible { display: block; }
.success-msg, .fail-msg {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
}
.success-msg { background: rgba(14, 159, 143, 0.1); color: var(--accent-secondary-deep); }
.fail-msg { background: rgba(214, 69, 69, 0.1); color: #D64545; }
.success-msg.visible, .fail-msg.visible { display: flex; }
.contact-form button[type="submit"] {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: var(--accent-secondary);
    color: #fff;
    font: 700 0.9rem Outfit, sans-serif;
    transition: background 0.3s ease, transform 0.25s var(--ease-out);
}
.contact-form button[type="submit"]:hover { background: var(--accent-secondary-deep); }
.contact-form button[type="submit"]:disabled { opacity: 0.6; pointer-events: none; }
#turnstileWrap { margin: 4px 0 14px; }

.scroll-top-btn {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background: var(--card-glass);
    color: var(--text-dark);
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s var(--ease-out), background 0.3s ease, color 0.3s ease;
}
.scroll-top-btn.is-on { opacity: 1; pointer-events: auto; transform: none; }
.scroll-top-btn:hover { background: var(--text-dark); color: var(--bg-color); }

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 28px 0 calc(36px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.8rem;
}
footer h3 {
    color: var(--text-dark);
    font-family: "Instrument Serif", serif;
    font-size: 1.2rem;
    font-weight: 400;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text-dark); }
.footer-copy {
    width: 100%;
    margin-top: 6px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 0.72rem;
}

@media (max-width: 1100px) {
    header { padding-inline: 20px; gap: 16px; }
    nav ul { gap: 18px; }
    .hero-headline { font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.1; }
    .stream-stage { gap: 16px; }
    .sk-resume-centered-card { left: 240px; }
}

@media (max-width: 900px) {
    :root { --header-height: 70px; --blur-amount: 10px; }
    .hero {
        grid-template-columns: 1fr 1fr;
        min-height: auto;
        gap: 24px;
        padding: 20px 0 32px;
    }
    .hero-headline {
        font-size: clamp(2.15rem, 6vw, 3.2rem);
        line-height: 1.16;
        letter-spacing: -0.02em;
        margin-bottom: 18px;
    }
    .hero-headline em { display: block; margin-top: 0.04em; }
    .google-badge { margin-bottom: 16px; font-size: 0.64rem; }
    .typewriter-wrap { min-height: 3.8em; margin-bottom: 22px; }
    .stream-stage {
        height: 380px;
        min-height: 380px;
        gap: 14px;
    }
    .icon-pill { width: 52px; height: 52px; border-radius: 16px; }
    .icon-pill img { width: 25px; height: 25px; }
    .icon-pill .ux-icon { width: 20px; height: 20px; }
    .case-card, .case-card.is-alt, .narrative-grid, .contact-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr 1fr; }
    .case-card.is-alt .case-visual { order: 0; }
    .case-visual { min-height: 220px; padding: 22px; }
    .process-waves-x { display: none; }
    .process-waves-y { display: block; }
    .process-wrap { padding-left: 0; }
    .process {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 0;
        padding-left: 30px;
        max-width: 340px;
        margin-inline: auto;
    }
    .process-step {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 16px;
        padding: 17px 0;
        text-align: left;
    }
    .process-dot { grid-column: 1; grid-row: 1 / span 2; margin: 3px 0 0; }
    .process-idx { grid-column: 1; grid-row: 2; margin-top: 8px; }
    .process-step h3 { grid-column: 2; grid-row: 1; align-self: center; margin-bottom: 3px; }
    .process-step p { grid-column: 2; grid-row: 2; }
    section { padding: 56px 0; }
    .aurora-container { filter: blur(42px); }
    .pencil-sketch { display: none; }
}

@media (max-width: 768px) {
    :root { --header-height: 64px; }
    header { padding: 10px 8px 10px 14px; }
    .header-outer.scrolled header { padding: 8px 8px 8px 14px; }
    nav ul { display: none; }
    .hamburger { display: flex; }
    .mobile-nav { display: flex; }
    .social-icons-header .social-btn { display: none; }
    .page-wrapper { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
    .hero {
        grid-template-columns: 1fr;
        min-height: calc(100svh - var(--header-height));
        padding: 32px 0 40px;
    }
    .stream-stage, .pencil-sketch {
        display: none !important;
    }
    .resume-card { flex-direction: column; align-items: stretch; }
    .cta-row .btn { width: 100%; }
    .brand-text .brand-name { font-size: 0.8rem; }
    .logo-svg { width: 30px; height: 30px; }
    .logo-img { width: 30px; height: 30px; }
    .brand-logo-img { width: 30px; height: 30px; max-width: 30px; max-height: 30px; }
}

@media (max-width: 560px) {
    .hero-headline { font-size: clamp(2rem, 8.4vw, 2.45rem); line-height: 1.16; }
    .skills-grid { grid-template-columns: 1fr; gap: 16px; }
    .skill-category { padding: 22px 20px 20px; border-radius: 22px; }
    .skill-category h4 { font-size: 0.8rem; margin-bottom: 14px; gap: 9px; }
    .skill-category h4 .svg-icon { width: 17px; height: 17px; }
    .skill-list { gap: 8px; }
    .skill-list .pill { font-size: 0.86rem; padding: 9px 16px; }
    .google-badge { letter-spacing: 0; }
}

@media (prefers-reduced-transparency: reduce) {
    :root { --blur-amount: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    [data-reveal], .cta-row, .stream-stage, .line-mask .line, .process-step, .pencil-sketch { opacity: 1 !important; transform: none !important; filter: none !important; }
    .stream-track { transform: none !important; }
    .stream-stage { height: auto; min-height: 0; flex-wrap: wrap; mask-image: none; -webkit-mask-image: none; }
    .process-waves svg { transform: none !important; }
    .cursor-dot, .cursor-ring, .cursor-label { display: none !important; }
    html.has-cursor, html.has-cursor * { cursor: auto !important; }
}

@media print {
    .header-outer, .aurora-container, .noise-layer, .grid-layer,
    .scroll-top-btn, .progress-bar, .mobile-nav, .cta-row,
    .cursor-dot, .cursor-ring, .cursor-label, .skip-link,
    .process-waves, .stream-stage, .pencil-sketch { display: none !important; }
    body { background: #fff; color:#111; }
    .about-card, .case-card, .resume-card, .contact-info, .contact-form { box-shadow: none; background: #fff; }
}

.crumbs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; color:var(--text-muted); font-size:0.8rem; }
.crumbs a { color:inherit; text-decoration:none; }
.crumbs a:hover { color:var(--text-dark); }
.article-card { border:1px solid var(--card-border); border-radius:var(--brand-radius); background:var(--card-glass); backdrop-filter:blur(var(--blur-amount)); -webkit-backdrop-filter:blur(var(--blur-amount)); box-shadow:var(--shadow-soft); padding:clamp(24px,4vw,42px); }
.article-grid { display:grid; grid-template-columns:1fr 1fr; gap:22px; margin-top:8px; }
.article-grid h3 { margin-bottom:8px; color:var(--accent); font-size:0.72rem; letter-spacing:0.12em; text-transform:uppercase; }
.article-grid p, .article-grid li { color:var(--text-muted); line-height:1.7; }
.article-grid ul { padding-left:18px; }
.nav-links { display:flex; justify-content:space-between; gap:16px; margin-top:28px; }
.page-hero { padding-top:clamp(28px,6vh,56px); border-top:0; padding-bottom:clamp(18px,3vh,28px); }
.hero-tags { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.hero-tag { font-size:0.74rem; letter-spacing:0.08em; text-transform:uppercase; padding:6px 12px; border:1px solid var(--border-light); border-radius:999px; background:var(--card-glass); color:var(--text-muted); }
.hero-tag.solid { background:var(--text-dark); color:var(--bg-color); border-color:var(--text-dark); }
@media (max-width:768px){ .article-grid,.nav-links { grid-template-columns:1fr; flex-direction:column; } }
@media print { .crumbs, .nav-links, footer { display:none; } body { background:#fff; color:#111; } .article-card { box-shadow:none; background:#fff; } }

/* picture wrapper نباید در فلکس والد دخالت کند */
.case-visual picture { display: contents; }
.case-visual img {
    border-radius: clamp(14px, 2.2vw, 24px);
    box-shadow: 0 18px 44px rgba(20, 19, 17, 0.14);
}

/* ===== Modern behavior (2025+) ===== */

/* اسکرول‌بار و کنترل‌های native هم‌رنگ تم */
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* شکست‌بندی متن تعادلی — تیترها بالانس، پاراگراف‌ها بدون کلمهٔ یتیم آخر */
h1, h2, h3, .section-title { text-wrap: balance; }
p, .section-desc { text-wrap: pretty; }

/* اسکرول زنجیره‌ای منوی موبایل به body منتقل نشود */
.mobile-nav { overscroll-behavior: contain; }

/* ===== 404 page ===== */
.not-found-hero {
    min-height: calc(100dvh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-block: clamp(60px, 14vh, 140px);
}
.not-found-header {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
}
.not-found-desc {
    max-width: 46ch;
    margin: 0 auto;
}
.not-found-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: clamp(24px, 3vw, 36px);
    justify-content: center;
}

