/* ==========================================================================
   GREAT LAKES DESIGN LAB — site stylesheet
   One file, no build step. Themes are swapped via [data-theme] on <html>.
   ========================================================================== */

/* ---------- Tokens ----------
   Palettes are built from Radix Colors (https://www.radix-ui.com/colors), using each step for its
   documented job: 1–2 backgrounds, 4 hover fills, 6 subtle borders, 8 strong borders,
   9–11 solid accent, 11 low-contrast text, 12 high-contrast text.
   Each theme pairs a neutral with the accent closest in hue (Radix's "natural pairing").

   Accent rule (NN/g, "Using Color to Enhance Your Design", 60-30-10 guidance): the accent is
   reserved for the primary call to action, selected/focus states and links. Everything else is neutral.
   Every accent passes WCAG AA against its background and its button text. */
:root {
    /* Sand + Bronze (default) */
    --bg: #F9F9F8;            /* sand 2 */
    --surface: #FDFDFC;       /* sand 1 */
    --hover: #E9E8E6;         /* sand 4 */
    --line: #DAD9D6;          /* sand 6 */
    --line-strong: #BCBBB5;   /* sand 8 */
    --muted: #63635E;         /* sand 11 */
    --fg: #21201C;            /* sand 12 */
    --accent: #7D5E54;        /* bronze 11 (white text 5.8:1) */
    --accent-hover: #6A4F46;
    --on-accent: #FFFFFF;
    --accent-text: #7D5E54;   /* bronze 11 (5.5:1 on bg) */
    --accent-soft: #F6EDEA;   /* bronze 3 */
    --grid: rgba(33, 32, 28, 0.06);

    --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

    --border: 2px solid var(--fg);
    --shadow: 8px 8px 0 var(--fg);
    --shadow-sm: 4px 4px 0 var(--fg);

    --gutter: clamp(16px, 4vw, 40px);
    --max: 1280px;
    --nav-h: 72px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    color-scheme: light;
}

/* Slate + Indigo */
:root[data-theme="slate"] {
    --bg: #F9F9FB; --surface: #FCFCFD; --hover: #E8E8EC; --line: #D9D9E0; --line-strong: #B9BBC6;
    --muted: #60646C; --fg: #1C2024;
    --accent: #3E63DD; --accent-hover: #3358D4; --on-accent: #FFFFFF;   /* indigo 9 / 10 (white 5.2:1) */
    --accent-text: #3A5BC7; --accent-soft: #EDF2FE;                       /* indigo 11 / 3 */
    --grid: rgba(28, 32, 36, 0.06);
}

/* Sage + Jade */
:root[data-theme="sage"] {
    --bg: #F7F9F8; --surface: #FBFDFC; --hover: #E6E9E8; --line: #D7DAD9; --line-strong: #B8BCBA;
    --muted: #5F6563; --fg: #1A211E;
    --accent: #208368; --accent-hover: #1B7059; --on-accent: #FFFFFF;   /* jade 11 (white 4.7:1) */
    --accent-text: #1D3B31; --accent-soft: #E6F7ED;                       /* jade 12 / 3 */
    --grid: rgba(26, 33, 30, 0.06);
}

/* Mauve + Iris */
:root[data-theme="mauve"] {
    --bg: #FAF9FB; --surface: #FDFCFD; --hover: #EAE7EC; --line: #DBD8E0; --line-strong: #BCBAC7;
    --muted: #65636D; --fg: #211F26;
    --accent: #5B5BD6; --accent-hover: #5151CD; --on-accent: #FFFFFF;   /* iris 9 / 10 (white 5.4:1) */
    --accent-text: #5753C6; --accent-soft: #F0F1FE;                       /* iris 11 / 3 */
    --grid: rgba(33, 31, 38, 0.06);
}

/* Graphite: Sand dark + Bronze dark */
:root[data-theme="graphite"] {
    --bg: #111110; --surface: #191918; --hover: #2A2A28; --line: #3B3A37; --line-strong: #62605B;
    --muted: #B5B3AD; --fg: #EEEEEC;
    --accent: #D4B3A5; --accent-hover: #EDE0D9; --on-accent: #191918;   /* bronze dark 11 / 12 (9.0:1) */
    --accent-text: #D4B3A5; --accent-soft: #262220;
    --grid: rgba(238, 238, 236, 0.05);
    color-scheme: dark;
}

/* Midnight: Slate dark + Indigo dark */
:root[data-theme="midnight"] {
    --bg: #111113; --surface: #18191B; --hover: #272A2D; --line: #363A3F; --line-strong: #5A6169;
    --muted: #B0B4BA; --fg: #EDEEF0;
    --accent: #3E63DD; --accent-hover: #5472E4; --on-accent: #FFFFFF;   /* indigo 9 / 10 */
    --accent-text: #9EB1FF; --accent-soft: #182449;                       /* indigo dark 11 / 3 */
    --grid: rgba(237, 238, 240, 0.05);
    color-scheme: dark;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-display);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }

::selection { background: var(--accent-soft); color: var(--fg); }

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

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 200;
    padding: 10px 16px;
    background: var(--fg);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
.skip-link:focus { top: 16px; }

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

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

.mono {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Two-tone headlines: the second phrase steps back instead of competing with the CTA. */
.accent { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--fg);
    --btn-fg: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 52px;
    padding: 0 1.6rem;
    border: var(--border);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
/* Buttons stay put: hover and press only change colour. */
.btn:hover { --btn-bg: color-mix(in srgb, var(--fg) 82%, var(--bg)); }
.btn:active { filter: brightness(0.92); }

.btn--accent { --btn-bg: var(--accent); --btn-fg: var(--on-accent); }
.btn--accent:hover { --btn-bg: var(--accent-hover); --btn-fg: var(--on-accent); }
.btn--ghost:hover { --btn-bg: var(--hover); --btn-fg: var(--fg); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--fg); }
.btn--sm { min-height: 40px; padding: 0 1rem; font-size: 0.75rem; }
.btn--lg { min-height: 64px; padding: 0 2.2rem; font-size: 1rem; }
.btn--block { width: 100%; }

/* ---------- Navigation ---------- */
.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--nav-h);
    background: var(--bg);
    border-bottom: var(--border);
    transition: box-shadow 0.25s ease, background-color 0.3s ease;
}
.site-nav.is-scrolled { box-shadow: 0 6px 0 -2px var(--grid); }

.site-nav .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}
.logo svg { width: 30px; height: 30px; flex-shrink: 0; }
.logo .dot { color: var(--muted); }
.logo > span { white-space: nowrap; }
@media (max-width: 480px) {
    .logo { font-size: 0.95rem; gap: 0.5rem; }
    .logo svg { width: 26px; height: 26px; }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav-links a:not(.btn) {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 0;
}
.nav-links a:not(.btn)::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--fg);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease);
}
.nav-links a:not(.btn):hover::after,
.nav-links a.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-links .nav-cta-mobile { display: none; }

/* Theme picker */
.theme-picker { position: relative; }
.theme-toggle {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 10px;
    border: var(--border);
    background: var(--surface);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.theme-toggle:hover { background: var(--hover); }
.swatch {
    width: 16px; height: 16px;
    border: 2px solid var(--fg);
    border-radius: 50%;
}
.theme-toggle .swatch + .swatch { margin-left: -6px; }
.theme-toggle .swatch:nth-child(1) { background: var(--bg); }
.theme-toggle .swatch:nth-child(2) { background: var(--accent); }
.theme-toggle .swatch:nth-child(3) { background: var(--fg); }

.theme-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    min-width: 200px;
    padding: 6px;
    background: var(--surface);
    border: var(--border);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s var(--ease), visibility 0.18s;
}
.theme-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 9px 10px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
}
.theme-option:hover { background: var(--bg); }
.theme-option[aria-checked="true"] { font-weight: 700; }
.theme-option[aria-checked="true"]::after { content: '●'; margin-left: auto; color: var(--accent); }
.theme-option .swatch { width: 18px; height: 18px; border-radius: 0; }

/* Mobile menu button */
.menu-toggle {
    display: none;
    width: 44px; height: 40px;
    border: var(--border);
    background: var(--surface);
    position: relative;
}
.menu-toggle span {
    position: absolute;
    left: 10px; right: 10px;
    height: 2px;
    background: var(--fg);
    transition: transform 0.25s var(--ease), opacity 0.2s;
}
.menu-toggle span:nth-child(1) { top: 12px; }
.menu-toggle span:nth-child(2) { top: 18px; }
.menu-toggle span:nth-child(3) { top: 24px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Sections (shared) ---------- */
main { display: block; }

.section {
    padding: clamp(80px, 11vw, 140px) 0;
    border-bottom: var(--border);
    position: relative;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: clamp(40px, 6vw, 72px);
}
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    color: var(--muted);
}
.section-label::before {
    content: '';
    width: 8px; height: 8px;
    background: var(--fg);
}
.section-title {
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.035em;
    text-transform: uppercase;
}
.section-intro {
    max-width: 420px;
    color: var(--muted);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100svh;
    padding-top: var(--nav-h);
    display: flex;
    flex-direction: column;
    border-bottom: var(--border);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: -1px -1px;
}

.hero-inner {
    flex: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: clamp(40px, 6vw, 96px);
    padding-top: clamp(48px, 8vh, 96px);
    padding-bottom: clamp(48px, 8vh, 96px);
}

.hero-kicker {
    margin-bottom: 1.5rem;
    color: var(--muted);
}

