/* Storyfront site. Two themes on one art direction:
   night (default): ink-dark sky, cream type, ember accent; day: warm sand sky, ink type, burnt-orange accent.
   Colours are registered custom properties, so switching theme fades them instead of snapping. */

@property --bg { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --bg-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink-3 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --line { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-line { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --glass { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --panel { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface-strong { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --shade { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --shade-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --card-a { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --card-b { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --error { syntax: '<color>'; inherits: true; initial-value: transparent; }

:root {
    --ease-theme: cubic-bezier(.45, 0, .2, 1);
    transition:
        --bg 1.8s var(--ease-theme),
        --bg-2 1.8s var(--ease-theme),
        --ink 1.8s var(--ease-theme),
        --ink-2 1.8s var(--ease-theme),
        --ink-3 1.8s var(--ease-theme),
        --ink-soft 1.8s var(--ease-theme),
        --line 1.8s var(--ease-theme),
        --accent 1.8s var(--ease-theme),
        --accent-2 1.8s var(--ease-theme),
        --accent-soft 1.8s var(--ease-theme),
        --accent-line 1.8s var(--ease-theme),
        --glass 1.8s var(--ease-theme),
        --panel 1.8s var(--ease-theme),
        --surface 1.8s var(--ease-theme),
        --surface-strong 1.8s var(--ease-theme),
        --surface-soft 1.8s var(--ease-theme),
        --shade 1.8s var(--ease-theme),
        --shade-2 1.8s var(--ease-theme),
        --card-a 1.8s var(--ease-theme),
        --card-b 1.8s var(--ease-theme),
        --error 1.8s var(--ease-theme);
}
:root.theme-instant { transition: none; }

:root, :root[data-theme="dark"] {
    --bg: #0d0806;
    --bg-2: #2a1108;
    --ink: #f4ece1;
    --ink-2: rgba(244, 236, 225, 0.66);
    --ink-3: rgba(244, 236, 225, 0.55);
    --ink-soft: rgba(244, 236, 225, 0.45);
    --line: rgba(244, 236, 225, 0.14);
    --accent: #ff6a2b;
    --accent-2: #ffb36b;
    --accent-soft: rgba(255, 106, 43, 0.16);
    --accent-line: rgba(255, 179, 107, 0.45);
    --glass: rgba(255, 230, 205, 0.06);
    --panel: rgba(13, 8, 6, 0.36);
    --surface: rgba(13, 8, 6, 0.62);
    --surface-strong: rgba(13, 8, 6, 0.82);
    --surface-soft: rgba(13, 8, 6, 0.5);
    --shade: rgba(8, 5, 4, 0.7);
    --shade-2: rgba(8, 5, 4, 0.45);
    --card-a: rgba(255, 230, 205, 0.05);
    --card-b: rgba(255, 230, 205, 0.015);
    --error: #ff8a7a;
    color-scheme: dark;
}
:root[data-theme="light"] {
    --bg: #efe5d6;
    --bg-2: #e3cfae;
    --ink: #1e150f;
    --ink-2: rgba(30, 21, 15, 0.74);
    --ink-3: rgba(30, 21, 15, 0.72);
    --ink-soft: rgba(30, 21, 15, 0.4);
    --line: rgba(30, 21, 15, 0.16);
    --accent: #c2410c;
    --accent-2: #9a3412;
    --accent-soft: rgba(194, 65, 12, 0.1);
    --accent-line: rgba(194, 65, 12, 0.4);
    --glass: rgba(255, 255, 255, 0.45);
    --panel: rgba(239, 229, 214, 0.42);
    --surface: rgba(239, 229, 214, 0.74);
    --surface-strong: rgba(239, 229, 214, 0.9);
    --surface-soft: rgba(255, 250, 243, 0.55);
    --shade: rgba(110, 80, 50, 0.22);
    --shade-2: rgba(110, 80, 50, 0.1);
    --card-a: rgba(255, 255, 255, 0.5);
    --card-b: rgba(255, 255, 255, 0.22);
    --error: #b42318;
    color-scheme: light;
}

:root {

    --font-display: 'Instrument Serif', Georgia, serif;
    --font-ui: 'Inter Tight', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --gutter: clamp(16px, 3.6vw, 56px);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-io: cubic-bezier(.77, 0, .18, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
/* the page waits under the loader unpainted (it can't be seen yet); it shows as the loader starts to lift */
body.is-loading:not(.is-entering) #main { visibility: hidden; }
/* until the scene is on (it loads on the first interaction, see main.js), and for good without WebGL:
   a soft backdrop in its colours, which the canvas fades in over */
body:not(.scene-on) {
    background:
        radial-gradient(80% 60% at 70% 45%, var(--accent-soft), transparent 70%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%) fixed;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 1px solid var(--accent-2); outline-offset: 4px; border-radius: 4px; }

.mono {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.45;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.small { max-width: 44ch; color: var(--ink-2); }

.skip {
    position: fixed; top: 8px; left: 8px; z-index: 100;
    padding: 8px 14px; background: var(--ink); color: var(--bg); border-radius: 999px;
    transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- WebGL layer ---------- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; opacity: 0; transition: opacity 1.4s var(--ease-out); }
.scene-on #gl { opacity: 1; }
.no-webgl #gl { display: none; }
.vignette {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background:
        radial-gradient(120% 90% at 50% 40%, transparent 55%, var(--shade) 100%),
        linear-gradient(180deg, var(--shade-2) 0%, transparent 18%, transparent 70%, var(--shade-2) 100%);
}
main, .footer { position: relative; z-index: 2; }

/* ---------- loader ---------- */
.loader {
    position: fixed; inset: 0; z-index: 60;
    display: grid; grid-template-rows: 1fr auto;
    padding: var(--gutter);
    background: var(--bg);
    clip-path: inset(0 0 0 0);
}
.loader-mark { align-self: center; text-align: center; }
.loader-logo { display: flex; justify-content: center; height: clamp(46px, 7vw, 84px); }
.footer-big em { color: var(--accent); }

/* brand lockup (outlined SVG from design/logo): ink is currentColor, the turning corner and "front" are --accent */
.brand { display: block; height: 100%; width: auto; overflow: visible; }
.brand .sf-corner { transform-box: fill-box; transform-origin: 100% 0; transition: transform .6s var(--ease-out); }
/* the page turns while the site loads, then settles */
.loader:not(.is-ready) .sf-corner { animation: sf-turn 1.3s var(--ease-out) infinite alternate; }
@keyframes sf-turn { from { transform: scale(.2); } to { transform: scale(1); } }
.logo:hover .sf-corner, .logo:focus-visible .sf-corner { transform: scale(1.22); }
.reduce-motion .sf-corner { animation: none !important; transition: none; }
.loader-mark p { margin-top: 18px; color: var(--ink-2); }
.loader-bottom { display: grid; justify-items: center; gap: 18px; min-height: 120px; }
.loader-count { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.loader-bar { width: min(280px, 60vw); height: 1px; background: var(--line); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.gate { display: grid; justify-items: center; gap: 14px; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out), visibility .8s; }
.loader.is-ready .gate { opacity: 1; visibility: visible; transform: none; }
.loader.is-ready .loader-count, .loader.is-ready .loader-bar { display: none; }

/* ---------- pills / buttons ---------- */
.pill {
    position: relative; display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 26px; border-radius: 999px;
    border: 1px solid var(--accent-line);
    background: var(--glass);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    font-size: 15px; font-weight: 500;
    transition: background .4s, border-color .4s, color .4s;
    overflow: hidden; isolation: isolate;
}
.pill::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: var(--accent); border-radius: inherit;
    transform: translateY(101%); transition: transform .5s var(--ease-out);
}
.pill:hover::before { transform: none; }
.pill:hover { color: var(--bg); border-color: var(--accent); }
.pill svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.pill--glow { box-shadow: 0 0 40px var(--accent-soft), inset 0 0 20px var(--accent-soft); }
.pill--small { padding: 9px 16px; font-size: 13px; }
.pill--big { padding: 20px 34px; font-size: 17px; }
.link-btn { color: var(--ink-2); border-bottom: 1px solid var(--line); padding-bottom: 2px; font-size: 14px; transition: color .3s, border-color .3s; }
.link-btn:hover { color: var(--ink); border-color: var(--ink); }

.tag {
    display: inline-block; padding: 5px 10px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-2);
    border: 1px solid var(--accent-line);
    margin-bottom: 26px;
}

/* ---------- cursor ----------
   .cursor-dot / .cursor-ring: positioned by GSAP (x/y only, no CSS transform or transition on them).
   Their <i> children carry the look and only ever scale. So position and hover never fight. */
.cursor { position: fixed; top: 0; left: 0; z-index: 80; pointer-events: none; display: none; transition: opacity .25s; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor label { cursor: none; }
.has-cursor input { cursor: text; }
.cursor-dot, .cursor-ring { position: absolute; top: 0; left: 0; will-change: transform; }
.cursor-dot i, .cursor-ring i { position: absolute; border-radius: 50%; display: block; }
.cursor-dot i { width: 6px; height: 6px; left: -3px; top: -3px; background: var(--accent-2); transition: transform .3s var(--ease-out), opacity .2s; }
.cursor-ring i {
    width: 36px; height: 36px; left: -18px; top: -18px;
    border: 1px solid var(--ink-soft);
    transition: transform .45s var(--ease-out), background .3s, border-color .3s;
}
.cursor-label {
    position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
    font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--bg); opacity: 0; transition: opacity .25s; white-space: nowrap;
}
.cursor.is-hover .cursor-ring i { transform: scale(1.55); border-color: var(--accent); background: var(--accent-soft); }
.cursor.is-label .cursor-ring i { transform: scale(2.35); background: var(--ink); border-color: var(--ink); }
.cursor.is-label .cursor-label { opacity: 1; }
.cursor.is-label .cursor-dot i { opacity: 0; }
.cursor.is-down .cursor-ring i { transform: scale(.8); }
.cursor.is-down.is-hover .cursor-ring i { transform: scale(1.3); }
.cursor.is-down.is-label .cursor-ring i { transform: scale(2.1); }
.cursor.is-hidden { opacity: 0; }

/* ---------- header ---------- */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: calc(18px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 18px max(var(--gutter), env(safe-area-inset-left));
}
.header::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: var(--surface);
    backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--line);
    opacity: 0; transition: opacity .5s;
}
.header.is-scrolled::before { opacity: 1; }
.logo { display: flex; align-items: center; height: 30px; justify-self: start; }
/* the folio: the page the visitor is on, like the number at the foot of a book's page; it turns as they read */
.folio {
    display: flex; align-items: baseline; gap: 3px; height: 16px; margin-inline-start: 16px; padding-inline-start: 14px;
    border-inline-start: 1px solid var(--line); color: var(--ink-3); text-transform: none;
    opacity: 0; transition: opacity .5s;
}
.folio b { display: inline-block; min-width: 2ch; font-weight: 400; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.header.is-scrolled .folio { opacity: 1; }
/* the chapters, numbered like a book's contents */
.ch { font-family: var(--font-display); font-style: italic; text-transform: none; letter-spacing: 0; color: var(--ink-3); transition: color .3s; }
.header-nav { display: flex; gap: 26px; }
.header-nav a { position: relative; display: flex; align-items: baseline; gap: 7px; color: var(--ink-2); transition: color .3s; }
.header-nav .ch { font-size: 17px; line-height: 0; }
.header-nav a:hover .ch, .header-nav a.is-active .ch { color: var(--accent); }
.header-nav a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--accent);
    transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease-out);
}
.header-nav a:hover, .header-nav a.is-active { color: var(--ink); }
.header-nav a:hover::after, .header-nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.header-actions { display: flex; align-items: center; gap: 18px; justify-self: end; }

.sound-btn { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.sound-btn:hover { color: var(--ink); }
.bars { display: flex; align-items: center; gap: 2px; height: 14px; }
.bars i { width: 2px; height: 2px; background: currentColor; border-radius: 1px; transition: height .4s; }
.sound-on .bars i { animation: bar 1.1s ease-in-out infinite; }
.sound-on .bars i:nth-child(2) { animation-delay: -.35s; }
.sound-on .bars i:nth-child(3) { animation-delay: -.7s; }
.sound-on .bars i:nth-child(4) { animation-delay: -.2s; }
.sound-on .bars i:nth-child(5) { animation-delay: -.55s; }
@keyframes bar { 0%, 100% { height: 2px; } 50% { height: 14px; } }

.menu-btn { display: flex; align-items: center; gap: 10px; }
.menu-btn-lines { display: grid; gap: 5px; width: 22px; }
.menu-btn-lines i { height: 1px; background: currentColor; transition: transform .5s var(--ease-out); }
.menu-open .menu-btn-lines i:first-child { transform: translateY(3px) rotate(45deg); }
.menu-open .menu-btn-lines i:last-child { transform: translateY(-3px) rotate(-45deg); }

.progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 41; pointer-events: none; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: left; }

/* ---------- menu: the settings dropdown under the Menu button ---------- */
.menu-wrap { position: relative; }
.settings-panel {
    position: absolute; top: calc(100% + 14px); inset-inline-end: -12px; z-index: 45;
    width: 288px; padding: 16px 18px 10px;
    border-radius: 20px; border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2);
    box-shadow: 0 24px 60px -30px var(--shade);
    opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top right;
    visibility: hidden; pointer-events: none;
    transition: opacity .35s var(--ease-out), transform .45s var(--ease-out), visibility 0s .45s;
}
.settings-panel.is-open {
    opacity: 1; transform: none; visibility: visible; pointer-events: auto;
    transition: opacity .35s var(--ease-out), transform .45s var(--ease-out), visibility 0s 0s;
}
.settings-title { color: var(--ink-3); margin-bottom: 6px; }
.settings-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
/* section links: only where the header nav is hidden (under 860 px) */
.panel-nav, .panel-nav-rule { display: none; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; width: 100%; }
.srow-label { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--ink); }
.srow-label svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.srow--btn { text-align: start; }
.srow-value { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 18px; }
.srow--btn:hover .srow-value { color: var(--accent); }

/* switch: the knob only moves (CSS), nothing else animates it */
.switch {
    position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px;
    background: var(--line); border: 1px solid var(--line);
    transition: background .4s var(--ease-out), border-color .4s;
}
.switch i {
    position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--ink); transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), background .4s;
}
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] i { transform: translateX(20px); background: var(--bg); }
:root[dir="rtl"] .switch[aria-checked="true"] i { transform: translateX(-20px); }

/* sun / moon icon: a disc whose bite slides away as rays grow back (day), and returns as they shrink (night) */
.sunmoon .sm-core { fill: currentColor; transform-origin: 12px 12px; transition: transform 1.2s var(--ease-theme); }
.sunmoon .sm-cut { transition: transform 1.2s var(--ease-theme); }
.sunmoon .sm-rays { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; fill: none;
    transform-origin: 12px 12px; opacity: 0; transform: rotate(-45deg) scale(.6);
    transition: opacity .9s var(--ease-theme), transform 1.2s var(--ease-theme); }
:root[data-theme="light"] .sunmoon .sm-cut { transform: translate(9px, -9px); }
:root[data-theme="light"] .sunmoon .sm-core { transform: scale(.72); }
:root[data-theme="light"] .sunmoon .sm-rays { opacity: 1; transform: none; transition-delay: .25s; }


/* ---------- shared display type ---------- */
.display {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(48px, 8.2vw, 136px);
    line-height: .94; letter-spacing: -0.015em;
    text-transform: uppercase;
}
.display em { text-transform: none; color: var(--accent-2); }
.display > span { display: block; }
.display .indent { padding-left: 1.4em; }
.arrow { font-family: var(--font-ui); font-size: .38em; vertical-align: .55em; margin-right: .35em; color: var(--accent); text-transform: none; }
.ico { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; overflow: visible; }
.split-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.split-inner { display: inline-block; }
.char { display: inline-block; will-change: transform; }

/* ---------- hero ---------- */
.hero {
    min-height: 100svh;
    display: grid; grid-template-rows: 1fr auto auto;
    padding: 110px var(--gutter) 34px;
}
.hero-kicker { color: var(--ink-2); align-self: end; margin-bottom: 26px; }
.hero-title {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(56px, 10.6vw, 186px);
    line-height: .9; letter-spacing: -0.02em; text-transform: uppercase;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .05em; }
.hero-title .line--indent { padding-left: 1.2em; }
.hero-title .serif-i { text-transform: none; font-style: italic; }
.hero-title .accent { color: var(--accent); }
.hero-title .word { display: inline-block; }
.hero-foot {
    display: flex; justify-content: space-between; align-items: end; gap: 28px; flex-wrap: wrap;
    margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line);
}
.hero-lede { max-width: 42ch; color: var(--ink-2); font-size: 17px; }
.scroll-cue { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }
.scroll-cue-line { width: 1px; height: 38px; background: var(--line); overflow: hidden; }
.scroll-cue-line i { display: block; width: 100%; height: 40%; background: var(--accent-2); animation: cue 2s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 100% { transform: translateY(260%); } }

/* ---------- approach ---------- */
.approach { padding: 18vh var(--gutter) 10vh; display: grid; gap: 28vh; }
.chapter { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; max-width: 960px; }
.chapter .display { margin-bottom: 30px; }
.chapter--right { margin-left: auto; align-items: flex-end; text-align: right; }
.chapter--right .display .indent { padding-left: 0; padding-right: 1.4em; }
.services { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; padding-top: 6vh; }
.services-intro { font-family: var(--font-display); font-size: clamp(28px, 3.2vw, 44px); line-height: 1.1; max-width: 16ch; }
.services-list { list-style: none; border-top: 1px solid var(--line); }
.services-list li {
    display: grid; grid-template-columns: 50px 1fr auto; align-items: baseline; gap: 12px;
    padding: 20px 0; border-bottom: 1px solid var(--line);
    position: relative;
    transition: color .3s;
}
.services-list li > * { transition: transform .5s var(--ease-out), color .3s; }
.services-list li::before {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent);
    transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out);
}
@media (hover: hover) {
    .services-list li:hover > * { transform: translateX(14px); }
    .services-list li:hover::before { transform: scaleX(1); }
}
.services-list span { color: var(--ink-3); }
.services-list b { font-weight: 400; font-size: clamp(20px, 2.2vw, 30px); letter-spacing: -0.01em; }
.services-list i { font-style: normal; color: var(--ink-3); }
@media (hover: hover) { .services-list li:hover b { color: var(--accent-2); } }

