/* ==========================================================================
   InnoDiligent LLC — shared stylesheet
   Loaded by index.html, privacy.html and 404.html.
   ========================================================================== */

:root {
    --bg-color: #030303;
    --bg-raised: #0A0A0C;
    --text-main: #FFFFFF;
    --text-muted: #8A8A8F;
    /* #5C5C61 read better but measured 3.1:1 on the page background, which
       fails WCAG AA for the small text it is used on (kickers, stat labels,
       tags, footer). This value measures 4.8:1. */
    --text-dim: #7A7A80;
    --accent: #C9A227;
    --border-color: rgba(255, 255, 255, 0.15);
    --border-faint: rgba(255, 255, 255, 0.06);
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --nav-h: 5.5rem;
}

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

html {
    scroll-behavior: smooth;
    /* Keeps anchored sections clear of the fixed nav. */
    scroll-padding-top: var(--nav-h);
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* The custom cursor is opt-in: app.js adds .custom-cursor only on a fine
   pointer with motion allowed, so a JS failure never leaves a user
   without a cursor. */
body.custom-cursor,
body.custom-cursor a,
body.custom-cursor button,
body.custom-cursor .interactive { cursor: none; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--text-main); color: var(--bg-color); }

/* --------------------------------------------------------------------------
   Accessibility primitives
   -------------------------------------------------------------------------- */

.skip-link {
    position: absolute; left: 1rem; top: -100px;
    background: var(--text-main); color: var(--bg-color);
    padding: 0.9rem 1.5rem; border-radius: 4px; z-index: 10001;
    font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

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

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

/* --------------------------------------------------------------------------
   Ambient layers
   -------------------------------------------------------------------------- */

#particle-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2; pointer-events: none; opacity: 0.55;
}

body::after {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.035; pointer-events: none; z-index: 9999;
}

#cursor-dot, #cursor-geom {
    position: fixed; top: 0; left: 0; pointer-events: none;
    mix-blend-mode: difference; z-index: 10000; display: none;
}
body.custom-cursor #cursor-dot,
body.custom-cursor #cursor-geom { display: block; }

#cursor-dot {
    width: 12px; height: 12px; background: #FFF; border-radius: 50%;
    transition: opacity 0.3s;
}
#cursor-geom {
    width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.4s var(--ease-out-expo), height 0.4s var(--ease-out-expo),
                border-radius 0.4s var(--ease-out-expo), background-color 0.4s;
    will-change: transform;
}
body.hovering #cursor-dot { opacity: 0; }
body.hovering #cursor-geom {
    width: 74px; height: 74px; background: #FFF;
    border-radius: 50%; border-color: transparent;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, .logo, .stat-value {
    font-family: var(--font-display); text-transform: uppercase; font-weight: 500;
}
h1 {
    font-size: clamp(2.5rem, 6.5vw, 6.5rem); font-weight: 700;
    line-height: 1.04; letter-spacing: -0.015em; margin-bottom: 1.25rem;
}
h2 {
    font-size: clamp(2.25rem, 5vw, 4.5rem);
    line-height: 1.08; margin-bottom: 1.5rem;
}
h3 { font-size: 1.35rem; font-weight: 400; letter-spacing: 0.03em; margin-bottom: 0.75rem; }
h4 {
    font-size: 0.8rem; letter-spacing: 0.16em;
    color: var(--text-muted); margin-bottom: 1.5rem;
}
p { color: var(--text-muted); max-width: 70ch; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.4rem); line-height: 1.55; }
strong { color: var(--text-main); font-weight: 500; }

.kicker {
    display: block; font-size: 0.78rem; text-transform: uppercase;
    letter-spacing: 0.22em; color: var(--text-dim); margin-bottom: 1.75rem;
}
.kicker .rule {
    display: inline-block; width: 2.5rem; height: 1px;
    background: var(--accent); vertical-align: middle; margin-right: 1rem;
}

/* --------------------------------------------------------------------------
   Reveal animation
   -------------------------------------------------------------------------- */

