/* ActivePair Labs, variant E. Shared system: ink on cool white, one cobalt accent (light only),
   Schibsted Grotesk for text, Martian Mono for labels and coordinates.
   One container: 1280px of content, 80px side margins at 1440, 24px on phones. */
:root {
  --bg: #0A0A0A; --panel: #111111; --panel-2: #171717; --desk: #0D0D0D;
  --fg: #EDEDED; --body: #BDBDBD; --muted: #858585;
  --line: #242424; --line-2: #383838;
  --accent: #6E86FF; --accent-ink: #0A0A0A; --accent-soft: rgba(110, 134, 255, .16);
  --ok: #8FD3A0; --no: #FF8A75;
  --trace: #E6E6E6; --stroke: #9A9A9A; --frozen: #1A1A1A; --busy: #2A2A2A; --hatch-a: #151515; --hatch-b: #2A2A2A;
  --grid-minor: rgba(255, 255, 255, .045); --grid-major: rgba(255, 255, 255, .10);
  --glass: rgba(10, 10, 10, .86);
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --side: clamp(24px, 5.56vw, 80px);
  --read: 700px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #FFFFFF; --panel: #FAFAF8; --panel-2: #F3F3F0; --desk: #F5F5F2;
  --fg: #0A0A0A; --body: #3A3A3A; --muted: #6B6B6B;
  --line: #E6E6E2; --line-2: #CFCFC9;
  --accent: #1F3FE0; --accent-ink: #FFFFFF; --accent-soft: rgba(31, 63, 224, .08);
  --ok: #1F7A3A; --no: #B3261E;
  --trace: #161616; --stroke: #6E6E6E; --frozen: #ECECE8; --busy: #E2E2DD; --hatch-a: #FFFFFF; --hatch-b: #E2E2DD;
  --grid-minor: rgba(0, 0, 0, .04); --grid-major: rgba(0, 0, 0, .085);
  --glass: rgba(255, 255, 255, .88);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #FFFFFF; --panel: #FAFAF8; --panel-2: #F3F3F0; --desk: #F5F5F2;
    --fg: #0A0A0A; --body: #3A3A3A; --muted: #6B6B6B;
    --line: #E6E6E2; --line-2: #CFCFC9;
    --accent: #1F3FE0; --accent-ink: #FFFFFF; --accent-soft: rgba(31, 63, 224, .08);
    --ok: #1F7A3A; --no: #B3261E;
    --trace: #161616; --stroke: #6E6E6E; --frozen: #ECECE8; --busy: #E2E2DD; --hatch-a: #FFFFFF; --hatch-b: #E2E2DD;
    --grid-minor: rgba(0, 0, 0, .04); --grid-major: rgba(0, 0, 0, .085);
    --glass: rgba(255, 255, 255, .88);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 17px; line-height: 1.6; overflow-x: clip; }
h1, h2, h3, p, dl, dd, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg, canvas { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.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; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; font-family: var(--mono); font-size: 12px; text-decoration: none; }
.skip:focus { top: 12px; }

/* The one container. Every row (nav, sections, footer) sits inside it, so rules span the content width. */
.frame { max-width: calc(1280px + 2 * var(--side)); margin: 0 auto; padding-inline: var(--side); }
.row { border-top: 1px solid var(--line); }
.read { max-width: var(--read); }

