/* ==========================================================================
   Dennis Donner — Portfolio
   Apple-inspired product page. Pure HTML/CSS/JS, no build.
   ========================================================================== */

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, textarea, button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Design tokens (Apple-inspired) ---------- */
:root {
    --bg: #fbfbfd;
    --bg-alt: #ffffff;
    --bg-soft: #f5f5f7;
    --bg-dark: #000000;
    --bg-dark-2: #1d1d1f;

    --surface: #ffffff;
    --border: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.22);

    --text: #1d1d1f;
    --text-dim: #6e6e73;
    --text-faint: #86868b;
    --text-on-dark: #f5f5f7;
    --text-on-dark-dim: #a1a1a6;

    --accent: #6a3dff;
    --accent-hover: #7b52ff;
    --accent-soft: rgba(106, 61, 255, 0.12);
    --accent-rgb: 106, 61, 255;
    --accent-bright: #a280ff;
    --accent-bright-hover: #b296ff;
    --accent-bright-rgb: 162, 128, 255;

    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;

    --radius-sm: 8px;
    --radius: 18px;
    --radius-lg: 28px;
    --radius-xl: 40px;
    --radius-full: 980px;

    --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
    --ease-apple: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --max: 1240px;
    --max-narrow: 980px;
    --pad: clamp(1.25rem, 4vw, 2.5rem);

    --nav-h: 52px;
}

:root[data-theme="dark"] {
    --bg: #000000;
    --bg-alt: #0a0a0a;
    --bg-soft: #1d1d1f;
    --bg-dark: #000000;
    --bg-dark-2: #1d1d1f;
    --surface: #161617;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.26);
    --text: #f5f5f7;
    --text-dim: #a1a1a6;
    --text-faint: #86868b;
    --accent: #a280ff;
    --accent-hover: #b296ff;
    --accent-soft: rgba(162, 128, 255, 0.16);
    --accent-rgb: 162, 128, 255;
}

/* ---------- Base ---------- */
html, body { background: var(--bg); color: var(--text); }

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.47059;
    letter-spacing: -0.022em;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color .5s var(--ease), color .5s var(--ease);
}

h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.07;
    color: inherit;
}

/* ---------- Cursor ---------- */
.cursor {
    position: fixed; top: 0; left: 0; width: 32px; height: 32px;
    border: 1px solid var(--border-strong); border-radius: 50%;
    transform: translate(-50%, -50%); pointer-events: none; z-index: 9999;
    transition: width .25s var(--ease), height .25s var(--ease),
                border-color .25s var(--ease), background-color .25s var(--ease);
    mix-blend-mode: difference;
}
.cursor span {
    position: absolute; inset: 50%; width: 4px; height: 4px;
    background: var(--text); border-radius: 50%;
    transform: translate(-50%, -50%);
}
.cursor.is-hover { width: 56px; height: 56px; background: var(--accent-soft); border-color: var(--accent); }
.cursor.is-hover span { opacity: 0; }
@media (hover: none), (max-width: 900px) { .cursor { display: none; } }

/* ---------- Scroll progress ---------- */
.progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: var(--accent); z-index: 200;
    transition: width .1s linear;
}