/* ---------- work ---------- */
.work { padding: 18vh var(--gutter) 14vh; position: relative; }
.work-head { margin-bottom: 8vh; }
.work-head .display { margin-bottom: 24px; }
.projects { list-style: none; border-top: 1px solid var(--line); }
.project a {
    display: grid; grid-template-columns: 70px 1.3fr 1fr 80px; align-items: center; gap: 16px;
    padding: 34px 0; border-bottom: 1px solid var(--line);
    position: relative; isolation: isolate;
    transition: color .4s, transform .6s var(--ease-out);
}
.project a::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
    opacity: 0; transition: opacity .5s;
}
@media (hover: hover) {
    .project a:hover::before { opacity: 1; }
    .project a:hover { transform: translateX(18px); }
    .projects:hover .project:not(:hover) a { color: var(--ink-3); }
}
.project-num, .project-year { color: var(--ink-3); }
.project-year { text-align: right; padding-right: 12px; }
.project-name { font-family: var(--font-display); font-size: clamp(38px, 5.6vw, 92px); line-height: .95; letter-spacing: -0.01em; transition: transform .6s var(--ease-out); }
.project-name em { color: var(--accent-2); }
.project-meta { display: grid; gap: 4px; color: var(--ink-2); }
.project--next .project-name em { color: var(--accent); }
.project-poster { display: none; }