.reveal-mask { display: block; overflow: hidden; padding-bottom: 0.12em; }
.reveal-text {
    display: block; transform: translateY(110%);
    transition: transform 1.1s var(--ease-out-expo); will-change: transform;
}
.reveal-mask.in-view > .reveal-text { transform: translateY(0); }
.delay-1 > .reveal-text { transition-delay: 0.08s; }
.delay-2 > .reveal-text { transition-delay: 0.16s; }
.delay-3 > .reveal-text { transition-delay: 0.24s; }

/* Content must never depend on JS to become visible. */
.no-js .reveal-text { transform: none; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.container { width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 6vw; }
.container--narrow { max-width: 920px; }

section { padding: 12vh 0; }
section.tall { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }

.section-head { max-width: 62ch; margin-bottom: 4rem; }

/* Navigation */
.nav {
    position: fixed; top: 0; left: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.75rem 6vw; z-index: 100;
    transition: background-color 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: rgba(3, 3, 3, 0.82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--border-faint);
    padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.logo { font-size: 1.4rem; letter-spacing: 0.04em; font-weight: 700; }
.logo .dot { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 2.5rem; }
.nav-links a {
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--text-muted); transition: color 0.3s ease;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text-main); }

.nav-toggle {
    display: none; background: none; border: 1px solid var(--border-color);
    border-radius: 100px; color: var(--text-main); padding: 0.6rem 1.1rem;
    font-family: var(--font-body); font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.12em; cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    padding: 1.05rem 2.5rem; border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px; font-family: var(--font-body);
    font-size: 0.82rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.12em; background: transparent; color: var(--text-main);
    cursor: pointer; transition: background-color 0.35s ease, color 0.35s ease,
                                 border-color 0.35s ease, transform 0.4s var(--ease-out-expo);
}
.btn:hover, .btn:focus-visible { background: var(--text-main); color: var(--bg-color); border-color: var(--text-main); }
.btn--solid { background: var(--text-main); color: var(--bg-color); border-color: var(--text-main); }
.btn--solid:hover, .btn--solid:focus-visible { background: transparent; color: var(--text-main); }
.btn--sm { padding: 0.72rem 1.6rem; font-size: 0.72rem; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.magnetic-wrap { display: inline-block; padding: 18px; margin: -18px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    min-height: 100vh; min-height: 100svh;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding-top: calc(var(--nav-h) + 2rem); padding-bottom: 8vh;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 2.25rem; }

.hero-meta {
    display: flex; flex-wrap: wrap; gap: 2.5rem 4rem;
    margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-faint);
}
.stat-value { font-size: 2.4rem; color: var(--text-main); line-height: 1; }
.stat-label {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--text-dim); margin-top: 0.6rem;
}

/* --------------------------------------------------------------------------
   Grids and cards
   -------------------------------------------------------------------------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3rem 4vw; }
.grid-split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 4rem 6vw; align-items: start; }

.pillar {
    padding: 2.25rem 0 2rem;
    border-top: 1px solid var(--border-faint);
    transition: border-color 0.4s ease;
}
.pillar:hover { border-top-color: var(--accent); }
.pillar-num {
    font-family: var(--font-display); font-size: 0.8rem;
    letter-spacing: 0.15em; color: var(--accent); display: block; margin-bottom: 1rem;
}
.pillar h3 { color: var(--text-main); }
.pillar p { font-size: 1rem; }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.tag {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim); border: 1px solid var(--border-faint);
    border-radius: 100px; padding: 0.35rem 0.85rem;
}

.cred-list { list-style: none; margin-top: 2rem; }
.cred-list li {
    color: var(--text-muted); font-size: 1.02rem;
    padding: 1.4rem 0; border-bottom: 1px solid var(--border-faint);
}
.cred-list li:first-child { border-top: 1px solid var(--border-faint); }

/* Flagship / StadiumStub */
.flagship {
    background: var(--bg-raised);
    border-top: 1px solid var(--border-faint);
    border-bottom: 1px solid var(--border-faint);
}
.flagship .container { text-align: center; display: flex; flex-direction: column; align-items: center; }
.flagship p { margin-left: auto; margin-right: auto; }
.app-badge { display: inline-block; transition: transform 0.4s var(--ease-out-expo), filter 0.4s ease; }
.app-badge img { height: 54px; width: auto; pointer-events: none; }
.app-badge:hover, .app-badge:focus-visible { transform: scale(1.04); filter: brightness(1.15); }