/* ---------- Nav (Apple-style) ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-h);
    display: flex; align-items: center; justify-content: center;
    padding: 0 var(--pad);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    border-bottom: 1px solid transparent;
    transition: background .3s var(--ease), border-color .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner {
    width: 100%; max-width: var(--max);
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
}
.nav__links {
    display: flex; gap: 2.2rem; align-items: center;
    font-size: .82rem; font-weight: 400;
}
.nav__links a {
    color: var(--text); opacity: .88;
    transition: opacity .2s var(--ease), color .2s var(--ease);
    position: relative;
}
.nav__links a:hover { opacity: 1; color: var(--accent); }
.nav__links a.is-active { color: var(--accent); opacity: 1; }

.nav__actions { display: flex; align-items: center; gap: .25rem; }

.nav__burger {
    display: none; width: 34px; height: 34px;
    position: relative;
}
.nav__burger span {
    position: absolute; left: 50%; top: 50%; width: 16px; height: 1.5px;
    background: var(--text); border-radius: 2px;
    transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav__burger span:nth-child(1) { transform: translate(-50%, -4px); }
.nav__burger span:nth-child(2) { transform: translate(-50%, 3px); }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translate(-50%, 0) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { transform: translate(-50%, 0) rotate(-45deg); }

/* ---------- Buttons (Apple-style) ---------- */
.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-width: 28px; padding: .85rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 1.05rem; font-weight: 400; letter-spacing: -0.02em;
    transition: background .25s var(--ease), color .25s var(--ease), transform .35s var(--ease);
    will-change: transform;
    white-space: nowrap;
}
.btn--primary {
    background: var(--accent); color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost {
    background: transparent; color: var(--accent);
    padding: .85rem 0;
}
.btn--ghost::after {
    content: " ›";
    margin-left: .1em;
    transition: transform .25s var(--ease);
    display: inline-block;
}
.btn--ghost:hover { color: var(--accent-hover); }
.btn--ghost:hover::after { transform: translateX(4px); }

.btn--outline {
    background: transparent; color: var(--accent);
    border: 1px solid var(--accent);
}
.btn--outline:hover { background: var(--accent); color: #fff; }

/* ---------- Sections ---------- */
main { position: relative; z-index: 2; }

.section {
    padding: clamp(4rem, 11vw, 8rem) var(--pad);
}
.section__inner {
    max-width: var(--max);
    margin: 0 auto;
    position: relative;
}
.section__inner--narrow { max-width: var(--max-narrow); }

.section--white { background: var(--bg-alt); color: var(--text); }
.section--soft  { background: var(--bg-soft);  color: var(--text); }
.section--dark  { background: var(--bg-dark);  color: var(--text-on-dark); }
.section--dark .text-dim { color: var(--text-on-dark-dim); }

/* Apple-style centered chapter title block */
.chapter {
    text-align: center;
    max-width: var(--max-narrow);
    margin: 0 auto clamp(3rem, 6vw, 5rem);
}
.chapter__kicker {
    display: inline-block;
    font-size: .85rem; font-weight: 600;
    color: var(--accent); letter-spacing: -0.01em;
    margin-bottom: 1rem;
}
.chapter__title {
    font-size: clamp(2.25rem, 5.5vw, 4rem);
    font-weight: 600; letter-spacing: -0.035em;
    line-height: 1.05;
}
.chapter__sub {
    margin-top: 1.25rem;
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    color: var(--text-dim);
    max-width: 680px; margin-left: auto; margin-right: auto;
    line-height: 1.4;
}
.section--dark .chapter__sub { color: var(--text-on-dark-dim); }

/* ---------- Hero (Apple product intro) ---------- */
.hero {
    position: relative;
    min-height: 100vh; min-height: 100svh;
    padding: calc(var(--nav-h) + 5rem) var(--pad) 4rem;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-soft), transparent 70%),
        var(--bg);
    overflow: hidden;
}
.hero__inner {
    position: relative;
    max-width: var(--max-narrow);
    width: 100%;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 1.4rem;
    will-change: transform;
    transform: translate3d(calc(var(--mx, 0) * 1px), calc((var(--my, 0) + var(--py, 0)) * 1px), 0);
}
.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 400; letter-spacing: -0.01em;
    color: var(--text-dim);
}
.eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #30d158;
    box-shadow: 0 0 0 0 rgba(48, 209, 88, .55);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .55); }
    50% { box-shadow: 0 0 0 8px rgba(48, 209, 88, 0); }
}
.hero__title {
    font-size: clamp(3.25rem, 10vw, 8rem);
    font-weight: 700; letter-spacing: -0.045em;
    line-height: 0.95;
}
.hero__title span { background: linear-gradient(180deg, var(--text) 0%, color-mix(in srgb, var(--text) 75%, transparent) 120%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Hero title — handwritten signature variant */
.hero__title--logo { line-height: 0; padding: .25rem 0; }
.hero__title--logo span { background: none; -webkit-text-fill-color: initial; }
.hero__logo {
    display: block;
    width: clamp(280px, 56vw, 620px);
    height: auto;
    margin: 0 auto;
    user-select: none;
    -webkit-user-drag: none;
    image-rendering: -webkit-optimize-contrast;
}

.hero__sub {
    font-size: clamp(1.15rem, 1.7vw, 1.45rem);
    color: var(--text-dim);
    max-width: 640px;
    line-height: 1.45;
}
.hero__cta {
    display: flex; flex-wrap: wrap; gap: 1.25rem;
    align-items: center; justify-content: center;
    margin-top: 1rem;
}

.hero__scroll {
    position: absolute; bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    display: inline-flex; flex-direction: column; align-items: center; gap: .35rem;
    font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-faint);
}
.hero__scroll svg { width: 14px; height: 14px; animation: bob 2s ease-in-out infinite; }
@keyframes bob {
    0%, 100% { transform: translateY(0); opacity: .6; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* Reveal line for hero title */
.reveal-line { display: block; overflow: hidden; padding: 0 .04em; }
.reveal-line > span {
    display: block;
    transform: translateY(110%);
    transition: transform 1.1s var(--ease);
}
.is-loaded .reveal-line > span { transform: translateY(0); }
.is-loaded .reveal-line:nth-child(2) > span { transition-delay: .12s; }

/* ---------- Word reveal (Apple scroll-marketing copy) ---------- */
.wordreveal {
    font-size: clamp(2rem, 5.2vw, 4rem);
    font-weight: 600; letter-spacing: -0.035em;
    line-height: 1.1;
    max-width: var(--max-narrow);
    margin: 0 auto;
    text-align: center;
}
.wordreveal .word {
    display: inline-block;
    margin: 0 .12em;
    color: color-mix(in srgb, var(--text) 22%, transparent);
    transition: color .5s var(--ease);
    will-change: color;
}
.wordreveal .word.is-on { color: var(--text); }
.section--dark .wordreveal .word { color: color-mix(in srgb, var(--text-on-dark) 25%, transparent); }
.section--dark .wordreveal .word.is-on { color: var(--text-on-dark); }

/* ---------- Hello (portrait + intro) ---------- */
.hello {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
}
.hello__portrait {
    position: relative;
    margin: 0;
    width: 100%;
    max-width: 460px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-lg);
    overflow: hidden;
    isolation: isolate;
    box-shadow:
        0 30px 80px -20px rgba(0, 0, 0, .55),
        0 0 0 1px rgba(255, 255, 255, .06);
    transform: rotate(-1.2deg);
    transition: transform .6s var(--ease);
    will-change: transform;
}
.hello__portrait::before {
    content: ""; position: absolute; inset: -14%; z-index: -1;
    background: radial-gradient(circle at 35% 30%, var(--accent-soft), transparent 65%);
    filter: blur(28px);
    pointer-events: none;
}
.hello__portrait img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    transition: transform 1.2s var(--ease);
    will-change: transform;
}
.hello__portrait:hover { transform: rotate(0deg) translateY(-4px); }
.hello__portrait:hover img { transform: scale(1.08); }
.hello__copy {
    display: flex; flex-direction: column; gap: .25rem;
    max-width: 540px;
}
.hello__copy .chapter__kicker { margin-bottom: .25rem; }
.hello__title {
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    font-weight: 600; letter-spacing: -0.035em;
    line-height: 1.05;
    margin: .25rem 0 1rem;
}
.hello__body {
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: .75rem;
}
.hello__body a {
    color: var(--accent);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    transition: border-color .25s var(--ease), color .25s var(--ease);
}
.hello__body a:hover { color: var(--accent-hover); border-bottom-color: var(--accent); }

/* ---------- Story (vertical timeline of personal moments) ---------- */
.story {
    --rail-x: 56px;          /* horizontal center of badge column */
    --rail-w: 2px;
    --badge-size: 112px;
    --rail-progress: 0%;

    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 920px;
    position: relative;
}
/* Background rail (full height, dim) */
.story::before {
    content: "";
    position: absolute;
    left: var(--rail-x);
    top: calc(var(--badge-size) * 0.5);
    bottom: calc(var(--badge-size) * 0.5);
    width: var(--rail-w);
    transform: translateX(-50%);
    background: linear-gradient(to bottom,
        transparent 0,
        rgba(255, 255, 255, 0.10) 8%,
        rgba(255, 255, 255, 0.10) 92%,
        transparent 100%);
    border-radius: var(--rail-w);
    pointer-events: none;
    z-index: 0;
}
/* Foreground rail (grows with scroll progress) */
.story::after {
    content: "";
    position: absolute;
    left: var(--rail-x);
    top: calc(var(--badge-size) * 0.5);
    width: var(--rail-w);
    height: var(--rail-progress);
    max-height: calc(100% - var(--badge-size));
    transform: translateX(-50%);
    background: linear-gradient(to bottom,
        rgba(var(--accent-bright-rgb), 0.0) 0%,
        rgba(var(--accent-bright-rgb), 0.65) 25%,
        rgba(var(--accent-bright-rgb), 0.85) 100%);
    border-radius: var(--rail-w);
    pointer-events: none;
    box-shadow: 0 0 14px 2px rgba(var(--accent-bright-rgb), 0.35);
    transition: height .15s linear;
    z-index: 1;
}

.story__entry {
    display: grid;
    grid-template-columns: calc(var(--rail-x) * 2) 1fr;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: start;
    padding: clamp(1.25rem, 2.5vw, 2rem) 0;
    position: relative;
    z-index: 2;     /* sit above both rail layers so badges knock it out */
}
.story__entry + .story__entry { padding-top: clamp(2rem, 4vw, 3.25rem); }

.story__rail {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

/* Badge — anchored ON the rail */
.story__badge {
    width: var(--badge-size);
    height: var(--badge-size);
    border-radius: 26px;
    overflow: hidden;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    position: relative;
    background: #0e0a14;
    box-shadow:
        0 18px 40px -14px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 0 6px var(--bg-soft);   /* knockout halo so rail visibly stops at the badge */
    transform: scale(.84);
    opacity: 0;
    transition: transform .8s cubic-bezier(.2, .9, .25, 1.05) var(--delay, 60ms),
                opacity .6s ease var(--delay, 60ms),
                box-shadow .4s ease;
}
.story__badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Coloured "halo" pulse behind each badge — keys off the entry's data-accent rgb */
.story__badge::after {
    content: "";
    position: absolute;
    inset: -22%;
    background: radial-gradient(circle at center,
        rgba(var(--entry-rgb, var(--accent-bright-rgb)), 0.32),
        transparent 62%);
    filter: blur(14px);
    z-index: -1;
    opacity: 0;
    transition: opacity .6s ease .2s;
    pointer-events: none;
}
.story__badge--brand {
    background: linear-gradient(155deg, #1a1320 0%, #0d0a14 100%);
}
.story__badge--brand img {
    width: 70%;
    height: auto;
    max-height: 60%;
    object-fit: contain;
}
.story__badge--photo {
    border-radius: 50%;
}
.story__badge--photo img {
    object-position: 30% 35%;     /* keep face nicely framed */
}

/* Multi-app badge — three icons fanned like a hand of cards */
.story__badge--stack {
    background: linear-gradient(155deg, #1a1320 0%, #0d0a14 100%);
    overflow: hidden;
}
.story__badge--stack img {
    position: absolute;
    width: 58%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 22%;
    box-shadow:
        0 6px 14px -4px rgba(0, 0, 0, 0.55),
        0 0 0 1.5px rgba(255, 255, 255, 0.08);
    transition: transform .5s var(--ease);
    top: 21%;
    left: 21%;
}
.story__badge--stack img:nth-child(1) {
    transform: translate(-42%, -2%) rotate(-12deg);
    z-index: 1;
}
.story__badge--stack img:nth-child(2) {
    transform: translate(0, 4%) rotate(2deg);
    z-index: 2;
}
.story__badge--stack img:nth-child(3) {
    transform: translate(42%, -2%) rotate(12deg);
    z-index: 3;
}
/* Small "fan out" flourish when the entry reveals */
.story__entry.is-visible .story__badge--stack img:nth-child(1) {
    transform: translate(-46%, -3%) rotate(-14deg);
}
.story__entry.is-visible .story__badge--stack img:nth-child(3) {
    transform: translate(46%, -3%) rotate(14deg);
}

/* Reveal state — per-entry accent is set inline via style="--entry-rgb: r,g,b" */
.story__entry { --entry-rgb: var(--accent-bright-rgb); }
.story__entry.is-visible .story__badge { transform: scale(1); opacity: 1; }
.story__entry.is-visible .story__badge::after { opacity: 1; }

/* Body content */
.story__body {
    padding-top: 0.35rem;
}
.story__date {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}
.story__tag {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-bright);
    margin-left: 0.6rem;
    letter-spacing: -0.005em;
}
.story__title {
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin: 0.35rem 0 0.85rem;
    color: var(--text);
}
.story__desc {
    font-size: clamp(1rem, 1.2vw, 1.08rem);
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0 0 1.1rem;
    max-width: 56ch;
}
.story__desc strong {
    color: var(--text);
    font-weight: 600;
}
.story__desc a {
    color: var(--accent-bright);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--accent-bright-rgb), 0.35);
    transition: border-color .25s var(--ease), color .25s var(--ease);
}
.story__desc a:hover {
    color: var(--accent-bright-hover, var(--accent-bright));
    border-bottom-color: var(--accent-bright);
}

.story__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    font-size: 0.82rem;
}
.story__meta li {
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: -0.005em;
    line-height: 1;
    white-space: nowrap;
}
.story__meta li:first-child {
    color: var(--text);
    background: rgba(var(--accent-bright-rgb), 0.12);
    border-color: rgba(var(--accent-bright-rgb), 0.25);
}