.poster-follow {
    position: fixed; top: 0; left: 0; z-index: 30; pointer-events: none;
    width: 280px; height: 360px; margin: -180px 0 0 0;
    border-radius: 16px; overflow: hidden;
    opacity: 0; transform: scale(.6);
    will-change: transform, opacity;
}
.poster {
    position: absolute; inset: 0; padding: 22px;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(70% 55% at 70% 30%, hsl(var(--h) 95% 62% / .9), transparent 70%),
        radial-gradient(60% 50% at 20% 85%, hsl(calc(var(--h) + 30) 90% 50% / .7), transparent 70%),
        hsl(var(--h) 45% 9%);
    color: #fff8ef;
    clip-path: inset(100% 0 0 0);
    transition: clip-path .7s var(--ease-io);
}
.poster.is-in { clip-path: inset(0 0 0 0); }
/* a screenshot of the real site, the label on a soft shade at its foot */
.poster img, .project-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster:has(img)::before, .project-poster:has(img)::before {
    content: ''; position: absolute; inset: auto 0 0 0; height: 45%; z-index: 1;
    background: linear-gradient(transparent, rgba(8, 5, 4, .7));
}
.poster i, .project-poster i { position: relative; z-index: 2; margin-top: auto; }
.poster b { font-family: var(--font-display); font-weight: 400; font-style: italic; font-size: 84px; line-height: .9; }
.poster i { font-family: var(--font-mono); font-style: normal; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.poster::after {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px);
}