/* Mono labels and coordinates */
.label { font-family: var(--mono); font-size: 11px; line-height: 1.5; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.label b { color: var(--fg); font-weight: 400; }
.label .acc { color: var(--accent); }
.coord { display: flex; justify-content: space-between; gap: 12px; padding-block: 10px; }

/* Nav: Writing left, wordmark centred, Contact right, on the same container as the page.
   Transparent at the top; after a little scroll it turns into a solid, slightly shorter bar. */
.site-head { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid transparent; transition: background-color .22s var(--ease-out), border-color .22s var(--ease-out), -webkit-backdrop-filter .22s var(--ease-out), backdrop-filter .22s var(--ease-out); }
.site-head.solid { background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); border-bottom-color: var(--line); }
.nav-in { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; height: 68px; transition: height .22s var(--ease-out); }
.site-head.solid .nav-in { height: 54px; }
.nav-in .nl { justify-self: start; display: flex; gap: 8px; }
.nav-in .nr { justify-self: end; display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; color: var(--fg); text-decoration: none; padding-block: 8px; }
.brand svg { display: block; height: 15px; width: auto; transition: height .22s var(--ease-out); }
.site-head.solid .brand svg { height: 13px; }
.foot-brand { display: inline-flex; align-items: center; gap: 14px; }
.foot-brand .brand svg { height: 10px; }
/* Links: monospace; on hover the label scrambles in once and thin brackets close around it */
.navlink { position: relative; display: inline-flex; align-items: center; gap: 0; min-height: 44px; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--muted); text-decoration: none; transition: color .2s var(--ease-out); }
.navlink .bk { display: inline-block; width: 1.4em; text-align: center; color: var(--line-2); opacity: 0; transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), color .2s var(--ease-out); }
.navlink .bk:first-child { transform: translateX(4px); } .navlink .bk:last-child { transform: translateX(-4px); }
.navlink:hover, .navlink:focus-visible, .navlink[aria-current="page"] { color: var(--fg); }
.navlink:hover .bk, .navlink:focus-visible .bk { opacity: 1; transform: none; color: var(--muted); }
.navlink[aria-current="page"] .tx { box-shadow: inset 0 -1px 0 var(--accent); }
.navpill { display: inline-flex; align-items: center; min-height: 30px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font-size: 13px; text-decoration: none; transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out); }
.navpill:hover { background: var(--panel-2); }
.navpill[aria-current="page"] { border-color: var(--fg); }
.pill { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-family: var(--mono); font-size: 12px; text-decoration: none; transition: background-color .2s var(--ease-out), transform .12s var(--ease-out); }
.pill:hover { background: var(--accent); }
.pill:active { transform: scale(.97); }
.pill.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.pill.ghost:hover { box-shadow: inset 0 0 0 1px var(--fg); background: transparent; }
/* Reading progress (article and live pages) */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; pointer-events: none; }
/* Mobile menu */
.menu-btn { display: none; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 4px; margin-right: -4px; background: none; border: 0; cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--fg); }
.menu-btn i { position: relative; display: block; width: 16px; height: 7px; border-block: 1px solid currentColor; transition: transform .2s var(--ease-out), height .2s var(--ease-out); }
.menu-btn[aria-expanded="true"] i { height: 0; border-bottom: 0; transform: rotate(0); }
.menu { position: fixed; inset: 0; z-index: 25; background: var(--bg); padding: 76px var(--side) 32px; display: flex; flex-direction: column; gap: 4px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s var(--ease-out), transform .22s var(--ease-out), visibility 0s linear .22s; }
.menu.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s var(--ease-out), transform .22s var(--ease-out), visibility 0s; }
.menu a { display: flex; align-items: baseline; gap: 14px; min-height: 56px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 1.8rem; font-weight: 600; letter-spacing: -0.02em; color: var(--fg); text-decoration: none; }
.menu a .label { font-size: 11px; font-weight: 400; color: var(--accent); }
.menu a[aria-current="page"] { color: var(--accent); }
body.menu-open { overflow: hidden; }

/* Winner badge: mono, thin border, small orange mark */
.badge-win { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 5px 9px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 10.5px; line-height: 1.3; color: var(--fg); text-decoration: none; background: var(--bg); transition: border-color .2s var(--ease-out); }
.badge-win i { flex: none; width: 6px; height: 6px; background: var(--accent); }
.badge-win:hover { border-color: var(--accent); }

/* Footer: mission block and link columns, legal line under a rule */
.site-foot { padding-block: 56px 28px; }
.foot-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px 48px; }
.foot-mission .brand svg { height: 14px; }
.foot-mission p { margin-top: 18px; max-width: 26ch; font-size: 1.35rem; line-height: 1.3; letter-spacing: -0.015em; color: var(--fg); }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-cols h2 { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--muted); margin-bottom: 14px; }
.foot-cols ul { list-style: none; display: grid; gap: 10px; }
.foot-cols a { color: var(--fg); text-decoration: none; font-size: 0.95rem; overflow-wrap: anywhere; }
.foot-cols a:hover { color: var(--accent); }
.foot-legal { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Scramble: real text stays for screen readers; animated copy is aria-hidden */
.scr { white-space: normal; }
.scr [aria-hidden="true"] { -webkit-user-select: none; user-select: none; }
.scr .c { position: relative; }
.scr .c.pending { color: transparent; }
.scr .c.pending::after { content: attr(data-s); position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: var(--muted); font-family: var(--mono); font-size: .6em; line-height: 1; font-weight: 400; }
.scr .c.flash { color: var(--accent); }

/* Reveal on entry */
.rv { opacity: 0; transform: translateY(10px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; transform: none; }
.no-js .rv { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media (max-width: 640px) {
  .nav-in { height: 60px; } .site-head.solid .nav-in { height: 52px; }
  .nav-in .navpill { display: none; }
  .nav-in { grid-template-columns: auto minmax(0, 1fr) auto; } .nav-in .brand { grid-column: 1; grid-row: 1; } .nav-in .nr { grid-column: 3; grid-row: 1; }
  .foot-top { grid-template-columns: minmax(0, 1fr); }
  .foot-cols { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .menu-btn { display: inline-flex; }
  .brand svg, .site-head.solid .brand svg { height: 10px; }
  }
@media (max-width: 380px) { .brand svg, .site-head.solid .brand svg { height: 9px; } }