/* App screenshot gallery */
.showcase {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 2rem; margin-top: 3.5rem;
    /* Deliberately breaks out of the narrow prose column: at the container's
       920px the four phones render ~163px wide, too small to read. */
    width: min(1240px, 88vw); max-width: none;
}
.shot { text-align: center; }
.shot-frame {
    position: relative; display: block; width: 100%;
    /* Matches the iPhone capture ratio, so the row holds its layout before
       the images decode — no reflow on load. */
    aspect-ratio: 1320 / 2868;
    border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-raised);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s var(--ease-out-expo), border-color 0.4s ease;
}
.shot-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot:hover .shot-frame { transform: translateY(-8px); border-color: rgba(255, 255, 255, 0.3); }
.shot figcaption {
    margin-top: 1.1rem; font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.14em; color: var(--text-dim);
}
.shot figcaption strong {
    display: block; font-family: var(--font-display); font-size: 0.95rem;
    letter-spacing: 0.06em; color: var(--text-main); margin-bottom: 0.35rem;
}

@media (max-width: 900px) {
    /* Swipeable rail rather than four unreadably narrow columns. */
    .showcase {
        grid-template-columns: repeat(4, 68vw);
        gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
        padding-bottom: 1.5rem; margin-left: -6vw; margin-right: -6vw;
        padding-left: 6vw; padding-right: 6vw;
        -webkit-overflow-scrolling: touch;
    }
    .shot { scroll-snap-align: center; }
    .shot:hover .shot-frame { transform: none; }
}

.spec-row {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem 3rem;
    margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border-faint);
    width: 100%;
}
.spec {
    font-size: 0.74rem; text-transform: uppercase;
    letter-spacing: 0.13em; color: var(--text-dim);
}

/* Three-across grid for the market segments */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem 4vw; }

/* Product cards */
.product-card {
    border-top: 1px solid var(--border-color);
    padding: 2.25rem 0 2rem;
    transition: border-color 0.4s ease;
}
.product-card:hover { border-top-color: var(--accent); }
.product-card h3 {
    color: var(--text-main); font-size: clamp(1.6rem, 2.4vw, 2.2rem); margin: 1rem 0 0.9rem;
}
.product-card .audience {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--text-dim); margin-top: 1.25rem;
}

/* Status pills — a launched product and one in development must never be
   mistaken for each other. */