/* ---------- studio ---------- */
.studio { padding: 20vh 0 14vh; }
.studio-statement { padding: 0 var(--gutter); display: flex; flex-direction: column; align-items: flex-end; text-align: right; min-height: 70vh; justify-content: center; }
.studio-statement .display .indent { padding-left: 0; padding-right: 1.4em; }
.marquee { margin: 14vh 0; border-block: 1px solid var(--line); overflow: hidden; padding: 22px 0; }
.marquee-track { display: flex; gap: 48px; width: max-content; align-items: center; will-change: transform; }
.marquee-track span { font-family: var(--font-display); font-size: clamp(48px, 7vw, 110px); line-height: 1; text-transform: uppercase; }
.marquee-track em { text-transform: none; color: var(--accent-2); }
.marquee-track i { font-style: normal; color: var(--accent); font-size: 30px; }
.process { padding: 0 var(--gutter); display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.process-intro { font-family: var(--font-display); font-size: clamp(26px, 2.8vw, 40px); line-height: 1.12; max-width: 18ch; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.step {
    padding: 22px 18px 26px; min-height: 260px;
    border: 1px solid var(--line); border-radius: 18px;
    background: linear-gradient(180deg, var(--card-a), var(--card-b));
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; flex-direction: column; gap: 14px;
    position: relative; top: 0;
    transition: top .6s var(--ease-out), border-color .4s, background .4s;
}
.step:hover { top: -8px; border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), var(--card-b)); }
.step span { color: var(--accent-2); }
.step h3 { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1; margin-top: auto; }
.step p { color: var(--ink-2); font-size: 14px; }