@media (max-width: 720px) {
    .story {
        --rail-x: 36px;
        --badge-size: 72px;
    }
    .story__entry { gap: 1rem; }
    .story__badge { border-radius: 18px; }
    .story__title { margin-top: 0.25rem; }
    .story__tag { display: block; margin-left: 0; margin-top: 0.15rem; }
}

/* ---------- Stats (spec-style bar) ---------- */
.stats {
    max-width: var(--max); margin: 0 auto;
    padding: 2.5rem var(--pad);
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
    align-items: start;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: .35rem; }
.stat strong {
    font-weight: 600; font-size: clamp(1.75rem, 3.5vw, 2.4rem);
    letter-spacing: -0.03em; line-height: 1; color: var(--text);
    display: inline-flex; align-items: baseline;
    min-height: 1em;
}
.stat strong .count { font: inherit; color: inherit; letter-spacing: inherit; }
.stat > span { color: var(--text-dim); font-size: .9rem; }

/* ---------- Featured work (Apple product showcase) ---------- */
.featured {
    position: relative;
    border-radius: clamp(22px, 3vw, 36px);
    overflow: hidden;
    background: linear-gradient(180deg, #0a0a0a 0%, #1d1d1f 100%);
    color: #f5f5f7;
    padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 5vw, 4rem);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
    isolation: isolate;
}
.featured::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(circle at 80% 20%, rgba(var(--accent-rgb), .35), transparent 55%),
        radial-gradient(circle at 20% 80%, rgba(var(--accent-bright-rgb), .22), transparent 55%);
    pointer-events: none;
}
.featured__tag {
    display: inline-block; font-size: .85rem; font-weight: 500;
    color: var(--accent-bright); margin-bottom: 1rem; letter-spacing: -0.01em;
}
.featured__title {
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    font-weight: 600; letter-spacing: -0.035em;
    line-height: 1.05; margin-bottom: 1rem;
}
.featured__title--logo { margin-bottom: 1.5rem; }
.featured__title--logo img {
    display: block;
    width: clamp(180px, 22vw, 260px);
    height: auto;
}
.featured__desc {
    color: #a1a1a6; font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.5; max-width: 440px; margin-bottom: 2rem;
}
.featured__meta {
    display: grid; grid-template-columns: repeat(3, auto); gap: 1.5rem 2rem;
    margin-bottom: 2rem; font-size: .85rem;
}
.featured__meta dt { color: #86868b; margin-bottom: .2rem; letter-spacing: -0.01em; }
.featured__meta dd { color: #f5f5f7; font-weight: 500; }

.featured__cta { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.featured__cta .btn--primary { background: var(--accent-bright); color: #000; }
.featured__cta .btn--primary:hover { background: var(--accent-bright-hover); }
.featured__cta .btn--ghost { color: var(--accent-bright); }
.featured__cta .btn--ghost:hover { color: var(--accent-bright-hover); }

.featured__visual {
    position: relative;
    aspect-ratio: 1 / 1;
    max-width: 420px;
    width: 100%; justify-self: center;
    will-change: transform;
    transform: scale(var(--fscale, 0.92));
    transition: transform .2s linear;
}
.featured__visual::before {
    content: ""; position: absolute; inset: -10%;
    background: radial-gradient(circle at center, rgba(var(--accent-bright-rgb), .3), transparent 60%);
    filter: blur(30px);
    z-index: -1;
}
.featured__visual img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: clamp(40px, 10%, 80px);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6),
                0 0 0 1px rgba(255, 255, 255, .08);
}

/* ---------- Work grid ---------- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: clamp(3rem, 6vw, 5rem);
}
.filters {
    display: flex; flex-wrap: wrap; gap: .5rem;
    justify-content: center;
    margin: -1rem 0 0;
}
.filter {
    padding: .55rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: .9rem; font-weight: 400;
    color: var(--text-dim);
    transition: all .25s var(--ease);
}
.filter:hover { color: var(--text); background: var(--accent-soft); }
.filter.is-active {
    background: var(--text); color: var(--bg);
}
.section--dark .filter { color: var(--text-on-dark-dim); }
.section--dark .filter:hover { color: var(--text-on-dark); background: rgba(255, 255, 255, .08); }
.section--dark .filter.is-active { background: var(--text-on-dark); color: var(--bg-dark); }

.project {
    --ty: 0px;
    --rx: 0deg;
    --ry: 0deg;
    --hover: 0;
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
    transform: translate3d(0, var(--ty), 0) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform .5s var(--ease), box-shadow .5s var(--ease);
    will-change: transform;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.project.is-hidden { display: none; }
.project:hover {
    --ty: -4px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .12);
}
.section--dark .project { background: #161617; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.section--dark .project:hover { box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .6); }

.project__media {
    aspect-ratio: 1 / 1; overflow: hidden;
    background: var(--bg-soft);
    display: grid; place-items: center;
    transform: translateZ(30px);
}
.section--dark .project__media { background: #0a0a0a; }
.project__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(calc(1 + var(--hover, 0) * 0.05));
    transition: transform .8s var(--ease), filter .5s var(--ease);
    will-change: transform;
}

.project__info {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex; flex-direction: column; gap: .15rem;
}
.project__title {
    font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em;
    color: var(--text);
}
.section--dark .project__title { color: var(--text-on-dark); }
.project__meta { font-size: .85rem; color: var(--text-dim); }
.section--dark .project__meta { color: var(--text-on-dark-dim); }

.project__rating {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-top: .35rem;
    font-size: .82rem;
    line-height: 1;
    letter-spacing: -0.005em;
}
.project__rating-star {
    color: #ffc43d;
    font-size: .95em;
    filter: drop-shadow(0 0 6px rgba(255, 196, 61, 0.35));
    transform: translateY(1px);
}
.project__rating-num {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.section--dark .project__rating-num { color: var(--text-on-dark); }
.project__rating-count {
    color: var(--text-dim);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}
.section--dark .project__rating-count { color: var(--text-on-dark-dim); }
.project__rating-count::before {
    content: "·";
    margin-right: 6px;
    opacity: 0.55;
}

/* Aggregate rating chip in the story timeline */
.story__rating {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}
.story__rating-star {
    color: #ffc43d;
    filter: drop-shadow(0 0 6px rgba(255, 196, 61, 0.35));
    transform: translateY(1px);
}
.story__rating-num {
    font-weight: 600;
    color: var(--text);
}
.story__rating-count {
    opacity: 0.75;
}
.story__rating-count::before {
    content: "·";
    margin-right: 6px;
    opacity: 0.55;
}

.project__arrow {
    position: absolute; top: 1rem; right: 1rem;
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent); color: #fff;
    font-size: .85rem; font-weight: 600;
    transform: translateY(-6px) scale(0.8); opacity: 0;
    transition: transform .35s var(--ease), opacity .35s var(--ease);
}
.project:hover .project__arrow { transform: translateY(0) scale(1); opacity: 1; }

/* ---------- Timeline ---------- */
.timeline-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 6vw, 5rem);
}
.timeline-heading {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 600; letter-spacing: -0.03em;
    margin-bottom: 2rem;
}
.timeline { position: relative; padding-left: 1.25rem; }
.timeline::before {
    content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px;
    background: linear-gradient(to bottom, var(--border-strong) 0%, var(--border) 60%, transparent 100%);
}
.timeline__item { position: relative; padding: 0 0 2.25rem 1.25rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
    position: absolute; left: -0.35rem; top: .45rem;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--bg); border: 1.5px solid var(--border-strong);
    transition: all .3s var(--ease);
}
.timeline__item:hover .timeline__dot {
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 0 6px var(--accent-soft);
}
.timeline__date {
    display: inline-block; font-size: .8rem;
    color: var(--text-faint); margin-bottom: .25rem;
    letter-spacing: -0.005em;
}
.timeline__role {
    font-size: 1.1rem; font-weight: 500; letter-spacing: -0.02em;
    margin-bottom: .15rem;
}
.timeline__company {
    display: inline-block; font-size: .95rem; color: var(--accent);
    position: relative;
}
a.timeline__company::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left;
    transition: transform .35s var(--ease);
}
a.timeline__company:hover::after { transform: scaleX(1); }
.timeline__meta { font-size: .9rem; color: var(--text-dim); margin-top: .35rem; }

