/*
 * Work system: design tokens + components for Selected Work, Project Library and case studies.
 * Builds on the brand tokens in portfolio.css (--bg, --txt, --txt2, --maroon, --cream, --border).
 */
:root {
    /* Color roles */
    --w-surface: color-mix(in srgb, var(--txt) 3%, transparent);
    --w-surface-hover: color-mix(in srgb, var(--txt) 6%, transparent);
    --w-line: color-mix(in srgb, var(--txt) 12%, transparent);
    --w-line-strong: color-mix(in srgb, var(--txt) 24%, transparent);
    --w-accent: #e0313f;
    --w-muted: color-mix(in srgb, var(--txt2) 78%, transparent);

    /* Typography scale (1.25) */
    --w-fs-xs: .75rem;
    --w-fs-sm: .875rem;
    --w-fs-md: 1rem;
    --w-fs-lg: 1.25rem;
    --w-fs-xl: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
    --w-fs-2xl: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
    --w-fs-3xl: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
    --w-font-display: 'Syne', 'Inter', sans-serif;
    --w-font-mono: 'Fira Code', ui-monospace, monospace;

    /* Spacing scale (4px base) */
    --w-s1: .25rem; --w-s2: .5rem; --w-s3: .75rem; --w-s4: 1rem;
    --w-s5: 1.5rem; --w-s6: 2rem; --w-s7: 3rem; --w-s8: 4rem; --w-s9: 6rem;

    /* Layout */
    --w-container: 1200px;
    --w-container-narrow: 760px;
    --w-gutter: clamp(1rem, 4vw, 2rem);

    /* Shape */
    --w-border: 1px;
    --w-radius-sm: 6px;
    --w-radius: 12px;
    --w-radius-lg: 18px;
    --w-shadow: 0 1px 2px rgb(0 0 0 / .25), 0 12px 32px -12px rgb(0 0 0 / .45);

    /* Layers */
    --w-z-nav: 50;
    --w-z-overlay: 100;

    /* Motion */
    --w-dur-fast: 160ms;
    --w-dur: 320ms;
    --w-dur-slow: 700ms;
    --w-ease: cubic-bezier(.22, 1, .36, 1);

    /* Focus */
    --w-focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--w-accent);
}
[data-theme="light"] {
    --w-accent: var(--cream);
    --w-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 12px 32px -14px rgb(0 0 0 / .4);
}

/* ── Shared atoms ─────────────────────────────────────────── */
.w-container { width: min(100% - 2 * var(--w-gutter), var(--w-container)); margin-inline: auto; }
.w-narrow { width: min(100% - 2 * var(--w-gutter), var(--w-container-narrow)); margin-inline: auto; }
.w-eyebrow-num { font-family: var(--w-font-mono); font-size: var(--w-fs-xs); color: var(--w-muted); letter-spacing: .08em; }
.w-chip {
    display: inline-flex; align-items: center; gap: var(--w-s1);
    padding: .2rem .55rem; border: var(--w-border) solid var(--w-line); border-radius: 999px;
    font-family: var(--w-font-mono); font-size: var(--w-fs-xs); color: var(--txt2); white-space: nowrap;
}
.w-status { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--w-fs-xs); font-weight: 600; color: var(--txt); white-space: nowrap; }
.w-status::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.w-status[data-status="implemented"], .w-status[data-status="verified"] { color: #3ecf8e; }
.w-status[data-status="partial"], .w-status[data-status="in_development"] { color: #5aa9ff; }
.w-status[data-status="concept"] { color: var(--w-muted); }
.w-link {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 44px;
    font-size: var(--w-fs-sm); font-weight: 600; color: var(--txt); text-decoration: none;
    border-bottom: var(--w-border) solid var(--w-line-strong);
    transition: border-color var(--w-dur-fast), color var(--w-dur-fast);
}
.w-link:hover { border-color: var(--w-accent); color: var(--w-accent); }
.w-link i { font-size: .8em; transition: transform var(--w-dur-fast) var(--w-ease); }
.w-link:hover i { transform: translate(2px, -2px); }
.w-section :focus-visible, .w-page :focus-visible { outline: none; box-shadow: var(--w-focus); border-radius: var(--w-radius-sm); }
.w-media {
    position: relative; overflow: hidden; border-radius: var(--w-radius);
    border: var(--w-border) solid var(--w-line); background: var(--w-surface);
}
.w-media img { display: block; width: 100%; height: auto; }

/* ── Selected Work (landing) ───────────────────────────────── */
.w-section { padding-block: var(--w-s9); }
.w-section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--w-s4); margin-bottom: var(--w-s7); }
.w-section-head h2 { font-family: var(--w-font-display); font-size: var(--w-fs-2xl); line-height: 1.05; margin: 0; color: var(--txt); }
.w-section-head p { max-width: 42ch; margin: 0; color: var(--txt2); font-size: var(--w-fs-md); line-height: 1.6; }