/* ---------- contact ---------- */
.contact { padding: 22vh var(--gutter) 0; min-height: 100svh; display: flex; flex-direction: column; }
/* tags hug their text even inside flex columns, and follow their block's alignment */
.tag { align-self: flex-start; }
.chapter--right .tag, .studio-statement .tag { align-self: flex-end; }
.contact-title { margin-bottom: 8vh; }
.contact-form {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px;
    max-width: 1100px; padding: 34px; border-radius: 24px;
    background: var(--surface-soft); border: 1px solid var(--line);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.field { display: grid; gap: 10px; border: 0; }
.field > span, .field legend { color: var(--ink-3); }
.field input:not([type=checkbox]) {
    background: transparent; border: 0; border-bottom: 1px solid var(--line);
    color: var(--ink); font: inherit; font-size: 20px; padding: 8px 0; outline: none; width: 100%;
    transition: border-color .3s;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { border-color: var(--accent); }
.field input.is-invalid { border-color: var(--error); }
.field--chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.field--chips legend { width: 100%; margin-bottom: 10px; }
.field--chips label { position: relative; }
.field--chips input { position: absolute; opacity: 0; inset: 0; }
.field--chips span { display: inline-block; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; transition: background .3s, color .3s, border-color .3s; }
.field--chips input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.field--chips input:focus-visible + span { outline: 1px solid var(--accent-2); outline-offset: 3px; }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.form-msg { color: var(--ink-2); }
.form-msg.is-error { color: var(--error); }
.form-msg.is-ok { color: var(--accent-2); }

.footer { margin-top: auto; padding-top: 16vh; }
.footer-big {
    font-family: var(--font-display); font-size: clamp(80px, 21vw, 360px); line-height: .8;
    letter-spacing: -0.03em; text-align: center; opacity: .9;
    background: linear-gradient(180deg, var(--ink) 30%, transparent 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-big em { -webkit-text-fill-color: transparent; background: linear-gradient(180deg, var(--accent) 30%, transparent 100%); -webkit-background-clip: text; background-clip: text; }
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 0 26px; border-top: 1px solid var(--line); color: var(--ink-2); }
.footer-row nav { display: flex; gap: 22px; }
.footer-row a:hover { color: var(--ink); }
.credit { display: inline-flex; align-items: center; gap: 10px; }
.credit-logo { display: none; width: auto; height: 20px; opacity: .85; transition: opacity .25s; }
.credit:hover .credit-logo { opacity: 1; }
[data-theme="dark"] .credit-logo--dark.credit-logo--moving,
[data-theme="light"] .credit-logo--light.credit-logo--moving { display: block; }
.reduce-motion .credit-logo--moving { display: none !important; }
[data-theme="dark"] .reduce-motion .credit-logo--dark.credit-logo--still,
[data-theme="light"] .reduce-motion .credit-logo--light.credit-logo--still { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- reveal helpers (JS sets the start state, so content stays visible without JS) ---------- */
.js .reveal-up { opacity: 0; transform: translateY(30px); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .steps { grid-template-columns: repeat(3, 1fr); }
    .process { grid-template-columns: 1fr; }
    .services { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .header { grid-template-columns: 1fr auto; }
    .header-nav, .header-cta { display: none; }
    .logo { height: 24px; }
    .sound-btn { white-space: nowrap; }
    .menu-wrap { position: static; }
    .settings-panel { position: fixed; top: calc(70px + env(safe-area-inset-top)); inset-inline: 12px; width: auto; }
    .panel-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin: 2px 0 8px; }
    .panel-nav a { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; font-family: var(--font-display); font-size: 26px; line-height: 1.1; color: var(--ink); }
    .panel-nav .ch { min-width: 1.6em; font-size: 18px; }
    .panel-nav a:hover, .panel-nav a:focus-visible { font-style: italic; color: var(--accent); }
    .panel-nav a.is-active .ch { color: var(--accent); }
    .folio { margin-inline-start: 12px; padding-inline-start: 10px; }
    .panel-nav-rule { display: block; margin-bottom: 12px; }
}
@media (max-width: 379px) {
    /* narrow phones, where the folio needs the room: the bars icon carries the sound toggle, its label stays for
       screen readers */
    #soundLabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 400px) {
    .contact-form { grid-template-columns: 1fr; padding: 22px; }
    .steps { grid-template-columns: 1fr 1fr; }
    .step { min-height: 200px; }
}
@media (max-width: 860px) {
    /* no pointer to follow: each project shows its screenshot under its row */
    .project a { grid-template-columns: 40px 1fr; row-gap: 10px; padding: 26px 0; }
    .project-meta { grid-column: 2; }
    .project-year { display: none; }
    .project-poster {
        display: flex; flex-direction: column; margin: -8px 0 20px 40px;
        position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; padding: 14px 16px;
        color: #fff8ef;
        background: hsl(var(--h) 45% 9%);
    }
    /* the row above already says it: the screenshot stands alone */
    .project-poster i, .project-poster:has(img)::before { display: none; }
}
@media (max-width: 860px) {
    /* the swarm sits in the top half on phones and narrow tablets: push copy down */
    .hero { padding-top: 46svh; grid-template-rows: auto auto auto; }
    .hero-kicker { margin-bottom: 18px; }
    .hero-title .line--indent { padding-left: .5em; }
    .chapter { min-height: 80svh; justify-content: flex-end; }
    .chapter--right { align-items: flex-start; text-align: left; margin-left: 0; }
    .chapter--right .tag, .studio-statement .tag { align-self: flex-start; }
    .chapter--right .display .indent, .studio-statement .display .indent { padding-right: 0; padding-left: .6em; }
    .display .indent { padding-left: .6em; }
    .approach { gap: 12vh; }
    .studio-statement { align-items: flex-start; text-align: left; justify-content: flex-end; min-height: 80svh; }
    .steps { grid-template-columns: 1fr; }
    .step { min-height: 0; }
    .step h3 { margin-top: 8px; }
    .services-list li { grid-template-columns: 34px 1fr; }
    .services-list i { grid-column: 2; }
    .contact { padding-top: 46svh; }
    .footer-row { justify-content: center; text-align: center; }
    .credit { flex-basis: 100%; justify-content: center; order: 1; }
}

/* JS sets .reduce-motion from prefers-reduced-motion, and the Reduce motion switch can override it either way */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; transition-delay: 0s !important;
}
.reduce-motion .marquee-track, .reduce-motion .scroll-cue-line i, .reduce-motion .sound-on .bars i { animation: none !important; }
.reduce-motion .sound-on .bars i { height: 8px; }