.status {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em;
    border-radius: 100px; padding: 0.4rem 0.9rem; border: 1px solid;
}
.status::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.status--live { color: #6FCF97; border-color: rgba(111, 207, 151, 0.4); }
.status--dev { color: var(--accent); border-color: rgba(201, 162, 39, 0.4); }

.callout {
    border: 1px solid var(--border-color); border-left: 2px solid var(--accent);
    padding: 2rem 2.25rem; background: rgba(255, 255, 255, 0.02);
}
.callout p { max-width: 68ch; }

@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* Interior page headers (every page except the homepage) */
.doc-head { padding-top: calc(var(--nav-h) + 6rem); padding-bottom: 3rem; }
.doc-head h1 { font-size: clamp(2.5rem, 6vw, 5.5rem); margin-bottom: 1.5rem; }

.nav-links a[aria-current="page"] { color: var(--text-main); }

/* Founder portrait. Falls back to a labelled placeholder if the image is
   absent, so a missing file never renders as a broken-image icon. */
.portrait {
    /* 2:3 matches the source portrait, so `cover` has nothing to crop — a 4:5
       frame cuts into the top of the head. */
    width: 100%; max-width: 320px; aspect-ratio: 2 / 3;
    border-radius: 6px; overflow: hidden;
    border: 1px solid var(--border-color); background: var(--bg-raised);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait--empty { position: relative; }
.portrait--empty::after {
    content: 'Photograph pending';
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex;
    align-items: center; justify-content: center;
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--text-dim);
}

/* Third-party verification links (LinkedIn, email, phone) */
.verify-list { list-style: none; margin-top: 1.75rem; display: grid; gap: 0.75rem; }
.verify-list li { font-size: 0.98rem; }

/* Past performance / case studies */
.case {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 2rem 5vw;
}
.case:last-of-type { border-bottom: 1px solid var(--border-color); }
.case-agency {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em;
    color: var(--accent); margin-bottom: 1rem;
}
.case h3 {
    color: var(--text-main); font-size: clamp(1.4rem, 2.2vw, 2rem);
    text-transform: uppercase; margin-bottom: 1rem;
}
.case .role {
    font-size: 0.78rem; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.1em;
}
.case ul { list-style: none; display: grid; gap: 1rem; }
.case ul li {
    color: var(--text-muted); font-size: 1rem;
    padding-left: 1.6rem; position: relative;
}
.case ul li::before {
    content: ''; position: absolute; left: 0; top: 0.6em;
    width: 7px; height: 7px; border: 1px solid var(--accent);
    transform: rotate(45deg);
}

.badge-first {
    display: inline-block; margin-top: 1.5rem; padding: 0.5rem 1rem;
    border: 1px solid var(--accent); border-radius: 100px;
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--accent);
}

/* Leadership */
.bio { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 3rem 5vw; align-items: start; }
.bio-name { font-size: clamp(2rem, 3.5vw, 3rem); color: var(--text-main); margin-bottom: 0.5rem; }
.bio-role {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--accent);
}
.role-list { list-style: none; display: grid; gap: 0; margin-top: 2rem; }
.role-list li {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
    padding: 1.1rem 0; border-bottom: 1px solid var(--border-faint);
    color: var(--text-main); font-size: 1rem;
}
.role-list li:first-child { border-top: 1px solid var(--border-faint); }
.role-list .org { color: var(--text-dim); font-size: 0.85rem; text-align: right; }

/* Partners */
.partner-row {
    display: flex; flex-wrap: wrap; gap: 1rem 0.75rem; margin-top: 2rem;
}
.partner {
    font-family: var(--font-display); font-size: 0.95rem;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: 4px;
    padding: 0.75rem 1.4rem;
}

@media (max-width: 1024px) {
    .case, .bio { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Procurement facts */
.fact-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px; background: var(--border-faint);
    border: 1px solid var(--border-faint); margin-top: 3rem;
}
.fact { background: var(--bg-color); padding: 2rem 1.75rem; }
.fact dt {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--text-dim); margin-bottom: 0.75rem;
}
.fact dd {
    font-family: var(--font-display); font-size: 1.25rem;
    letter-spacing: 0.04em; color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Contact — mail links only. There is no form on this site; every contact
   path opens the visitor's own mail client.
   -------------------------------------------------------------------------- */

.mail-options { list-style: none; margin-top: 1.25rem; display: grid; gap: 0; }
.mail-options li {
    display: flex; flex-direction: column; gap: 0.4rem;
    padding: 1.35rem 0; border-bottom: 1px solid var(--border-faint);
}
.mail-options li:first-child { border-top: 1px solid var(--border-faint); }
.mail-options a { font-size: 1.05rem; }
.mail-options span { font-size: 0.85rem; color: var(--text-dim); }

.contact-aside { border-top: 1px solid var(--border-faint); padding-top: 2rem; }
.contact-aside + .contact-aside { margin-top: 2rem; }

.link-underline { position: relative; display: inline-block; color: var(--text-main); }
.link-underline::after {
    content: ''; position: absolute; left: 0; bottom: -3px;
    width: 100%; height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: right;
    transition: transform 0.4s var(--ease-out-expo);
}
.link-underline:hover::after, .link-underline:focus-visible::after {
    transform: scaleX(1); transform-origin: left;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    padding: 6rem 6vw 3rem; display: flex; flex-direction: column; gap: 4rem;
    border-top: 1px solid var(--border-color);
}
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 3rem; width: 100%; max-width: 1500px; margin: 0 auto;
}
.footer-col address { font-style: normal; color: var(--text-muted); }
.footer-col ul { list-style: none; display: grid; gap: 0.7rem; }
.footer-col a { color: var(--text-muted); transition: color 0.3s ease; }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--text-main); }