.w-featured { display: grid; gap: var(--w-s8); }
.w-feature {
    display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--w-s6); align-items: center;
}
.w-feature:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.w-feature:nth-child(even) .w-feature-media { order: 2; }
.w-feature-media { display: block; }
.w-feature-media img { transition: transform var(--w-dur-slow) var(--w-ease); }
.w-feature-media:hover img, .w-feature-media:focus-visible img { transform: scale(1.02); }
.w-feature-body { display: grid; gap: var(--w-s4); align-content: start; }
.w-feature-top { display: flex; align-items: center; justify-content: space-between; gap: var(--w-s3); }
.w-feature h3 { font-family: var(--w-font-display); font-size: var(--w-fs-xl); line-height: 1.1; margin: 0; }
.w-feature h3 a { color: var(--txt); text-decoration: none; }
.w-feature-type { font-size: var(--w-fs-sm); color: var(--w-muted); margin: 0; }
.w-feature-summary { color: var(--txt2); line-height: 1.65; margin: 0; max-width: 52ch; }
.w-meta { display: grid; grid-template-columns: auto 1fr; gap: var(--w-s2) var(--w-s4); margin: 0; font-size: var(--w-fs-sm); }
.w-meta dt { color: var(--w-muted); }
.w-meta dd { margin: 0; color: var(--txt); }
.w-chips { display: flex; flex-wrap: wrap; gap: var(--w-s2); }
.w-actions { display: flex; flex-wrap: wrap; gap: var(--w-s2) var(--w-s5); padding-top: var(--w-s2); }

/* ── Project Library ───────────────────────────────────────── */
.w-filters {
    display: flex; gap: var(--w-s2); margin-bottom: var(--w-s6);
    overflow-x: auto; scrollbar-width: none; padding-bottom: var(--w-s1);
}
.w-filters::-webkit-scrollbar { display: none; }
.w-filter {
    flex: none; min-height: 40px; padding: 0 var(--w-s4);
    border: var(--w-border) solid var(--w-line); border-radius: 999px; background: transparent;
    color: var(--txt2); font: 500 var(--w-fs-sm)/1 'Inter', sans-serif; cursor: pointer;
    transition: background var(--w-dur-fast), color var(--w-dur-fast), border-color var(--w-dur-fast);
}
.w-filter:hover { border-color: var(--w-line-strong); color: var(--txt); }
.w-filter[aria-pressed="true"] { background: var(--txt); color: var(--bg); border-color: var(--txt); }
.w-filter span { opacity: .6; margin-left: .35rem; font-family: var(--w-font-mono); font-size: var(--w-fs-xs); }
.w-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--w-s5); }
.w-card {
    display: grid; grid-template-rows: auto 1fr; border: var(--w-border) solid var(--w-line); border-radius: var(--w-radius);
    background: var(--w-surface); overflow: hidden; transition: border-color var(--w-dur), background var(--w-dur), transform var(--w-dur) var(--w-ease);
}
.w-card:hover { border-color: var(--w-line-strong); background: var(--w-surface-hover); transform: translateY(-2px); }
.w-card[hidden] { display: none; }
.w-card-media { display: block; border-bottom: var(--w-border) solid var(--w-line); }
.w-card-media img { display: block; width: 100%; height: auto; }
.w-card-body { display: grid; gap: var(--w-s3); padding: var(--w-s5); align-content: start; }
.w-card-top { display: flex; justify-content: space-between; gap: var(--w-s3); }
.w-card h3 { font-size: var(--w-fs-lg); font-weight: 700; margin: 0; line-height: 1.25; }
.w-card h3 a { color: var(--txt); text-decoration: none; }
.w-card h3 a::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.w-card { position: relative; }
.w-card .w-card-links a { position: relative; z-index: 1; }
.w-card p { margin: 0; color: var(--txt2); font-size: var(--w-fs-sm); line-height: 1.6; }
.w-card-links { display: flex; gap: var(--w-s4); margin-top: var(--w-s1); }
.w-empty { color: var(--w-muted); padding: var(--w-s6) 0; }

/* ── Case study page ───────────────────────────────────────── */
.w-page { background: var(--bg); color: var(--txt); min-height: 100vh; }
.w-topbar {
    position: sticky; top: 0; z-index: var(--w-z-nav);
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
    border-bottom: var(--w-border) solid var(--w-line);
}
.w-topbar .w-container { display: flex; align-items: center; justify-content: space-between; gap: var(--w-s4); min-height: 64px; }
.w-topbar .nav-brand-logo { height: 24px; }
.w-hero { padding-block: var(--w-s8) var(--w-s7); }
.w-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--w-s3); margin-bottom: var(--w-s4); }
.w-hero h1 { font-family: var(--w-font-display); font-size: var(--w-fs-3xl); line-height: 1; margin: 0 0 var(--w-s4); }
.w-hero-lead { font-size: var(--w-fs-lg); line-height: 1.6; color: var(--txt2); max-width: 60ch; margin: 0; }
.w-cover { margin-bottom: var(--w-s8); }
.w-cover img { animation: w-reveal var(--w-dur-slow) var(--w-ease) both; }
@keyframes w-reveal { from { clip-path: inset(6% 6% 6% 6% round var(--w-radius)); opacity: .4; } to { clip-path: inset(0 round 0); opacity: 1; } }
.w-facts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--w-s5);
    padding: var(--w-s5) 0; border-block: var(--w-border) solid var(--w-line); margin-bottom: var(--w-s8);
}
.w-facts dt { font-size: var(--w-fs-xs); color: var(--w-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--w-s1); }
.w-facts dd { margin: 0; font-size: var(--w-fs-sm); line-height: 1.5; }
.w-block { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: var(--w-s6); padding-block: var(--w-s6); border-top: var(--w-border) solid var(--w-line); }
.w-block h2 { font-size: var(--w-fs-md); font-weight: 600; margin: 0; color: var(--w-muted); }
.w-block-body { font-size: var(--w-fs-md); line-height: 1.75; color: var(--txt); }
.w-block-body p { margin: 0 0 var(--w-s4); max-width: 68ch; }
.w-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--w-s3); max-width: 68ch; }
.w-list li { position: relative; padding-left: var(--w-s5); }
.w-list li::before { content: ''; position: absolute; left: 0; top: .8em; width: .75rem; height: var(--w-border); background: var(--w-accent); }
.w-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--w-s4); }
.w-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--w-s4); padding-block: var(--w-s7) var(--w-s9); border-top: var(--w-border) solid var(--w-line); margin-top: var(--w-s6); }
.w-pager a { display: grid; gap: var(--w-s1); padding: var(--w-s5); border: var(--w-border) solid var(--w-line); border-radius: var(--w-radius); text-decoration: none; color: var(--txt); transition: border-color var(--w-dur-fast), background var(--w-dur-fast); }
.w-pager a:hover { border-color: var(--w-line-strong); background: var(--w-surface-hover); }
.w-pager a:last-child { text-align: right; }
.w-pager small { color: var(--w-muted); font-size: var(--w-fs-xs); text-transform: uppercase; letter-spacing: .08em; }
.w-pager strong { font-size: var(--w-fs-lg); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .w-feature, .w-feature:nth-child(even) { grid-template-columns: 1fr; gap: var(--w-s5); }
    .w-feature:nth-child(even) .w-feature-media { order: 0; }
    .w-block { grid-template-columns: 1fr; gap: var(--w-s3); }
    .w-section { padding-block: var(--w-s8); }
}
@media (max-width: 560px) {
    .w-pager { grid-template-columns: 1fr; }
    .w-pager a:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .w-cover img { animation: none; }
    .w-card, .w-card:hover, .w-feature-media img, .w-link i { transition: none; transform: none !important; }
}

