/* Shared by the front page, the paper page and the terms. Every block keeps one
   measure: nav, text, tiles, figures and footer sit on the same two edges. */

@font-face {
    font-family: "Roboto Slab";
    src: url("/fonts/RobotoSlab-Regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Roboto Slab";
    src: url("/fonts/RobotoSlab-Bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

:root {
    --paper: #ffffff;
    --wash: #f5f6f7;
    --card: #ffffff;
    --ink: #0f1a20;
    --muted: #55636c;
    --rule: #e3e6e8;
    --accent: #23607a;
    --btn-bg: #0f1a20;
    --btn-ink: #ffffff;
    --glass: rgba(255, 255, 255, .72);
    --glass-edge: rgba(255, 255, 255, .75);
    --shadow: 0 8px 30px rgba(0, 0, 0, .10);
    --pill-shadow: 0 4px 14px rgba(0, 0, 0, .14);
    --slab: "Roboto Slab", ui-serif, Georgia, serif;
    --sans: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
html.dark {
    --paper: #0f2027;
    --wash: #132832;
    --card: #1a2e38;
    --ink: #e9f2f6;
    --muted: #aec5cf;
    --rule: #2c4654;
    --accent: #8cc4d8;
    --btn-bg: #e9f2f6;
    --btn-ink: #0f2027;
    --glass: rgba(15, 32, 39, .62);
    --glass-edge: rgba(255, 255, 255, .14);
    --shadow: 0 8px 30px rgba(0, 0, 0, .35);
    --pill-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--paper);
    color: var(--ink);
    font: 400 17px/1.65 var(--sans);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1008px; margin: 0 auto; padding: 0 24px; }

/* --- Floating nav: a pill on the column's right edge --- */
.nav { position: fixed; top: 16px; left: 0; right: 0; z-index: 50; pointer-events: none; }
.nav .wrap { display: flex; justify-content: flex-end; }
.pill {
    pointer-events: auto;
    display: flex; align-items: center; gap: 2px;
    padding: 5px 6px 5px 12px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--pill-shadow);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.brand {
    display: inline-flex; align-items: center; gap: 8px;
    margin-right: 8px;
    color: var(--ink); text-decoration: none;
    font: 700 15px/1 var(--slab);
    white-space: nowrap;
}
.brand svg { width: 22px; height: 22px; flex: none; }
.pill-link {
    padding: 6px 11px; border-radius: 999px;
    color: var(--ink); text-decoration: none;
    font-size: 14px; font-weight: 600; line-height: 1.2;
    transition: background .15s ease, color .15s ease;
}
.pill-link:hover { background: var(--ink); color: var(--paper); }
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; margin-left: 2px;
    border: 0; border-radius: 999px;
    background: transparent; color: var(--ink);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.theme-toggle:hover { background: var(--ink); color: var(--paper); }
.theme-toggle svg { width: 17px; height: 17px; }
.icon-sun { display: none; }
html.dark .icon-sun { display: block; }
html.dark .icon-moon { display: none; }

/* --- Type --- */
.eyebrow {
    font: 400 12px/1.4 var(--mono);
    letter-spacing: .25em; text-transform: uppercase;
    color: var(--muted);
}
h1, h2, h3 { font-family: var(--slab); font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.14; letter-spacing: -.012em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.15rem); line-height: 1.2; letter-spacing: -.008em; }
h3 { font-size: 1.1rem; line-height: 1.3; }

/* --- Buttons: ink pills that invert on hover --- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 8px 24px;
    border: 1px solid var(--btn-bg); border-radius: 999px;
    background: var(--btn-bg); color: var(--btn-ink);
    font-size: 15px; font-weight: 600; line-height: 1.25; text-decoration: none; text-align: center;
    overflow-wrap: anywhere;
    transition: background .15s ease, color .15s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.btn.ghost:hover { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }

/* --- Hero, after awaw.ai: its dark ground in both schemes, the brain larger than the hero, a
   smaller disc inside it, a light card over the brain's front. The top and the sway's ends run
   off the hero; the back, the cerebellum and the stem's start stay inside, so the brain's
   outline still reads. --stage is the side of the square the brain fills at
   every sway angle; the 3D scene reads the stage's box, so these rules alone place the brain. --disc is the disc's share of the stage; hero/brain.js DISC
   says the same, and make hero-check compares them. --- */
.hero {
    --stage: min(164.6vh, 164.6svh, 107.3vw);
    --disc: 0.51;
    position: relative; isolation: isolate;
    display: flex; align-items: center;
    min-height: 100vh; min-height: 100svh;
    padding: 96px 0 64px;
    background: #313131;
    overflow: hidden;
}
.hero-stage {
    position: absolute; z-index: 0;
    width: var(--stage); aspect-ratio: 1 / 1;
    /* At rest the brain's back sits .431 of the stage right of the stage's centre and its
       cerebellum .338 below: keep the back inside the right edge and the cerebellum 24 px
       above the bottom. */
    left: min(62%, calc(100% - var(--stage) * .431));
    top: min(calc(50% + 24px), calc(100% - 24px - var(--stage) * .338));
    transform: translate(-50%, -50%);
}
/* The disc until the scene's first frame, where the scene draws it again with its wave. */
.hero-stage::before {
    content: ""; position: absolute; z-index: -1;
    left: 50%; top: 50%;
    width: calc(var(--disc) * 100%); aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #000;
}
.hero-stage img { display: block; width: 100%; height: 100%; }
.hero-canvas {
    position: absolute; inset: 0; z-index: 1;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity .7s ease;
}
.hero-canvas.live { opacity: 1; }
.hero-text { position: relative; z-index: 2; width: 100%; }
.glass {
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    border-radius: 20px;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
/* The card keeps awaw.ai's light face in both schemes. */
.hero-card {
    --ink: #0f1a20; --muted: #55636c; --btn-bg: #0f1a20; --btn-ink: #ffffff;
    max-width: 500px;
    padding: 36px 40px 38px;
    color: var(--ink);
    background: rgba(255, 255, 255, .9);
    border-color: rgba(255, 255, 255, .6);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.hero-card .eyebrow { margin-bottom: 14px; }
.hero-card h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); line-height: 1.04; letter-spacing: -.02em; }
.hero-card .lead { margin-top: 16px; font-size: 1.08em; color: var(--muted); text-wrap: balance; }
.hero-card .actions { margin-top: 26px; }
.scroll-hint {
    position: absolute; z-index: 2; left: 50%; bottom: 18px;
    transform: translateX(-50%);
    font: 400 11px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; white-space: nowrap;
    color: rgba(255, 255, 255, .8); text-decoration: none;
    text-shadow: 0 0 3px #000, 0 0 8px #000, 0 0 14px #000; /* readable over the sticks */
}
.scroll-hint:hover { color: #ffffff; }
/* A narrower window: a smaller card. */
@media (min-width: 861px) and (max-width: 1100px) {
    .hero { --stage: min(164.6vh, 164.6svh, 116vw); }
    .hero-card { max-width: 400px; padding: 28px 30px 30px; }
    .hero-card h1 { font-size: 2.3rem; }
}
/* A short, wide window: a flatter card. */
@media (min-width: 861px) and (max-height: 760px) {
    .hero { padding-top: 80px; }
    .hero-card { padding: 26px 32px 28px; }
    .hero-card h1 { font-size: 2.5rem; }
    .hero-card .lead { margin-top: 10px; }
    .hero-card .actions { margin-top: 18px; }
}
/* A phone or a narrow tablet: the brain on top, wider than the screen: its front runs off
   the left edge, its back stays at the right edge (centre .431 of the stage left of it), and
   the card starts below the cerebellum, over the stem. */
@media (max-width: 860px) {
    .hero {
        --stage: min(154vw, 116svh);
        flex-direction: column; align-items: stretch;
        min-height: 0;
        padding: 76px 0 40px;
    }
    .hero-stage {
        position: relative; left: auto; top: auto; transform: none; flex: none;
        margin: calc(var(--stage) * -.2) 0 0 calc(100% - var(--stage) * .931);
    }
    .hero-text { margin-top: calc(var(--stage) * -.14); }
    .hero-card { max-width: none; }
    .scroll-hint { display: none; }
}

/* --- Sections --- */
.section { padding: 88px 0; scroll-margin-top: 0; }
.section.alt { background: var(--wash); }
.section-head { margin-bottom: 28px; }
.section-head .eyebrow { margin-bottom: 12px; }
.body-text + .body-text { margin-top: 14px; }
.section-lede { margin-bottom: 20px; }
.section .actions { margin-top: 28px; }
/* A part of a section with its own heading: the use cases. */
.subhead { margin: 36px 0 14px; font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.25; scroll-margin-top: 84px; }
.subhead.next { margin-top: 56px; margin-bottom: 20px; }

/* A figure from the paper: printed on white in either scheme. */
.figure { margin-top: 32px; }
.figure > a { display: block; padding: 20px; background: #fff; border: 1px solid var(--rule); border-radius: 20px; }
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 14px; font-size: .92em; line-height: 1.55; color: var(--muted); }
/* A recording: the frame as it was recorded, on black while it loads. */
.clip video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--rule); border-radius: 20px; }
.clip + .actions { margin-top: 24px; }

/* --- Tiles and cards --- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.tile, .card { background: var(--card); border: 1px solid var(--rule); border-radius: 20px; padding: 22px; }
/* Two lines reserved, so the numbers in a row sit level when one label wraps. */
.tile h3 { min-height: 2.7em; font: 600 .86em/1.35 var(--sans); color: var(--muted); }
.tile .num { margin: 8px 0 8px; font: 700 2.05em/1.15 var(--slab); white-space: nowrap; }
.tile .num + p { font-size: .93em; line-height: 1.5; }
.tile .sub { margin-top: 8px; font-size: .86em; line-height: 1.45; color: var(--muted); }

.limits { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .95em; color: var(--muted); }
.limits strong { color: var(--ink); }
.watch { margin-top: 28px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; }
.card p { flex: 1; margin: 10px 0 18px; font-size: .95em; line-height: 1.55; color: var(--muted); }
.card .btn { align-self: flex-start; min-height: 40px; padding: 7px 18px; font-size: 14px; }

/* --- Inner pages --- */
.page-head { padding: 112px 0 56px; background: var(--wash); }
.page-head .eyebrow { margin-bottom: 14px; }
.page-head .byline { margin-top: 16px; font-weight: 600; }
.page-head .meta { color: var(--muted); }
.page-head .actions { margin-top: 24px; }
.page-head .lede { margin-top: 12px; color: var(--muted); }
.page-main section { margin-top: 56px; }
.page-main h2 { margin-bottom: 16px; }
.note { margin-bottom: 18px; color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 20px; padding: 26px 28px 28px; overflow-wrap: anywhere; }
.license { margin-top: 10px; font-size: .93em; color: var(--muted); }
.figs { display: grid; gap: 40px; }
.figs .figure { margin-top: 0; }

.prose h2 { margin: 36px 0 8px; font-size: 1.2rem; line-height: 1.3; }
.prose p { margin: 0 0 12px; }
.prose .meta { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .92em; color: var(--muted); }

/* --- Footer --- */
.foot { border-top: 1px solid var(--rule); background: var(--paper); }
.page-main + .foot, .prose + .foot { margin-top: 88px; }
.foot .wrap { padding-top: 48px; padding-bottom: 48px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.foot-grid { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 28px 48px; margin-bottom: 28px; }
.foot .brand { font-size: 16px; margin-bottom: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.foot a { color: var(--accent); }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot .brand, .foot .brand:hover { color: var(--ink); text-decoration: none; }
.foot-legal { padding-top: 20px; border-top: 1px solid var(--rule); }
.foot-legal p { margin: 0 0 6px; }
.foot-legal .copy { margin: 12px 0 0; color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
    @keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
    .hero-card { animation: fade-up .6s ease both; }
}

@media (max-width: 860px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards { grid-template-columns: 1fr; }
    .pill-links { display: none; }
}
@media (max-width: 600px) {
    body { font-size: 16px; }
    .wrap { padding: 0 16px; }
    .hero { padding-top: 72px; }
    .hero-card { padding: 22px 20px 24px; }
    .hero-card h1 { font-size: 2rem; }
    .hero-card .actions .btn { flex: 1 1 auto; }
    .tile h3 { min-height: 0; }
    .section { padding: 60px 0; }
    .figure > a { padding: 10px; border-radius: 14px; }
    .clip video { border-radius: 14px; }
    .tiles { grid-template-columns: 1fr; }
    .tile .num { font-size: 1.9em; }
    .panel { padding: 18px 16px 20px; }
    .page-head { padding: 88px 0 40px; }
    .page-main + .foot, .prose + .foot { margin-top: 60px; }
    .foot .wrap { padding-top: 36px; padding-bottom: 36px; }
}