.section--dark .timeline__dot { background: var(--bg-dark); }

/* ---------- Skills (Apple spec-sheet look) ---------- */
.skills-spec {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0;
    border-top: 1px solid var(--border);
}
.skill {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    padding-right: 2rem;
}
.skill__name {
    font-size: 1rem; font-weight: 500;
    letter-spacing: -0.02em;
}
.skill__bar {
    width: 120px;
    position: relative; height: 4px;
    background: var(--border); border-radius: var(--radius-full); overflow: hidden;
}
.skill__bar i {
    position: absolute; inset: 0 auto 0 0; width: 0;
    background: var(--accent);
    border-radius: inherit;
    transition: width 1.4s var(--ease-out);
}
.skill.is-visible .skill__bar i { width: var(--lvl, 0%); }

/* ---------- Contact ---------- */
.contact {
    display: grid; grid-template-columns: 1fr 1.2fr;
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
    max-width: var(--max);
    margin: 0 auto;
}
.contact.contact--solo {
    display: block;
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}
.contact.contact--solo .contact__list { align-items: center; gap: 1.75rem; }
.contact.contact--solo .contact__list li { align-items: center; }
.contact.contact--solo .contact__label { letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; }
.contact.contact--solo .contact__value { font-size: 1.25rem; }
.contact__intro {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    color: var(--text-dim);
    max-width: 420px;
    margin-bottom: 2.5rem;
    line-height: 1.45;
}
.section--dark .contact__intro { color: var(--text-on-dark-dim); }