/* Hero positioning copy (landing). */
.hero-positioning { font-size: clamp(1.05rem, .9rem + .6vw, 1.35rem); font-weight: 600; line-height: 1.4; color: var(--txt); max-width: 34ch; margin: .25rem 0 .6rem; }
.hero-supporting { font-size: var(--w-fs-sm); line-height: 1.65; color: var(--txt2); max-width: 52ch; margin: 0 0 1.25rem; }
@media (max-width: 600px) { .hero-supporting { display: none; } }

/* Positioning: six competency cards (primary + supporting). */
.hero-services.hero-services-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .hero-services.hero-services-six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Development process. */

/* Cleaner hero: smaller name, tighter rhythm, buttons never covered. */
.hero-cinematic .hero-name { font-size: clamp(3rem, 5.4vw, 6rem); margin-bottom: 1.25rem; }
.hero-cinematic .hero-kicker { letter-spacing: .14em; margin-bottom: 1rem; }
.hero-cinematic .hero-positioning { font-size: clamp(1.1rem, .95rem + .5vw, 1.4rem); max-width: 30ch; }
.hero-cinematic .hero-actions { gap: .75rem; }
.hero-cinematic .hero-actions .btn { min-height: 44px; }
.hero-cinematic .hero-actions .btn:nth-child(3) { border-color: transparent; padding-inline: .5rem; }
@media (max-width: 1023px) { .hero-cinematic .hero-name { font-size: clamp(2.75rem, 9vw, 4.5rem); } }
@media (max-width: 600px) { .hero-cinematic .hero-name { font-size: clamp(2.4rem, 10.5vw, 3.4rem); } }

/* ── Hero v2 (valfx-style hierarchy) ───────────────────────── */
.hero-cinematic .hero-v2 {
    position: absolute; inset: 0; z-index: 3; margin-inline: auto;
    display: grid; grid-template-rows: 1fr auto; padding-top: 110px; padding-bottom: var(--w-s6);
    pointer-events: none;
}
.hero-v2 > * { pointer-events: auto; }
.hero-v2-intro { align-self: start; max-width: 360px; display: grid; gap: var(--w-s3); }
.hero-v2-intro .hero-kicker { margin: 0; font-family: var(--w-font-mono); font-size: var(--w-fs-xs); letter-spacing: .14em; color: var(--txt2); }
.hero-cinematic .hero-v2-intro .hero-positioning { font-size: var(--w-fs-md); font-weight: 600; line-height: 1.45; max-width: none; margin: 0; }
.hero-v2-intro .hero-supporting { font-size: var(--w-fs-sm); margin: 0; color: var(--txt2); }
.hero-cinematic .hero-v2 .hero-actions { display: grid; gap: 0; margin-top: var(--w-s3); }
.hero-cta {
    display: flex; justify-content: space-between; align-items: center; min-height: 44px;
    border-bottom: var(--w-border) solid var(--w-line-strong); color: var(--txt2);
    font-size: var(--w-fs-sm); font-weight: 500; text-decoration: none;
    transition: color var(--w-dur-fast), border-color var(--w-dur-fast), padding var(--w-dur) var(--w-ease);
}
.hero-cta-primary { color: var(--txt); font-weight: 700; border-bottom-color: var(--txt); }
.hero-cta:hover, .hero-cta:focus-visible { color: var(--txt); border-color: var(--w-accent); padding-left: var(--w-s2); outline: none; }
.hero-cta span { font-size: 1.1em; }