.hero h1 {
    font-size: clamp(3.2rem, 6.4vw, 6.75rem);
    font-weight: 700;
    line-height: 0.88;
    letter-spacing: -0.045em;
    text-transform: uppercase;
    margin-bottom: 1.75rem;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero h1 .line > span { display: inline-block; animation: rise 0.9s var(--ease) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.08s; }
.hero h1 .line:nth-child(3) > span { animation-delay: 0.16s; }
.hero h1 .accent { position: relative; }

@keyframes rise {
    from { transform: translateY(105%); }
    to { transform: none; }
}

.hero-lede {
    max-width: 520px;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    color: var(--muted);
    margin-bottom: 2.25rem;
}
.hero-lede strong { color: var(--fg); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Hero visual: a browser that assembles itself */
.hero-visual {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 5 / 4;
}

.browser {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: var(--border);
    box-shadow: 14px 14px 0 var(--fg);
    animation: breathe 8s ease-in-out infinite;
    /* Rotated hard edges can stair-step. Giving the browser its own GPU layer means it is
       drawn once un-rotated, then rotated by the compositor with smooth (bilinear) filtering.
       The transparent outline is an old trick that makes Firefox anti-alias the edges too. */
    will-change: transform;
    backface-visibility: hidden;
    outline: 1px solid transparent;
}
@keyframes breathe {
    0%, 100% { transform: translateY(0) rotate(-0.6deg); }
    50% { transform: translateY(-10px) rotate(0.6deg); }
}
.browser-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-bottom: var(--border);
    flex-shrink: 0;
}
.browser-bar i {
    width: 12px; height: 12px;
    border: 2px solid var(--fg);
    border-radius: 50%;
}
.browser-bar i:first-child { background: var(--line-strong); }
.browser-url {
    flex: 1;
    margin-left: 10px;
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border: 2px solid var(--fg);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    overflow: hidden;
    white-space: nowrap;
}
.browser-url .caret {
    display: inline-block;
    width: 7px; height: 12px;
    margin-left: 2px;
    background: var(--fg);
    animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.browser-body {
    flex: 1;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 16px;
    padding: 20px;
    overflow: hidden;
}
.sk { background: var(--fg); opacity: 0.12; animation: build 0.6s var(--ease) both; }
.sk-nav { display: flex; align-items: center; gap: 10px; }
.sk-logo { width: 26px; height: 26px; opacity: 1; background: var(--fg); animation-delay: 0.5s; }
.sk-pill { height: 10px; width: 48px; animation-delay: 0.6s; }
.sk-pill:last-child { margin-left: auto; width: 64px; height: 20px; opacity: 1; background: var(--accent); }
.sk-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    align-items: stretch;
}
.sk-copy { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.sk-h { height: 22px; width: 95%; opacity: 0.9; animation-delay: 0.75s; }
.sk-h.short { width: 60%; opacity: 0.45; animation-delay: 0.85s; }
.sk-line { height: 8px; width: 90%; animation-delay: 0.95s; }
.sk-line.short { width: 55%; animation-delay: 1s; }
.sk-btn { height: 24px; width: 90px; margin-top: 6px; opacity: 1; animation-delay: 1.1s; }
.sk-media {
    position: relative;
    border: 2px solid var(--fg);
    background:
        repeating-linear-gradient(45deg, transparent 0 8px, var(--grid) 8px 10px),
        var(--bg);
    animation: build 0.6s var(--ease) 0.9s both;
    overflow: hidden;
}
.sk-media::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 46%; aspect-ratio: 1;
    border: 2px solid var(--fg);
    border-radius: 50%;
    background: var(--hover);
    transform: translate(-50%, -50%);
}
.sk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-card { height: 46px; border: 2px solid var(--fg); background: transparent; opacity: 1; }
.sk-card:nth-child(1) { animation-delay: 1.2s; }
.sk-card:nth-child(2) { animation-delay: 1.3s; }
.sk-card:nth-child(3) { animation-delay: 1.4s; background: var(--fg); }

@keyframes build {
    from { transform: scaleX(0); transform-origin: left; }
    to { transform: none; transform-origin: left; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tag-float {
    position: absolute;
    z-index: 2;
    padding: 6px 12px;
    border: var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    animation: float 6s ease-in-out infinite, pop 0.5s var(--ease) both;
}

.tag-float.t1 { top: -18px; left: -28px; animation-delay: -1s, 1.5s; }
.tag-float.t2 { top: 32%; right: -40px; animation-delay: -3s, 1.65s; }
.tag-float.t3 { bottom: -18px; left: 12%; animation-delay: -2s, 1.8s; }
.tag-float.t4 { bottom: 20%; left: -44px; animation-delay: -4s, 1.95s; }
@keyframes pop {
    from { opacity: 0; scale: 0.6; }
    to { opacity: 1; scale: 1; }
}

/* Ticker */
.ticker {
    display: flex;
    align-items: stretch;
    border-top: var(--border);
    background: var(--fg);
    color: var(--bg);
    overflow: hidden;
}
.ticker-label {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--bg);
    color: var(--fg);
    border-right: var(--border);
    font-weight: 700;
    position: relative;
    z-index: 1;
}
.ticker-track {
    display: flex;
    flex-shrink: 0;
    width: max-content;
    animation: marquee var(--ticker-duration, 40s) linear infinite;
}
.ticker-track ul { flex-shrink: 0; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track ul {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 18px 0 18px 2.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.ticker-track li { display: flex; align-items: center; gap: 2.5rem; }
.ticker-track li::after { content: '·'; color: color-mix(in srgb, var(--bg) 45%, transparent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Work ---------- */
[hidden] { display: none !important; }

/* View toggle: plain text, the active view underlined. No boxes. */
.view-switch {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    margin: -1rem 0 1.5rem;
}
.view-switch .mono { color: var(--muted); }
.view-switch button {
    padding: 4px 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.view-switch button:hover { color: var(--fg); }
.view-switch button[aria-pressed="true"] { color: var(--fg); border-bottom-color: var(--fg); }

/* ----- Browser view ----- */
.wb {
    position: relative;
    border: var(--border);
    background: var(--surface);
}
.wb-tabs {
    display: flex;
    align-items: stretch;
    background: var(--hover);
    border-bottom: var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.wb-tabs::-webkit-scrollbar { display: none; }
.wb-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 1 220px;
    min-width: 150px;
    padding: 12px 16px;
    border-right: 1px solid var(--line-strong);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.wb-tab:hover { color: var(--fg); background: color-mix(in srgb, var(--surface) 50%, transparent); }
.wb-tab[aria-selected="true"] {
    color: var(--fg);
    background: var(--surface);
    margin-bottom: -2px;           /* sit over the strip's bottom border, like a real tab */
    padding-bottom: 14px;
}
.wb-tab:focus-visible { outline-offset: -3px; }
.wb-fav {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 18px; height: 18px;
    border-radius: 4px;
    background: var(--fg);
    color: var(--bg);
    font-size: 0.68rem;
    font-weight: 700;
}
.wb-tab.is-concept .wb-fav { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }
.wb-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-sep {
    display: flex;
    align-items: center;
    padding: 0 12px 0 18px;
    color: var(--muted);
    white-space: nowrap;
}

.wb-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
}
.wb-dots { display: flex; gap: 6px; }
.wb-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.wb-info-btn {
    display: grid;
    place-items: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    color: var(--muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}
.wb-info-btn:hover, .wb-info-btn[aria-expanded="true"] { background: var(--hover); color: var(--fg); }
.wb-url {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wb-url:hover { border-color: var(--line-strong); }
.wb-url:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.wb-url.is-invalid { animation: nudge 0.3s ease; border-color: #D92D20; }
@keyframes nudge { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }
.wb-url-input {
    width: 100%;
    min-width: 0;
    padding: 7px 14px;
    border: 0;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--fg);
    outline: none;
    text-overflow: ellipsis;
}
.wb-url-input:focus-visible { outline: none; }
.wb.is-concept .wb-url-input:not(:focus) { color: var(--muted); font-style: italic; }
.wb-hint {
    position: absolute;
    left: 14px;
    top: calc(100% + 6px);
    z-index: 4;
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    pointer-events: none;
}
.wb-hint:empty { display: none; }
.wb-visit {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    border-bottom: 1px solid var(--line-strong);
}
.wb-visit:hover { border-bottom-color: var(--fg); }

/* Site-info popover, like a browser's padlock panel */
.wb-info {
    position: absolute;
    z-index: 5;
    top: calc(100% + 6px);
    left: 44px;
    width: min(340px, calc(100% - 32px));
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.35);
}
.wb-info-name { font-weight: 700; font-size: 1.05rem; }
.wb-info-desc { color: var(--muted); margin: 2px 0 14px; font-size: 0.95rem; }
.wb-info dl { display: grid; gap: 6px; font-size: 0.9rem; }
.wb-info dl div { display: grid; grid-template-columns: 72px 1fr; }
.wb-info dt { color: var(--muted); }

.wb-view { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); }
.wb-shot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;   /* wide screenshots keep their left edge, where headlines usually start */
    transition: opacity 0.14s ease;
}
.wb-shot.is-swapping { opacity: 0; }

/* ----- Index view ----- */
.index { border-top: var(--border); }
.index-row { border-bottom: 1px solid var(--line-strong); }
.index-link {
    display: grid;
    grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, 0.8fr) 48px;
    align-items: baseline;
    gap: 0 24px;
    padding: 26px 12px;
    transition: background-color 0.2s ease;
}
a.index-link:hover, a.index-link:focus-visible { background: var(--hover); }
.index-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.index-name {
    font-size: clamp(1.4rem, 2.6vw, 2.2rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}
.index-desc { color: var(--muted); }
.index-place { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.index-go { justify-self: end; font-size: 1.4rem; color: var(--muted); transition: color 0.2s ease; }
a.index-link:hover .index-go { color: var(--fg); }
.index-go--off { font-size: 0.8rem; font-family: var(--font-mono); text-transform: uppercase; }
.index-row.is-concept .index-name { color: var(--muted); }
.index-group { margin: 56px 0 14px; color: var(--muted); }

/* Screenshot that follows the cursor over the index */
.index-peek {
    position: fixed;
    z-index: 60;
    width: 340px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top center;
    border: var(--border);
    background: var(--surface);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.18s ease;
}
.index-peek.is-on { opacity: 1; }

/* ---------- Services ---------- */
.services { background: var(--surface); }
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: var(--border);
}
.service {
    padding: clamp(28px, 3.4vw, 44px);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: var(--bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}
.service + .service { border-left: var(--border); }
.service:hover { background: var(--fg); color: var(--bg); }
.service:hover .service-num { -webkit-text-stroke-color: var(--bg); }
.service:hover p, .service:hover li { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.service-num {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px var(--fg);
    transition: color 0.3s ease;
}
.service h3 {
    font-size: 1.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}
.service p { color: var(--muted); }
.checklist { display: grid; gap: 0.6rem; margin-top: auto; padding-top: 1rem; border-top: 2px dashed currentColor; }
.checklist li {
    display: flex;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    text-transform: uppercase;
    color: var(--muted);
}
.checklist li::before { content: '–'; color: currentColor; }

.stack {
    margin-top: clamp(28px, 3.5vw, 40px);
    color: var(--muted);
}

/* ---------- Process ---------- */
.process-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    counter-reset: step;
    border-top: var(--border);
}
.step {
    position: relative;
    padding: 32px 28px 8px 0;
}
.step + .step { padding-left: 28px; border-left: 2px dashed color-mix(in srgb, var(--fg) 30%, transparent); }
.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    display: inline-grid;
    place-items: center;
    width: 52px; height: 52px;
    margin-bottom: 1.5rem;
    border: var(--border);
    background: var(--surface);
    font-family: var(--font-mono);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.step:hover::before { background: var(--hover); }
.step h3 { font-size: 1.4rem; font-weight: 700; text-transform: uppercase; margin-bottom: 0.5rem; }
.step p { color: var(--muted); font-size: 0.98rem; margin-bottom: 1rem; }
.step .mono { color: var(--muted); font-weight: 700; }

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(40px, 7vw, 110px);
    align-items: center;
}
.portrait {
    position: relative;
    max-width: 460px;
    width: 100%;
    justify-self: center;
}
.portrait::before {
    content: '';
    position: absolute;
    inset: 20px -20px -20px 20px;
    background: var(--hover);
    border: var(--border);
}
.portrait img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 30% center;
    border: var(--border);
    filter: grayscale(1) contrast(1.05);
    transition: filter 0.6s ease;
}
.portrait:hover img { filter: none; }
.portrait figcaption {
    position: absolute;
    left: -14px;
    bottom: 28px;
    padding: 6px 12px;
    background: var(--fg);
    color: var(--bg);
}

.about-copy .section-title { margin-bottom: 1.75rem; }
.about-copy p { color: var(--muted); max-width: 580px; margin-bottom: 1.1rem; font-size: 1.1rem; }
.about-copy p strong { color: var(--fg); font-weight: 600; }
.facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 2.25rem 0;
    border: var(--border);
    background: var(--surface);
}
.fact { padding: 18px 20px; }
.fact + .fact { border-left: var(--border); }
.fact dt { color: var(--muted); margin-bottom: 4px; }
.fact dd { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.social-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- CTA ---------- */
.cta {
    background:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px),
        var(--hover);
    background-size: 48px 48px, 48px 48px, auto;
}
.cta-box {
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(36px, 6vw, 80px);
    background: var(--bg);
    border: var(--border);
    box-shadow: 18px 18px 0 var(--fg);
    text-align: center;
}
.cta-intro h2 {
    font-size: clamp(3rem, 10vw, 7.5rem);
    font-weight: 700;
    line-height: 0.88;
    letter-spacing: -0.045em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.cta-intro p { color: var(--muted); max-width: 520px; margin: 0 auto 2.5rem; font-size: 1.15rem; }
.cta-intro .cta-row { justify-content: center; }
.cta-mail { display: block; margin-top: 1.75rem; color: var(--muted); }
.cta-mail a { color: var(--fg); border-bottom: 1px solid var(--line-strong); }
.cta-mail a:hover { border-bottom-color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--fg);
    color: var(--bg);
    padding: clamp(56px, 8vw, 96px) 0 32px;
}
.site-footer .logo svg { color: var(--bg); }
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 40px;
    padding-bottom: 56px;
    border-bottom: 2px solid color-mix(in srgb, var(--bg) 20%, transparent);
}
.footer-brand p { margin-top: 1rem; color: color-mix(in srgb, var(--bg) 60%, transparent); max-width: 280px; }
.footer-col h4 { color: color-mix(in srgb, var(--bg) 55%, transparent); margin-bottom: 1rem; }
.footer-col ul { display: grid; gap: 0.6rem; }
.footer-col a { color: color-mix(in srgb, var(--bg) 80%, transparent); transition: color 0.2s ease; }
.footer-col a:hover { color: var(--bg); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 28px;
    color: color-mix(in srgb, var(--bg) 55%, transparent);
}
.footer-word {
    font-size: clamp(3.5rem, 15.5vw, 15rem);
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 2px color-mix(in srgb, var(--bg) 22%, transparent);
    margin-top: 48px;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
}

/* ---------- Form fields ---------- */
.field { display: grid; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border: var(--border);
    border-radius: 0;
    background: var(--surface);
    font-size: 1rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.field select {
    background-image: linear-gradient(45deg, transparent 50%, var(--fg) 50%), linear-gradient(135deg, var(--fg) 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 36px;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #D92D20; }
.field-error { color: #D92D20; font-family: var(--font-mono); font-size: 0.72rem; min-height: 0; }
:root[data-theme="graphite"] .field-error, :root[data-theme="midnight"] .field-error { color: #FF8A80; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }


/* ---------- Contact flow ---------- */
.no-js .js-only { display: none !important; }

.flow, .flow-done { animation: flow-in 0.4s var(--ease); }
@keyframes flow-in { from { opacity: 0; } to { opacity: 1; } }

.flow {
    max-width: 760px;
    margin: 0 auto;
    text-align: left;
}

/* Progress: a plain count plus named steps (no dots, no boxes) */
.flow-head { margin-bottom: clamp(24px, 3.5vw, 36px); }
.flow-count { color: var(--muted); margin-bottom: 10px; }
.flow-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-strong);
    font-size: 0.88rem;
    color: var(--muted);
}
.flow-steps li { position: relative; }
.flow-steps li.is-done { color: var(--fg); }
.flow-steps li.is-done::before { content: '✓ '; }
.flow-steps li[aria-current="step"] { color: var(--fg); font-weight: 600; }
.flow-steps li[aria-current="step"]::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -15px;
    height: 2px;
    background: var(--fg);
}

/* A step */
.q-step { border: 0; min-width: 0; }
.q-step legend { padding: 0; margin-bottom: 0.5rem; }
.step-q {
    display: block;
    font-size: clamp(1.7rem, 3.6vw, 2.6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
    outline: none;
}
.step-hint { color: var(--muted); margin-bottom: 0.25rem; }
.q-step.is-entering { animation: step-in 0.35s var(--ease); }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Choice options: real radio buttons, styled as large rows */
.opts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 1.25rem;
}
.opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.opt:hover { background: var(--hover); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-key { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); min-width: 1ch; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt:has(input:checked) .opt-key { color: var(--accent-text); font-weight: 700; }
.opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.q-step.has-error .opts .opt { border-color: #D92D20; }
.q-step > .field-error { margin-top: 10px; }

.step-fields { display: grid; gap: 18px; margin-top: 1.25rem; max-width: 520px; }
.q-step .field { margin-top: 1rem; }
.step-fields .field { margin-top: 0; }
.opt-label { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Review ("check your answers") */
.review { margin-top: 1.25rem; border-top: 1px solid var(--line-strong); }
.review > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    gap: 6px 20px;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.review dt { color: var(--muted); font-size: 0.92rem; }
.review dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.review-change {
    color: var(--accent-text);
    font-weight: 600;
    font-size: 0.92rem;
    border-bottom: 1px solid currentColor;
}
.review-change:hover { color: var(--fg); }

/* Navigation row */
.flow-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: clamp(28px, 4vw, 40px);
}
.flow-back { color: var(--muted); font-weight: 600; }
.flow-back:hover { color: var(--fg); }
.flow-keys { color: var(--muted); margin-left: auto; }
@media (hover: none) { .flow-keys { display: none; } }

/* Status + sent */
.form-status {
    display: none;
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid #D92D20;
    font-size: 0.95rem;
}
.form-status.is-error { display: block; background: color-mix(in srgb, #D92D20 10%, var(--surface)); }

.flow-done { text-align: center; padding: 8px 0; }
.flow-done .check {
    display: grid;
    place-items: center;
    width: 64px; height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--fg);
    color: var(--bg);
    font-size: 1.8rem;
    font-weight: 700;
}
.flow-done h3 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; outline: none; margin-bottom: 0.5rem; }
.flow-done p { color: var(--muted); max-width: 440px; margin: 0 auto 1.75rem; }

.btn[aria-busy="true"] { pointer-events: none; opacity: 0.85; }
.btn[aria-busy="true"]::after {
    content: '';
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Legal / simple pages ---------- */
.page-head {
    padding: calc(var(--nav-h) + clamp(56px, 9vw, 110px)) 0 clamp(40px, 6vw, 64px);
    border-bottom: var(--border);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 48px 48px;
}
.page-head h1 {
    font-size: clamp(2.6rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin: 0.5rem 0 1rem;
}
.page-head .mono { color: var(--muted); }

.prose {
    max-width: 760px;
    padding-top: clamp(48px, 7vw, 80px);
    padding-bottom: clamp(64px, 9vw, 120px);
}
.prose section { padding: 2rem 0; border-bottom: 2px dashed color-mix(in srgb, var(--fg) 25%, transparent); }
.prose section:last-of-type { border-bottom: 0; }
.prose h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}
.prose h2::before { content: ''; width: 8px; height: 8px; background: var(--fg); flex-shrink: 0; }
.prose h3 { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 0.5rem; text-transform: uppercase; }
.prose p { color: var(--muted); margin-bottom: 0.9rem; }
.prose ul { display: grid; gap: 0.5rem; margin: 0 0 1rem; }
.prose li { display: flex; gap: 0.75rem; color: var(--muted); }
.prose li::before { content: '–'; color: var(--muted); }
.prose a:not(.btn) { color: var(--accent-text); font-weight: 600; border-bottom: 1px solid currentColor; }
.prose a:not(.btn):hover { color: var(--fg); }
.prose .btn { margin-top: 2.5rem; }

.sitemap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(64px, 9vw, 120px); }
.sitemap-card { padding: 28px; border: var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.sitemap-card h2 { margin-bottom: 1rem; color: var(--muted); }
.sitemap-card ul { display: grid; gap: 0.6rem; }
.sitemap-card a { font-weight: 600; font-size: 1.15rem; text-transform: uppercase; }
.sitemap-card a:hover { color: var(--accent-text); }

/* ---------- Interactions ---------- */

/* Scroll progress along the bottom of the nav */
.site-nav::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--fg);
    transform: scaleX(var(--scroll, 0));
    transform-origin: left;
    pointer-events: none;
}

/* Hero: grid lines darken slightly under the cursor */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(color-mix(in srgb, var(--fg) 16%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--fg) 16%, transparent) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: -1px -1px;
    -webkit-mask-image: radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), #000 0%, transparent 70%);
    mask-image: radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), #000 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.hero.is-hovered::after { opacity: 1; }
.hero-inner, .ticker { position: relative; z-index: 1; }


/* Hero: browser tilts toward the cursor */
.hero-visual {
    transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.35s var(--ease);
    transform-style: preserve-3d;
}
.browser { cursor: pointer; }
.browser-url #browser-url { color: var(--fg); }

/* Remix layouts */
.browser[data-layout="b"] .sk-hero { grid-template-columns: 1fr 1.2fr; }
.browser[data-layout="b"] .sk-media { order: -1; }
.browser[data-layout="b"] .sk-media::after { border-radius: 0; width: 40%; transform: translate(-50%, -50%) rotate(12deg); }
.browser[data-layout="b"] .sk-cards { grid-template-columns: 2fr 1fr 1fr; }
.browser[data-layout="b"] .sk-pill:last-child { margin-left: 0; order: -1; }

.browser[data-layout="c"] .sk-nav { justify-content: center; }
.browser[data-layout="c"] .sk-logo { order: 2; }
.browser[data-layout="c"] .sk-pill:last-child { margin-left: 0; order: 3; }
.browser[data-layout="c"] .sk-hero { grid-template-columns: 1fr; }
.browser[data-layout="c"] .sk-media { display: none; }
.browser[data-layout="c"] .sk-copy { align-items: center; text-align: center; }
.browser[data-layout="c"] .sk-h { width: 80%; }
.browser[data-layout="c"] .sk-cards { grid-template-columns: repeat(4, 1fr); }
.browser[data-layout="c"] .sk-card { height: 60px; }
.browser[data-layout="c"] .sk-card:nth-child(3) { background: var(--line); }

.browser.is-rebuilding .sk,
.browser.is-rebuilding .sk-media { animation: none; }

.remix-btn {
    position: absolute;
    right: 0;
    bottom: -58px;
    padding: 6px 10px;
    border: 2px dashed color-mix(in srgb, var(--fg) 45%, transparent);
    color: var(--muted);
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.remix-btn:hover { color: var(--fg); border-color: var(--fg); border-style: solid; background: var(--surface); }
.remix-btn .spin { display: inline-block; }

/* Draggable floating tags */
.tag-float { cursor: grab; touch-action: none; user-select: none; transition: box-shadow 0.15s ease; }
.tag-float.is-dragging {
    cursor: grabbing;
    animation-play-state: paused;
    box-shadow: 10px 10px 0 var(--fg);
    z-index: 5;
}


/* Process: progress bar fills as you scroll */
.process-list { position: relative; }
.process-list::before {
    content: '';
    position: absolute;
    top: -3px; left: 0; right: 0;
    height: 2px;
    background: var(--fg);
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
}
.step.is-reached::before { background: var(--fg); color: var(--bg); }

/* Footer wordmark: letters react on hover */
.footer-word span {
    display: inline-block;
    transition: color 0.3s ease;
}
.footer-word span:hover,
.footer-word span.is-lit {
    color: color-mix(in srgb, var(--bg) 22%, transparent);
}

/* Theme switch: circular reveal (View Transitions) */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Reveal on scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero h1 { font-size: clamp(3.2rem, 11vw, 7rem); }
    .hero-visual { max-width: 500px; margin-top: 16px; }
    .process-list { grid-template-columns: repeat(2, 1fr); }
    .step:nth-child(3) { padding-left: 0; border-left: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    :root { --nav-h: 64px; }
    .menu-toggle { display: block; }
    .nav-links {
        position: fixed;
        inset: var(--nav-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 24px;
        background: var(--bg);
        border-bottom: var(--border);
        box-shadow: 0 16px 0 -8px var(--grid);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, transform 0.25s var(--ease), visibility 0.2s;
    }
    .nav-links.is-open { opacity: 1; visibility: visible; transform: none; }
    .nav-links a:not(.btn) { padding: 16px 0; font-size: 1rem; border-bottom: 2px dashed color-mix(in srgb, var(--fg) 20%, transparent); }
    .nav-links a:not(.btn)::after { display: none; }
    .nav-links .btn { margin-top: 20px; min-height: 52px; }

    .services-grid { grid-template-columns: 1fr; }
    .service + .service { border-left: 0; border-top: var(--border); }
    .about-grid { grid-template-columns: 1fr; }
    .portrait { max-width: 380px; }
    .sitemap-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .wb-tab { flex: 0 0 auto; min-width: 0; padding: 10px 12px; }
    .wb-tab[aria-selected="true"] { padding-bottom: 12px; }
    .wb-dots { display: none; }
    .wb-visit { font-size: 0.82rem; }
    .wb-info { left: 8px; }
    .index-link { grid-template-columns: 36px 1fr auto; gap: 4px 12px; padding: 20px 4px; }
    .index-desc, .index-place { grid-column: 2 / -1; }
    .index-go { grid-row: 1; grid-column: 3; }
    body { font-size: 1rem; }
    .nav-actions .btn { display: none; }
    .nav-links .nav-cta-mobile { display: inline-flex; }
    .hero-visual { max-width: 92%; }
    .tag-float.t1 { left: -8px; }
    .tag-float.t2 { right: -10px; }
    .tag-float.t4 { left: -12px; }
    .cta-row .btn { flex: 1 1 auto; }
    .process-list { grid-template-columns: 1fr; }
    .step, .step + .step { padding: 28px 0 8px; border-left: 0; }
    .step + .step { border-top: 2px dashed color-mix(in srgb, var(--fg) 25%, transparent); }
    .facts { grid-template-columns: 1fr; }
    .fact + .fact { border-left: 0; border-top: var(--border); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .opts { grid-template-columns: 1fr; }
    .flow-steps { display: none; }          /* phones: the "Question n of 5" count is enough (GOV.UK pattern) */
    .flow-count { padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); }
    .review > div { grid-template-columns: 1fr auto; }
    .review dd { grid-column: 1 / -1; grid-row: 2; }
    .flow-nav { flex-wrap: wrap; }
    .flow-nav .btn { flex: 1 1 100%; order: -1; }
    .cta-box { box-shadow: 10px 10px 0 var(--fg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
    .ticker-track { animation: none; }
}

/* ---------- Utility classes (replace inline styles so the CSP can forbid them) ---------- */
.swatch--sand { background: #7D5E54; }
.swatch--slate { background: #3E63DD; }
.swatch--sage { background: #208368; }
.swatch--mauve { background: #5B5BD6; }
.swatch--graphite { background: #191918; }
.swatch--midnight { background: #111113; }
.delay-08 { --d: .08s; }
.delay-10 { --d: .1s; }
.delay-16 { --d: .16s; }
.delay-24 { --d: .24s; }
.section-label--center { justify-content: center; }
.footer-bottom--flush { padding-top: 0; }