.contact__list { display: flex; flex-direction: column; gap: 1.25rem; }
.contact__list li { display: flex; flex-direction: column; gap: .2rem; }
.contact__label {
    font-size: .8rem; color: var(--text-faint); letter-spacing: -0.005em;
    text-transform: none;
}
.contact__value { font-size: 1.05rem; color: var(--text); transition: color .25s var(--ease); }
.section--dark .contact__value { color: var(--text-on-dark); }
a.contact__value:hover { color: var(--accent); }


/* ---------- Footer ---------- */
.footer {
    background: var(--bg-soft);
    padding: 2rem var(--pad);
    color: var(--text-faint);
    font-size: .8rem;
}
.section--dark + .footer { border-top: 0; }
.footer__inner {
    max-width: var(--max); margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.footer a { transition: color .25s var(--ease); }
.footer a:hover { color: var(--accent); }
:root[data-theme="dark"] .footer { background: #0a0a0a; border-top: 1px solid var(--border); }

/* ---------- Reveal animations ---------- */
.reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity .9s var(--ease), transform .9s var(--ease);
    transition-delay: calc(var(--delay, 0) * 1ms);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .stats { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .timeline-grid { grid-template-columns: 1fr; gap: 3rem; }
    .work-grid { grid-template-columns: repeat(2, 1fr); }
    .contact { grid-template-columns: 1fr; }
    .featured {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .featured__desc { margin-left: auto; margin-right: auto; }
    .featured__cta { justify-content: center; }
    .featured__meta { justify-content: center; }
    .moment.featured { grid-template-columns: 1fr; }
    .hello { grid-template-columns: 1fr; gap: 2.5rem; }
    .hello__portrait { margin: 0 auto; transform: rotate(-1deg); }
    .hello__copy { text-align: center; margin: 0 auto; }
}
@media (max-width: 720px) {
    .nav__links {
        position: fixed; inset: var(--nav-h) 0 auto 0;
        flex-direction: column; gap: 0; padding: 1.25rem var(--pad);
        background: color-mix(in srgb, var(--bg) 94%, transparent);
        backdrop-filter: saturate(180%) blur(20px);
        border-bottom: 1px solid var(--border);
        transform: translateY(-110%);
        transition: transform .4s var(--ease);
    }
    .nav__links.is-open { transform: translateY(0); }
    .nav__links a { padding: 1rem 0; font-size: 1.25rem; }
    .nav__burger { display: inline-grid; place-items: center; }
    .work-grid { grid-template-columns: 1fr; }
    .hero__title { font-size: clamp(2.75rem, 17vw, 5rem); }
    .footer__inner { flex-direction: column; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
    .reveal-line > span { transform: none; }
    .wordreveal .word { color: var(--text); }
    .section--dark .wordreveal .word { color: var(--text-on-dark); }
}