.hero-v2-base { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: var(--w-s5); }
.hero-v2-role { margin: 0 0 1.2rem; font-size: var(--w-fs-sm); font-weight: 600; line-height: 1.3; color: var(--txt); }
.hero-v2-role span { color: var(--w-accent); font-family: var(--w-font-mono); font-weight: 500; }
.hero-cinematic .hero-name.hero-v2-name {
    margin: 0; justify-self: end; text-align: right;
    font-size: clamp(4rem, 13vw, 13rem); line-height: .82; letter-spacing: -.05em;
}
.hero-v2-surname {
    display: block; margin-top: .6rem; font-family: var(--w-font-mono); font-size: var(--w-fs-sm);
    font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--txt2);
}
.hero-v2-meta { margin: 0 0 1.2rem; font-family: var(--w-font-mono); font-size: var(--w-fs-xs); line-height: 1.6; color: var(--w-muted); text-align: right; }

@media (max-width: 900px) {
    .hero-v2-base { grid-template-columns: 1fr auto; }
    .hero-cinematic .hero-name.hero-v2-name { grid-column: 1 / -1; grid-row: 1; justify-self: start; text-align: left; font-size: clamp(3rem, 16vw, 8rem); }
    .hero-v2-role { grid-row: 2; margin: 0; }
    .hero-v2-meta { grid-row: 2; margin: 0; }
}
@media (max-width: 600px) {
    .hero-cinematic .hero-v2 { padding-top: 92px; }
    .hero-v2-intro .hero-supporting { display: none; }
    .hero-v2-intro { max-width: 300px; }
}

/* Hero v2 on phones: fit one screen, left-aligned full-width CTAs, name visible above the fold. */
.hero-cinematic .hero-v2 .hero-actions { justify-content: stretch; width: 100%; }
@media (max-width: 600px) {
    .hero.hero-cinematic { height: 100svh; min-height: 600px; max-height: 900px; }
    .hero-cinematic .hero-v2 { padding-inline: 1.25rem; padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
    .hero-v2-intro { max-width: none; gap: var(--w-s2); }
    .hero-cinematic .hero-v2-intro .hero-positioning { font-size: 1.05rem; max-width: 26ch; }
    .hero-cta { min-height: 46px; font-size: var(--w-fs-md); }
    .hero-v2-base { gap: var(--w-s3) var(--w-s4); }
    .hero-v2-surname { letter-spacing: .22em; font-size: var(--w-fs-xs); }
    .hero-v2-role { font-size: var(--w-fs-xs); }
    /* Portrait sits behind the name; keep text readable over it. */
    .hero-cinematic .hero-media img { object-position: 62% 18%; }
    .hero-cinematic .hero-raymond-overlay { background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 40%, rgba(0,0,0,.25) 62%, var(--bg) 100%); }
}
@media (max-width: 600px) and (max-height: 700px) {
    .hero-v2-intro .hero-kicker { display: none; }
}

/* ── Unified section header: (01) label · big title · lead ── */
main { counter-reset: w-sec; }
.w-head {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 38ch); gap: var(--w-s3) var(--w-s7);
    align-items: end; margin: 0 0 var(--w-s7); text-align: left;
}
.w-head-label {
    grid-column: 1 / -1; display: flex; gap: var(--w-s3); align-items: center;
    font-family: var(--w-font-mono); font-size: var(--w-fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--w-muted);
}
.w-head-label::before { counter-increment: w-sec; content: '(' counter(w-sec, decimal-leading-zero) ')'; color: var(--w-accent); }
.w-head-label::after { content: ''; flex: 1; height: var(--w-border); background: var(--w-line); }
.w-head-title {
    margin: 0; font-family: var(--w-font-display); font-size: var(--w-fs-2xl); line-height: 1.02;
    letter-spacing: -.02em; color: var(--txt); text-align: left;
}
.w-head-title::after { content: none !important; }
.w-head-lead { margin: 0; color: var(--txt2); font-size: var(--w-fs-md); line-height: 1.6; }
.w-head-sub { margin-bottom: var(--w-s5); }
.w-head-sub .w-head-title { font-size: var(--w-fs-xl); }
@media (max-width: 760px) { .w-head { grid-template-columns: 1fr; } }

/* Experience header used to be centred/cream; keep it legible on that section's own background. */
.exp-raymond-section .w-head-title,
.exp-raymond-section .w-head-lead { color: inherit; }

/* ── Journey: numbered rows, small sticky poster ── */
.w-journey { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: var(--w-s7); align-items: start; }
.w-journey .timeline-story-art { position: sticky; top: 96px; max-width: 220px; }
.w-journey .timeline-story-art img { width: 100%; height: auto; border-radius: var(--w-radius); }
.w-rows { list-style: none; margin: 0; padding: 0; border-top: var(--w-border) solid var(--w-line); }
.w-row {
    display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: var(--w-s4); align-items: baseline;
    padding: var(--w-s4) var(--w-s2); border-bottom: var(--w-border) solid var(--w-line);
    transition: background var(--w-dur-fast), padding var(--w-dur) var(--w-ease);
}
.w-row:hover { background: var(--w-surface-hover); padding-left: var(--w-s4); }
.w-row-num { font-family: var(--w-font-mono); font-size: var(--w-fs-xs); color: var(--w-muted); }
.w-row-title { font-size: var(--w-fs-md); font-weight: 600; color: var(--txt); line-height: 1.4; }
.w-row-meta { font-family: var(--w-font-mono); font-size: var(--w-fs-xs); color: var(--txt2); white-space: nowrap; text-align: right; }
.w-row-link { cursor: pointer; }
.w-row-link .w-row-title::after { content: ' ↗'; color: var(--w-accent); }
.w-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--w-accent); }
@media (max-width: 760px) {
    .w-journey { grid-template-columns: 1fr; }
    .w-journey .timeline-story-art { display: none; }
    .w-row { grid-template-columns: 2.25rem minmax(0, 1fr); }
    .w-row-meta { grid-column: 2; text-align: left; }
}