.footer-bottom {
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
    width: 100%; max-width: 1500px; margin: 0 auto;
    font-size: 0.74rem; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.1em;
    border-top: 1px solid var(--border-faint); padding-top: 2rem;
}

/* --------------------------------------------------------------------------
   Long-form document pages (privacy, 404)
   -------------------------------------------------------------------------- */

.doc { padding-top: calc(var(--nav-h) + 6rem); padding-bottom: 8rem; }
.doc h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin-bottom: 1rem; }
.doc h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); margin: 3.5rem 0 1rem; }
.doc h3 { font-size: 1.1rem; color: var(--text-main); margin: 2rem 0 0.75rem; }
.doc p, .doc li { color: var(--text-muted); font-size: 1rem; }
.doc p { margin-bottom: 1.1rem; max-width: 75ch; }
.doc ul, .doc ol { margin: 0 0 1.5rem 1.25rem; }
.doc li { margin-bottom: 0.6rem; }
.doc a { color: var(--text-main); text-decoration: underline; text-underline-offset: 3px; }
.doc .updated {
    font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--text-dim); margin-bottom: 3rem;
}

.error-page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; padding: 6rem 6vw;
}
.error-code {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(6rem, 22vw, 16rem); line-height: 1; color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .grid-2, .grid-split { grid-template-columns: 1fr; gap: 2.5rem; }
    section.tall { min-height: auto; }
    #particle-canvas { display: none; }

    .nav-toggle { display: inline-block; position: relative; z-index: 101; }

    /* backdrop-filter makes an element a containing block for fixed-position
       descendants. On the header that would size the full-screen menu to the
       header's own 71px box instead of the viewport, so the menu is dropped
       to an opaque background at mobile widths. */
    .nav.scrolled {
        background: rgba(3, 3, 3, 0.95);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .nav-links {
        /* Longhands rather than `inset`: the shorthand is not honoured in every
           embedded/WebView renderer, and a collapsed menu that only shifts by
           its own small height leaves links overlapping the header. */
        position: fixed; top: 0; right: 0; bottom: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(3, 3, 3, 0.97);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
        flex-direction: column; justify-content: center; gap: 2.25rem;
        transform: translateY(-100%);
        /* visibility, not just an offscreen transform: without it the links stay
           in the tab order and reachable by screen readers while the menu is
           closed. It is delayed on close so the slide-up still animates. */
        visibility: hidden;
        transition: transform 0.55s var(--ease-out-expo), visibility 0s linear 0.55s;
        z-index: 99;
    }
    .nav-links.open {
        transform: translateY(0);
        visibility: visible;
        transition: transform 0.55s var(--ease-out-expo), visibility 0s linear 0s;
    }
    .nav-links a { font-size: 1.1rem; letter-spacing: 0.18em; color: var(--text-main); }
}

@media (max-width: 620px) {
    .hero-meta { gap: 2rem 2.5rem; }
    .stat-value { font-size: 1.9rem; }
    .hero-actions .btn { width: 100%; }
    .fact-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Motion and contrast preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-text { transform: none !important; }
    #particle-canvas, #cursor-dot, #cursor-geom { display: none !important; }
}

@media (prefers-contrast: more) {
    :root {
        --text-muted: #D5D5D8;
        --text-dim: #B4B4B8;
        --border-color: rgba(255, 255, 255, 0.5);
        --border-faint: rgba(255, 255, 255, 0.25);
    }
    body::after { display: none; }
}

@media print {
    body { background: #fff; color: #000; }
    body::after, #particle-canvas, .nav, .site-footer, #cursor-dot, #cursor-geom { display: none !important; }
    .reveal-text { transform: none !important; }
    p, li, h1, h2, h3 { color: #000 !important; }
}