/* ── Scroll reveal (progressive: content stays visible without JS) ── */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity var(--w-dur-slow) var(--w-ease), transform var(--w-dur-slow) var(--w-ease); }
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }
.js-reveal .w-feature[data-reveal] .w-feature-media img { clip-path: inset(0 0 100% 0); transition: clip-path 1s var(--w-ease); }
.js-reveal .w-feature[data-reveal].is-in .w-feature-media img { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) {
    .js-reveal [data-reveal], .js-reveal .w-feature[data-reveal] .w-feature-media img { opacity: 1; transform: none; clip-path: none; transition: none; }
}

/* Experience sits on a cream surface in dark mode: darker label, line and lead for AA contrast. */
.exp-raymond-section .w-head-label { color: rgba(26, 26, 26, .62); }
.exp-raymond-section .w-head-label::after { background: rgba(26, 26, 26, .14); }
.exp-raymond-section .w-head-lead { color: rgba(26, 26, 26, .68); }
[data-theme="light"] .exp-raymond-section .w-head-label,
[data-theme="light"] .exp-raymond-section .w-head-lead { color: var(--txt2); }
[data-theme="light"] .exp-raymond-section .w-head-label::after { background: var(--w-line); }

/* About: body follows the left-aligned header. */
.about-section .about-desc { text-align: left; margin-inline: 0; max-width: 62ch; font-size: var(--w-fs-lg); line-height: 1.7; }
.about-section .details-grid-minimal { margin-inline: 0; max-width: 520px; }

/* Minimal mobile hero (valfx pattern): one tagline, one link, role label over the portrait, ruler footer. */
.hero-v2-ruler { display: none; }
@media (max-width: 600px) {
    .hero-v2-intro .hero-kicker,
    .hero-v2-intro .hero-supporting,
    .hero-v2 .hero-actions .hero-cta:not(.hero-cta-primary),
    .hero-v2-meta,
    .hero-v2-surname { display: none; }
    .hero-cinematic .hero-v2-intro .hero-positioning { font-size: .95rem; font-weight: 600; max-width: 24ch; }
    .hero-cta-primary { font-size: 1.05rem; }
    .hero-v2-base { grid-template-columns: 1fr; gap: .5rem; }
    .hero-v2-role { grid-row: 1; font-size: .7rem; color: var(--txt2); opacity: .85; margin: 0; }
    .hero-cinematic .hero-name.hero-v2-name { grid-row: 2; }
    .hero-v2-ruler {
        display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem;
        margin-top: .9rem; font-family: var(--w-font-mono); font-size: .75rem; font-weight: 600; color: var(--txt);
    }
    .hero-v2-ruler i {
        height: 14px;
        background: repeating-linear-gradient(90deg, var(--w-line-strong) 0 1px, transparent 1px 14px);
        -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
        mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    }
}
@media (max-width: 600px) {
    .hero-cinematic .hero-name.hero-v2-name { font-size: clamp(2.8rem, 14.5vw, 6rem); }
    .hero-cinematic .hero-v2 { left: 0; right: 0; width: auto; max-width: none; padding-inline: 1.25rem; }
}

/* Phones: portrait starts below the intro copy so text never covers the face. */
@media (max-width: 600px) {
    .hero-cinematic .hero-media { top: 34%; bottom: 0; left: 0; right: 0; }
    .hero-cinematic .hero-media img { object-position: 58% 12%; }
    .hero-cinematic .hero-raymond-overlay { background: linear-gradient(180deg, var(--bg) 0%, transparent 22%, transparent 55%, rgba(0,0,0,.35) 75%, var(--bg) 100%); }
}

/* ── Navbar (valfx pattern): plain text links with a small index, no pill ── */
.nav-pill.nav-v2 { counter-reset: w-nav; background: none; border: 0; box-shadow: none; padding: 0; gap: clamp(1rem, 2.4vw, 2.5rem); }
[data-theme="light"] .nav-pill.nav-v2 { background: none; border: 0; }
.nav-v2 .nav-link {
    position: relative; display: inline-flex; align-items: flex-start; gap: .25rem;
    padding: .25rem 0; border-radius: 0; background: none !important;
    color: var(--txt); font-weight: 500; font-size: .82rem; letter-spacing: .01em;
}
.nav-v2 .nav-link::after {
    counter-increment: w-nav; content: counter(w-nav, decimal-leading-zero);
    font-family: var(--w-font-mono); font-size: .55rem; line-height: 1; color: var(--w-muted); transform: translateY(-.15rem);
}
.nav-v2 .nav-link::before {
    content: ''; position: absolute; left: 0; right: 1.1rem; bottom: 0; height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: left; transition: transform var(--w-dur) var(--w-ease);
}
.nav-v2 .nav-link:hover::before, .nav-v2 .nav-link.active::before, .nav-v2 .nav-link:focus-visible::before { transform: scaleX(1); }
.nav-v2 .nav-link.active { color: var(--txt); }
.nav-v2 .nav-link:focus-visible { outline: none; }

/* Language + theme: quiet text controls instead of boxed pills. */
.nav-actions .lang-toggle { background: none; border: 0; padding: 0; gap: .35rem; }
.nav-actions .lang-option { background: none !important; color: var(--w-muted); font-family: var(--w-font-mono); font-size: .7rem; padding: .25rem .1rem; }
.nav-actions .lang-option.active { color: var(--txt); text-decoration: underline; text-underline-offset: 4px; }
.nav-actions .theme-btn { background: none; border: 0; color: var(--txt2); }

/* Mobile: two-line menu icon, full-screen list with large numbered links. */
.hamburger span:nth-child(3) { display: none; }
@media (max-width: 900px) {
    .nav-pill.nav-v2.open {
        position: fixed; inset: 64px 0 0 0; z-index: 90; flex-direction: column; align-items: stretch; gap: 0;
        padding: var(--w-s5) 1.25rem; background: var(--bg); border-top: var(--w-border) solid var(--w-line); border-radius: 0;
    }
    .nav-v2.open .nav-link {
        justify-content: space-between; width: 100%; padding: var(--w-s4) 0; font-size: 1.5rem; font-weight: 600;
        border-bottom: var(--w-border) solid var(--w-line);
    }
    .nav-v2.open .nav-link::after { font-size: .75rem; }
    .nav-v2.open .nav-link::before { display: none; }
}
@media (max-width: 900px) {
    /* GSAP leaves an inline transform on the nav container, which would trap position:fixed. */
    .navbar .container:has(.nav-v2.open) { transform: none !important; }
    .nav-pill.nav-v2.open { top: 64px; left: 0; right: 0; bottom: auto; width: 100vw; height: calc(100dvh - 64px); overflow-y: auto; }
}

/* ── Footer (valfx pattern): CTA email, numbered columns, giant wordmark, ruler ── */
.w-footer { padding: var(--w-s9) 0 var(--w-s5); border-top: var(--w-border) solid var(--w-line); background: var(--bg); }
.w-footer-cta { display: grid; gap: var(--w-s3); padding-bottom: var(--w-s7); border-bottom: var(--w-border) solid var(--w-line); }
.w-footer-kicker { margin: 0; color: var(--txt2); font-size: var(--w-fs-md); }
.w-footer-mail {
    font-family: var(--w-font-display); font-size: clamp(1.6rem, 1rem + 3.2vw, 3.6rem); line-height: 1.05;
    color: var(--txt); text-decoration: none; word-break: break-word; width: fit-content;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size var(--w-dur) var(--w-ease);
}
.w-footer-mail:hover, .w-footer-mail:focus-visible { background-size: 100% 2px; outline: none; }
.w-footer-mail span { color: var(--w-accent); }
.w-footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--w-s6); padding: var(--w-s7) 0; }
.w-footer-label { margin: 0 0 var(--w-s4); font-family: var(--w-font-mono); font-size: var(--w-fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--w-muted); }
.w-footer-nav, .w-footer-social { display: grid; gap: var(--w-s2); margin: 0; padding: 0; list-style: none; }
.w-footer-nav a, .w-footer-social a {
    display: inline-flex; align-items: center; gap: var(--w-s2); min-height: 32px; width: fit-content;
    color: var(--txt); text-decoration: none; font-size: var(--w-fs-md); transition: color var(--w-dur-fast), transform var(--w-dur) var(--w-ease);
}
.w-footer-nav a:hover, .w-footer-social a:hover { color: var(--w-accent); transform: translateX(4px); }
.w-footer-social i { width: 1.1rem; color: var(--w-muted); }
.w-footer-export { display: grid; gap: var(--w-s2); justify-items: start; }
.w-footer-btn {
    display: inline-flex; align-items: center; gap: var(--w-s2); min-height: 40px; padding: 0 var(--w-s4);
    border: var(--w-border) solid var(--w-line-strong); border-radius: 999px; background: transparent;
    color: var(--txt); font: 500 var(--w-fs-sm)/1 'Inter', sans-serif; text-decoration: none; cursor: pointer;
    transition: background var(--w-dur-fast), border-color var(--w-dur-fast);
}
.w-footer-btn:hover { background: var(--w-surface-hover); border-color: var(--txt); }
.w-footer-word {
    margin: var(--w-s4) 0 0; font-family: var(--w-font-display); font-weight: 800; line-height: .8; letter-spacing: -.05em;
    font-size: clamp(4.5rem, 21vw, 22rem); color: var(--txt); white-space: nowrap; overflow: hidden; user-select: none;
}
.w-footer-word span { color: var(--w-accent); }
.w-footer-bottom {
    display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--w-s4);
    padding-top: var(--w-s4); font-family: var(--w-font-mono); font-size: var(--w-fs-xs); color: var(--txt2);
}
.w-footer-bottom i { height: 12px; background: repeating-linear-gradient(90deg, var(--w-line-strong) 0 1px, transparent 1px 14px); -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.w-footer-top { color: var(--txt); text-decoration: none; }
.w-footer-top:hover { color: var(--w-accent); }
@media (max-width: 760px) {
    .w-footer-grid { grid-template-columns: 1fr 1fr; }
    .w-footer-grid > div:last-child { grid-column: 1 / -1; }
    .w-footer-bottom { grid-template-columns: 1fr auto; }
    .w-footer-bottom i, .w-footer-bottom span:nth-of-type(2) { display: none; }
}
.w-footer-word { font-size: clamp(3.5rem, 15.5vw, 15.5rem); }
@media (min-width: 1240px) { .w-footer-word { font-size: 15.5rem; } }
.w-footer-word { font-size: clamp(3rem, 12.6vw, 12.6rem); }
@media (min-width: 1240px) { .w-footer-word { font-size: 12.6rem; } }
@media (max-width: 600px) { .w-footer-word { font-size: 15.5vw; } }


.w-dialog {
    width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; overflow: auto;
    border: var(--w-border) solid var(--w-line-strong); border-radius: var(--w-radius-lg);
    background: var(--bg); color: var(--txt); box-shadow: var(--w-shadow);
}
.w-dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.w-dialog[open] { animation: w-dialog-in var(--w-dur) var(--w-ease); }
@keyframes w-dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.w-dialog-head { display: flex; justify-content: space-between; gap: var(--w-s4); padding: var(--w-s5) var(--w-s5) 0; }
.w-dialog-head h3 { margin: 0 0 var(--w-s1); font-size: var(--w-fs-lg); }
.w-dialog-head p { margin: 0; font-size: var(--w-fs-sm); color: var(--txt2); line-height: 1.55; }
.w-dialog-close { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--w-surface-hover); color: var(--txt); font-size: 1.4rem; cursor: pointer; }
.w-dialog-body.form-card { margin: 0; border: 0; background: none; box-shadow: none; padding: var(--w-s5); }
@media (prefers-reduced-motion: reduce) { .w-dialog[open] { animation: none; } }

/* ── Experience: sticky cinematic stage ───────────────────── */
.exp-stage-section { background: #0a0a0a; color: var(--cream, #fef9e1); padding-block: var(--w-s9, 6rem) var(--w-s7, 3rem); }
.exp-stage-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--w-s8, 3rem); }
.exp-stage { position: sticky; top: 88px; height: calc(100svh - 120px); align-self: start; overflow: hidden; background: #000; border: 1px solid var(--w-line); border-radius: var(--w-radius-sm); }
.exp-stage::before, .exp-stage::after { content: ''; position: absolute; left: 0; right: 0; height: 7%; background: #000; z-index: 3; }
.exp-stage::before { top: 0; } .exp-stage::after { bottom: 0; }
.exp-frame { position: absolute; inset: 0; opacity: 0; transition: opacity var(--w-dur-slow, .9s) var(--w-ease); background: radial-gradient(120% 90% at 25% 15%, rgba(200, 16, 46, .45), transparent 60%), #0d0707; }
.exp-frame.is-active { opacity: 1; }
.exp-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.09); transition: transform 7s linear; }
.exp-frame.is-active img { transform: scale(1); }
.exp-stage .exp-counter { position: absolute; z-index: 4; left: 1.2rem; bottom: 9%; font: 800 clamp(3rem, 8vw, 6.5rem)/1 var(--w-font-display); color: transparent; -webkit-text-stroke: 1px var(--cream, #fef9e1); }
.exp-chapter { min-height: 82svh; display: flex; flex-direction: column; justify-content: center; gap: .7rem; }
.is-enhanced .exp-chapter { opacity: .3; transition: opacity .5s var(--w-ease); }
.is-enhanced .exp-chapter.is-active { opacity: 1; }
.exp-meta { font: 500 .72rem/1.4 var(--w-font-mono); letter-spacing: .08em; text-transform: uppercase; }
.exp-dim { opacity: .6; }
.exp-role { margin: 0; font: italic 700 clamp(1.6rem, 1.1rem + 2vw, 2.6rem)/1.08 'Playfair Display', Georgia, serif; }
.exp-company { margin: 0; font-weight: 600; color: var(--w-accent); }
.exp-desc { margin: 0; max-width: 46ch; line-height: 1.65; opacity: .8; }
.exp-list { margin: .4rem 0 0; padding: 0; list-style: none; display: grid; gap: .4rem; max-width: 46ch; font-size: .85rem; opacity: .8; }
.exp-list li { position: relative; padding-left: 1rem; }
.exp-list li::before { content: ''; position: absolute; left: 0; top: .7em; width: .5rem; height: 1px; background: var(--w-accent); }
.exp-actions { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin-top: .6rem; }
.exp-link { background: none; border: 0; padding: 0; color: inherit; font: 600 .8rem var(--w-font-mono); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--w-accent); }
@media (max-width: 900px) {
    .exp-stage-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .exp-stage { top: 64px; height: 34svh; z-index: 5; }
    .exp-chapter { min-height: 66svh; }
}
@media (prefers-reduced-motion: reduce) {
    .exp-frame, .exp-frame img, .is-enhanced .exp-chapter { transition: none; }
    .exp-frame img { transform: none; }
}

/* ── Process: editorial index (rows reveal their description on hover/focus) ── */
.proc-index { list-style: none; margin: 0; padding: 0; border-top: var(--w-border) solid var(--w-line); }
.proc-row { display: grid; grid-template-columns: 4rem 1fr auto; grid-template-areas: "n t a" ". p ."; column-gap: var(--w-s4); padding-block: var(--w-s5); border-bottom: var(--w-border) solid var(--w-line); outline: none; transition: padding var(--w-dur-slow) var(--w-ease), background var(--w-dur-slow); }
.proc-num { grid-area: n; align-self: center; font: 500 var(--w-fs-xs) var(--w-font-mono); letter-spacing: .08em; color: var(--w-muted); }
.proc-title { grid-area: t; margin: 0; font: 700 clamp(1.6rem, 1rem + 3vw, 3.4rem)/1.05 var(--w-font-display); color: var(--txt); transition: color var(--w-dur) var(--w-ease), transform var(--w-dur-slow) var(--w-ease); }
.proc-desc { grid-area: p; margin: 0; max-width: 56ch; max-height: 0; overflow: hidden; opacity: 0; line-height: 1.6; color: var(--txt2); transition: max-height var(--w-dur-slow) var(--w-ease), opacity var(--w-dur), margin var(--w-dur); }
.proc-arrow { grid-area: a; align-self: center; font-size: 1.6rem; color: var(--w-accent); opacity: 0; transform: translateX(-10px); transition: opacity var(--w-dur), transform var(--w-dur); }
.proc-row:hover, .proc-row:focus-visible { padding-block: var(--w-s6); background: linear-gradient(90deg, rgba(200, 16, 46, .12), transparent); }
.proc-row:hover .proc-title, .proc-row:focus-visible .proc-title { color: var(--w-accent); transform: translateX(.6rem); }
.proc-row:hover .proc-desc, .proc-row:focus-visible .proc-desc { max-height: 8rem; opacity: 1; margin-top: var(--w-s3); }
.proc-row:hover .proc-arrow, .proc-row:focus-visible .proc-arrow { opacity: 1; transform: none; }
@media (hover: none) { .proc-desc { max-height: none; opacity: 1; margin-top: var(--w-s2); } .proc-arrow { display: none; } }
@media (max-width: 900px) { .proc-row { grid-template-columns: 2.5rem 1fr; } .proc-arrow { display: none; } }
@media (prefers-reduced-motion: reduce) { .proc-row, .proc-title, .proc-desc, .proc-arrow { transition: none; } }

/* ── Contact: noir stage, arched portrait with a warm spotlight; the form opens in a dialog ── */
.contact-noir { min-height: 100svh; padding: 72px clamp(1.25rem, 6vw, 6rem) 0; box-sizing: border-box; display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: var(--w-s8); background: radial-gradient(60% 60% at 25% 55%, rgba(210, 160, 90, .22), transparent 70%), #050505; color: var(--cream, #fef9e1); }
.contact-noir-arch { justify-self: center; overflow: hidden; border-radius: 999px 999px 0 0; border: 1px solid rgba(214, 170, 100, .6); box-shadow: 0 0 80px rgba(214, 170, 100, .18); }
.contact-noir-arch img { display: block; height: calc(100svh - 112px); width: auto; max-width: 100%; object-fit: cover; }
.contact-noir-copy { display: grid; gap: var(--w-s5); justify-items: start; }
.contact-noir h2 { margin: 0; font: italic 700 clamp(2rem, 1rem + 3.5vw, 4rem)/1.05 'Playfair Display', Georgia, serif; color: #d6aa64; }
.contact-noir-mail { font: 800 clamp(1.4rem, .6rem + 3.2vw, 3.6rem)/1.1 var(--w-font-display); color: inherit; text-decoration: none; border-bottom: 1px solid #d6aa64; padding-bottom: .3rem; overflow-wrap: anywhere; transition: color var(--w-dur) var(--w-ease); }
.contact-noir-mail:hover, .contact-noir-mail:focus-visible { color: #d6aa64; }
.contact-noir-btn { display: inline-flex; align-items: center; gap: .6rem; padding: .95rem 1.6rem; border: 1px solid var(--cream, #fef9e1); border-radius: 999px; background: var(--cream, #fef9e1); color: #5b0b0e; font: 600 .85rem var(--w-font-mono); letter-spacing: .06em; cursor: pointer; transition: transform var(--w-dur) var(--w-ease), background var(--w-dur); }
.contact-noir-btn:hover { transform: translateY(-2px); background: #fff; }
.contact-noir-btn:focus-visible, .contact-noir-mail:focus-visible { outline: 2px solid #d6aa64; outline-offset: 4px; }
@media (max-width: 860px) {
    .contact-noir { grid-template-columns: 1fr; gap: var(--w-s5); padding-bottom: var(--w-s7); }
    .contact-noir-arch { order: -1; } .contact-noir-arch img { height: 52svh; }
}

/* Narrow screens: hero is photo + name only (face stays clear); the intro copy and links live at the start of About. */
.about-intro { display: none; }
@media (max-width: 900px) {
    .hero-v2-intro { display: none; }
    .hero-cinematic .hero-media { top: 0; bottom: 0; left: 0; right: 0; }
    .hero-cinematic .hero-media img { object-position: 60% 8%; }
    .hero-cinematic .hero-raymond-overlay { background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, transparent 25%, transparent 55%, rgba(0, 0, 0, .8) 85%, var(--bg) 100%); }
    .about-desc-wide { display: none; }
    .about-intro { display: grid; gap: var(--w-s3); max-width: 34rem; margin-bottom: var(--w-s6); }
    .about-intro-lead { margin: 0; font-size: var(--w-fs-lg); font-weight: 600; line-height: 1.45; color: var(--txt); }
    .about-intro .hero-supporting { margin: 0; font-size: var(--w-fs-sm); color: var(--txt2); }
    .about-intro .hero-actions { display: grid; justify-content: stretch; width: 100%; margin: var(--w-s2) 0 0; }
}
