/* PILA website. Apple meets editorial: a serif that answers the wordmark's bulk, a technical sans for everything
   that works, a mono for what comes from a key. One material (glass), PILA's own skies, and no boxes or rules:
   the page runs from the room's light, through white, into midnight, without a seam. */

@font-face { font-family: 'Newsreader'; src: url('/assets/fonts/newsreader.woff2') format('woff2-variations'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist.woff2') format('woff2-variations'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/assets/fonts/geist-mono.woff2') format('woff2-variations'); font-weight: 100 900; font-display: swap; }

:root {
  /* the type session's pick, for now: Newsreader (serif), Geist (technical sans), Geist Mono. Noto Serif, where a
     reader has it, carries chosen names in scripts Newsreader lacks */
  --serif: 'Newsreader', 'Noto Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ink: #121318; --muted: rgba(18, 19, 24, .58); --faint: rgba(18, 19, 24, .4);
  --page: #ffffff;
  /* the room's light, set as the rooms change */
  --sky0: #fe9e98; --sky1: #f9871c; --skyN: #f9871c;
  /* midnight, the rare dark hour, where the agents' side lives */
  --night0: #3f2049; --night1: #1d0b17; --on-night: #f7eef6; --on-night-muted: rgba(247, 238, 246, .62);
  /* afterglow (hisge-dinbin's sky), the evening between the page and midnight */
  --glow-a: #bd487f; --glow-b: color-mix(in oklch, #c32c5a 55%, #3f2049);
  /* the room's own shades, for everything over the rooms: a deep and a pale version of its hue, never black or white */
  --hue: 40; --chroma: .12;
  --room-dark: oklch(.27 min(.085, calc(var(--chroma) * .7)) var(--hue));
  --room-light: oklch(.97 min(.035, calc(var(--chroma) * .3)) var(--hue));
  --ease: cubic-bezier(.23, 1, .32, 1);          /* strong ease-out */
  --ease-io: cubic-bezier(.77, 0, .175, 1);      /* for things already on screen that move */
  --sheet-ease: cubic-bezier(.32, .72, 0, 1);    /* the iOS sheet */
}
/* the room's colours are registered so they can travel: tint, inks and glass change together when the room does */
@property --sky0 { syntax: '<color>'; inherits: true; initial-value: #fe9e98; }
@property --sky1 { syntax: '<color>'; inherits: true; initial-value: #f9871c; }
@property --skyN { syntax: '<color>'; inherits: true; initial-value: #f9871c; }
@property --hue { syntax: '<number>'; inherits: true; initial-value: 40; }
@property --chroma { syntax: '<number>'; inherits: true; initial-value: .12; }
:root { transition: --sky0 .45s var(--ease-io), --sky1 .45s var(--ease-io), --skyN .45s var(--ease-io), --hue .45s var(--ease-io), --chroma .45s var(--ease-io); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: .9em; font-weight: 430; letter-spacing: -.01em; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 410; font-optical-sizing: auto; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.link { display: inline-flex; align-items: center; gap: .35em; font-weight: 500; }
.link::after { content: '→'; transition: transform .25s var(--ease); }
@media (hover: hover) and (pointer: fine) { .link:hover::after { transform: translateX(3px); } }

/* ── glass: the one material. Clear over a light room, smoked over a dark one ── */
.glass { position: relative; isolation: isolate;
  background: color-mix(in oklch, var(--room-light) 34%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 0 0 .5px rgba(255, 255, 255, .45), 0 10px 30px -12px rgba(0, 0, 0, .28); }
/* the lit rim, brighter at the top-left as if from the sky */
.glass::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: -1;
  background: linear-gradient(140deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .08) 38%, rgba(255, 255, 255, .02) 62%, rgba(255, 255, 255, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.dark-room .hero .glass { background: color-mix(in oklch, var(--room-dark) 34%, transparent); }

/* ── the bar at the top: nothing but the wordmark and two controls ── */
.top { position: absolute; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 clamp(16px, 3vw, 32px);
  color: var(--ink); transition: color .5s var(--ease), background-color .3s, box-shadow .3s; }


/* ── once the page scrolls, a slimmer nav arrives: a chunky piece of glass with only the essentials ── */
.pill-nav { position: fixed; top: 14px; left: 50%; z-index: 35; width: min(600px, calc(100% - 24px)); height: 60px; padding: 0 8px 0 24px;
  display: flex; align-items: center; justify-content: space-between; border-radius: 999px; color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .26));
  -webkit-backdrop-filter: blur(18px) saturate(1.9) brightness(1.04); backdrop-filter: blur(18px) saturate(1.9) brightness(1.04);
  /* a thick lit rim: bright along the top, a little shade along the bottom, and lifted off the page */
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .9), inset 0 -1.5px 2px rgba(0, 0, 0, .06), inset 0 0 0 .5px rgba(255, 255, 255, .55),
    inset 0 -10px 18px -12px rgba(255, 255, 255, .55), 0 1px 2px rgba(0, 0, 0, .06), 0 14px 34px -14px rgba(0, 0, 0, .28);
  opacity: 0; visibility: hidden; transform: translate(-50%, calc(-100% - 20px)) scale(.96);
  transition: opacity .2s var(--ease), transform .26s var(--ease), visibility 0s linear .26s, color .3s, background .3s; }
.pill-nav.on { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); transition: opacity .35s var(--sheet-ease), transform .55s var(--sheet-ease), visibility 0s, color .3s, background .3s; }
/* the specular glint, like light caught on the top of a glass bead */
.pill-nav::before { content: ''; position: absolute; inset: 2px 8% auto 8%; height: 38%; border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); opacity: .45; }
.pill-nav .brand .wm { height: 17px; }
.pill-nav .right { display: flex; align-items: center; gap: 6px; }
.pill-nav .right a { display: grid; place-items: center; height: 44px; padding: 0 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; transition: background-color .2s, transform .16s var(--ease); }
.pill-nav .right a:active { transform: scale(.96); }
.pill-nav .x { width: 44px; padding: 0; }
.pill-nav .x svg { width: 15px; height: 15px; fill: currentColor; }
@media (hover: hover) and (pointer: fine) { .pill-nav .right a:hover { background: rgba(255, 255, 255, .45); } }
.in-night .pill-nav, .agents-page .pill-nav { color: var(--on-night); background: linear-gradient(180deg, rgba(70, 40, 80, .5), rgba(30, 12, 26, .4));
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .28), inset 0 -1.5px 2px rgba(0, 0, 0, .3), inset 0 0 0 .5px rgba(255, 255, 255, .16), 0 14px 34px -14px rgba(0, 0, 0, .6); }
.in-night .pill-nav::before, .agents-page .pill-nav::before { opacity: .18; }
@media (hover: hover) and (pointer: fine) { .in-night .pill-nav .right a:hover, .agents-page .pill-nav .right a:hover { background: rgba(255, 255, 255, .1); } }
@media (prefers-reduced-motion: reduce) { .pill-nav, .pill-nav.on { transform: translate(-50%, 0); } }
@media (max-width: 600px) { .pill-nav { height: 54px; padding-left: 18px; } }
.agents-page .top { color: var(--on-night); }
.brand .wm { height: 16px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 500; }
.nav > a { opacity: .78; transition: opacity .2s; }
.nav > a:hover, .nav > a[aria-current="page"] { opacity: 1; }
/* a segmented control, as iOS draws it */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 9px; background: rgba(118, 118, 128, .18); font-size: 13px; font-weight: 500; }
.seg a, .seg button { position: relative; z-index: 1; padding: 5px 14px; border-radius: 7px; text-align: center; white-space: nowrap; opacity: .72; transition: opacity .2s; }
.seg .thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; border-radius: 7px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); transition: transform .22s var(--ease); }
.seg.has-thumb [aria-pressed="true"] { background: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .seg .thumb { transition: none; } }
.seg [aria-current="true"], .seg [aria-pressed="true"] { opacity: 1; color: var(--ink); background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }
.agents-page .seg, .in-night .seg { background: rgba(255, 255, 255, .14); }
@media (max-width: 600px) { .nav { gap: 14px; } }

/* ── the rooms ── */
.hero { position: relative; height: 100svh; min-height: 580px; overflow: hidden; background: var(--sky0); color: var(--room-dark); transition: color .5s var(--ease); }
.dark-room .hero { color: var(--room-light); }
.hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* between rooms the view blinks, as the teaser cuts: a veil of the sky closes quickly and opens once the new room is drawn */
.veil { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: linear-gradient(var(--sky0), var(--skyN)); transition: opacity .32s var(--ease); }
.veil.on { opacity: 1; transition-duration: .14s; }
/* the room's floor runs on into the page: no seam where the scene ends */
/* the room's floor runs on into the page: an eased fade, so there is no line where the scene ends */
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 180px; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in oklab, var(--skyN) 0%, transparent) 0px, color-mix(in oklab, var(--skyN) 4.3%, transparent) 22.5px, color-mix(in oklab, var(--skyN) 15.6%, transparent) 45px, color-mix(in oklab, var(--skyN) 31.6%, transparent) 67.5px, color-mix(in oklab, var(--skyN) 50%, transparent) 90px, color-mix(in oklab, var(--skyN) 68.4%, transparent) 112.5px, color-mix(in oklab, var(--skyN) 84.4%, transparent) 135px, color-mix(in oklab, var(--skyN) 95.7%, transparent) 157.5px, color-mix(in oklab, var(--skyN) 100%, transparent) 180px); }
.hero-text { position: absolute; left: clamp(20px, 4vw, 56px); bottom: clamp(28px, 6vh, 64px); z-index: 2; max-width: 620px; pointer-events: none; }
.hero-text h2 { font-size: clamp(40px, 5.2vw, 76px); line-height: 1; font-weight: 400; letter-spacing: -.01em; }
.hero-text p { margin-top: 18px; max-width: 30em; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.45; }

.toolbar button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; transition: background-color .2s, transform .16s var(--ease); }
@media (hover: hover) and (pointer: fine) { .toolbar button:hover { background: color-mix(in oklch, currentColor 12%, transparent); } }
.toolbar button:active { transform: scale(.94); }
.toolbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toolbar .room-name { width: auto; min-width: 96px; height: 40px; padding: 0 8px; border-radius: 999px; font-size: 14px; font-weight: 500; letter-spacing: -.01em; overflow: hidden; }
.room-name span { display: inline-block; }
/* the carousel's timer: a hairline along the dock's curved top edge, filling as the room's time runs */
.toolbar .timer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: currentColor; stroke: none; }
.timer .track { opacity: .12; }
.timer .fill { opacity: 1; }
/* the fill is revealed along the edge by a clip (composited), not by redrawing the stroke every frame */
.toolbar .timer.reveal { clip-path: inset(0 100% 0 0); transition: opacity .3s var(--ease); }
/* the dock's own lit rim steps back, so the timer is the one line along its top */
#dock.glass::before { opacity: .3; }
.tb-box.paused .timer.reveal { opacity: .4; }
#sound .on { display: none; } #sound[aria-pressed="true"] .on { display: block; } #sound[aria-pressed="true"] .off { display: none; }
/* the room's three agents, for keyboards and screen readers: out of sight until focused */
.cast { position: absolute; left: 50%; top: 84px; z-index: 3; display: flex; gap: 8px; transform: translateX(-50%); }
.cast button { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cast button:focus-visible { width: auto; height: auto; clip-path: none; padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 500; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
@media (max-width: 720px) {
  .hero-text { right: 20px; bottom: 96px; }

}

/* ── the papers, as a sheet of glass beside the agent ── */
.papers-sheet { position: fixed; top: 76px; right: 16px; max-height: calc(100svh - 168px); display: flex; z-index: 40; width: min(500px, calc(100vw - 32px)); border-radius: 30px; overflow: hidden;
  background: rgba(255, 255, 255, .66); -webkit-backdrop-filter: blur(28px) saturate(1.8); backdrop-filter: blur(28px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 0 0 .5px rgba(255, 255, 255, .6), 0 24px 70px -20px rgba(0, 0, 0, .35);
  color: var(--ink); visibility: hidden; transform: translateX(calc(100% + 24px)); transition: transform .34s var(--sheet-ease), visibility 0s linear .34s; }
.papers-sheet.open { visibility: visible; transform: none; transition: transform .5s var(--sheet-ease), visibility 0s; }
.papers-sheet .in { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 26px 26px 30px; }
.ps-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(118, 118, 128, .16); transition: background-color .2s, transform .16s var(--ease); }
@media (hover: hover) and (pointer: fine) { .ps-close:hover { background: rgba(118, 118, 128, .26); } }
.ps-close:active { transform: scale(.92); }
.ps-close svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ps-head { display: flex; gap: 16px; align-items: center; padding-right: 40px; }
.ps-head img { width: 56px; height: 56px; border-radius: 15px; flex: none; }
.ps-head h2 { font-size: 34px; line-height: 1; letter-spacing: -.01em; }
.ps-head p { margin-top: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-now { margin-top: 18px; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.ps-now .dot { width: 7px; height: 7px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .18); }
.ps-papers { display: block; margin-top: 18px; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 18px 40px -22px rgba(0, 0, 0, .45); transition: transform .25s var(--ease); }
.ps-papers:active { transform: scale(.985); }
.ps-papers img { width: 100%; height: auto; }
.ps-note { margin-top: 16px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.ps-note b { color: var(--ink); font-weight: 600; }
.ps-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 16px; font-size: 14.5px; }
@media (max-width: 720px) {
  .papers-sheet { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 86svh; border-radius: 28px 28px 0 0; transform: translateY(100%); z-index: 41; }
  .papers-sheet .in { max-height: 86svh; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .papers-sheet, .papers-sheet.open { transition: opacity .2s, visibility 0s; transform: none; opacity: 0; } .papers-sheet.open { opacity: 1; } }

/* ── the page: the room's light, then white, then midnight ── */
.page { position: relative; background:
  linear-gradient(180deg, var(--skyN) 0px, color-mix(in oklab, var(--skyN) 95.7%, var(--page)) 137.5px, color-mix(in oklab, var(--skyN) 84.4%, var(--page)) 275px, color-mix(in oklab, var(--skyN) 68.4%, var(--page)) 412.5px, color-mix(in oklab, var(--skyN) 50%, var(--page)) 550px, color-mix(in oklab, var(--skyN) 31.6%, var(--page)) 687.5px, color-mix(in oklab, var(--skyN) 15.6%, var(--page)) 825px, color-mix(in oklab, var(--skyN) 4.3%, var(--page)) 962.5px, var(--page) 1100px) top / 100% 1100px no-repeat, var(--page); }
.col { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.statement { padding-top: clamp(120px, 18vh, 200px); font-family: var(--serif); font-size: clamp(30px, 3.7vw, 54px); line-height: 1.12; font-weight: 400; letter-spacing: -.01em; max-width: 21em; }
.trio { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 4vw, 64px); margin: clamp(80px, 11vh, 128px) 0 0; }
.trio dt { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 26px; font-weight: 410; letter-spacing: -.01em; }
.trio dt img { width: 36px; height: 36px; border-radius: 10px; }
.trio dd { margin: 10px 0 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.trio dd .link { margin-top: 12px; color: var(--ink); font-size: 15px; }
/* the directory's mark: three agents, overlapping a little, a small crowd */
.trio .few { display: flex; }
.trio .few img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px var(--page); }
.trio .few img + img { margin-left: -12px; }
/* the birth, live and as wide as the page. Drawn on white: multiplied onto the page, its white disappears, so the
   canvas has no visible edge and the agents have room above and below to move without being cut */
.born { margin: clamp(120px, 18vh, 220px) 0 0; }
.born canvas, .born video { display: block; width: 100%; height: clamp(560px, 82vh, 860px); mix-blend-mode: multiply; touch-action: pan-y; }
.born video { object-fit: contain; }
@media (max-width: 600px) { .born canvas, .born video { height: 640px; } }
.principles { margin-top: clamp(140px, 20vh, 240px); display: grid; gap: clamp(44px, 6vh, 64px); }
.principles article { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: baseline; }
.principles h3 { font-size: clamp(28px, 3vw, 40px); line-height: 1.08; }
.principles p { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 34em; }
@media (max-width: 1080px) { .trio { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .trio { grid-template-columns: 1fr; } .principles article { grid-template-columns: 1fr; gap: 10px; } }

/* midnight: the agents' side. The page darkens into it; nothing marks where */
/* the light goes as it does at the end of a day: through the afterglow hour's own pinks into midnight */
/* the light goes as it does at the end of a day: through the afterglow hour's own pinks into midnight. Each step is
   eased, and all of them mix in OKLab, so nothing turns muddy on the way; a whisper of grain keeps the long fade
   from banding */
.night { margin-top: clamp(48px, 7vh, 88px); padding-top: 440px; color: var(--on-night);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
  linear-gradient(180deg, var(--page) 0px, color-mix(in oklab, var(--page) 95.7%, var(--glow-a)) 31.25px, color-mix(in oklab, var(--page) 84.4%, var(--glow-a)) 62.5px, color-mix(in oklab, var(--page) 68.4%, var(--glow-a)) 93.75px, color-mix(in oklab, var(--page) 50%, var(--glow-a)) 125px, color-mix(in oklab, var(--page) 31.6%, var(--glow-a)) 156.25px, color-mix(in oklab, var(--page) 15.6%, var(--glow-a)) 187.5px, color-mix(in oklab, var(--page) 4.3%, var(--glow-a)) 218.75px, var(--glow-a) 250px, color-mix(in oklab, var(--glow-a) 95.7%, var(--glow-b)) 260px, color-mix(in oklab, var(--glow-a) 84.4%, var(--glow-b)) 270px, color-mix(in oklab, var(--glow-a) 68.4%, var(--glow-b)) 280px, color-mix(in oklab, var(--glow-a) 50%, var(--glow-b)) 290px, color-mix(in oklab, var(--glow-a) 31.6%, var(--glow-b)) 300px, color-mix(in oklab, var(--glow-a) 15.6%, var(--glow-b)) 310px, color-mix(in oklab, var(--glow-a) 4.3%, var(--glow-b)) 320px, var(--glow-b) 330px, color-mix(in oklab, var(--glow-b) 95.7%, var(--night0)) 343.75px, color-mix(in oklab, var(--glow-b) 84.4%, var(--night0)) 357.5px, color-mix(in oklab, var(--glow-b) 68.4%, var(--night0)) 371.25px, color-mix(in oklab, var(--glow-b) 50%, var(--night0)) 385px, color-mix(in oklab, var(--glow-b) 31.6%, var(--night0)) 398.75px, color-mix(in oklab, var(--glow-b) 15.6%, var(--night0)) 412.5px, color-mix(in oklab, var(--glow-b) 4.3%, var(--night0)) 426.25px, var(--night0) 440px, var(--night1) 100%); }
.night h2 { font-size: clamp(36px, 4.6vw, 64px); line-height: 1; }
.night .lead { margin-top: 18px; max-width: 34em; font-size: 17px; color: var(--on-night-muted); }
.files { margin: 44px 0 0; padding: 0; list-style: none; font: 14px/1.5 var(--mono); }
.files li { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; padding: 9px 0; }
.files a { color: #fff; }
.files a:hover { text-decoration: underline; text-underline-offset: .2em; }
.files span { color: var(--on-night-muted); }
.prompt { display: flex; align-items: center; gap: 16px; margin-top: 40px; padding: 8px 8px 8px 20px; border-radius: 18px; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .08); }
.prompt .p-label { flex: none; font-size: 13px; color: var(--on-night-muted); }
.prompt code { flex: 1; font-size: 13.5px; line-height: 1.5; color: #fff; }
.button { min-width: 84px; display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 500; transition: transform .16s var(--ease), opacity .2s; }
.button:active { transform: scale(.96); }
.night .aside { margin-top: 20px; font-size: 14px; color: var(--on-night-muted); }
.night .aside a { color: #fff; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 120px 0 48px; font-size: 13px; color: var(--on-night-muted); }
.foot a { color: var(--on-night); }
@media (max-width: 720px) { .files li { grid-template-columns: 1fr; gap: 0; padding: 8px 0; } .prompt { flex-wrap: wrap; } }

/* ── directory, agent and agents pages ── */
.plain { --glow0: #94b4fe; --glow1: #c87bf9; }
.plain .wash { background: linear-gradient(180deg, color-mix(in oklab, var(--glow1) 36%, var(--page)) 0px, color-mix(in oklab, color-mix(in oklab, var(--glow1) 36%, var(--page)) 95.7%, var(--page)) 80px, color-mix(in oklab, color-mix(in oklab, var(--glow1) 36%, var(--page)) 84.4%, var(--page)) 160px, color-mix(in oklab, color-mix(in oklab, var(--glow1) 36%, var(--page)) 68.4%, var(--page)) 240px, color-mix(in oklab, color-mix(in oklab, var(--glow1) 36%, var(--page)) 50%, var(--page)) 320px, color-mix(in oklab, color-mix(in oklab, var(--glow1) 36%, var(--page)) 31.6%, var(--page)) 400px, color-mix(in oklab, color-mix(in oklab, var(--glow1) 36%, var(--page)) 15.6%, var(--page)) 480px, color-mix(in oklab, color-mix(in oklab, var(--glow1) 36%, var(--page)) 4.3%, var(--page)) 560px, var(--page) 640px) top / 100% 640px no-repeat, var(--page); min-height: 100svh; }
.plain main { padding-top: 140px; padding-bottom: 96px; }
.plain h1 { font-size: clamp(44px, 6vw, 84px); line-height: 1; font-weight: 400; letter-spacing: -.01em; }
.plain .lede { margin-top: 20px; max-width: 36em; font-size: 18px; line-height: 1.5; color: var(--muted); }
.find { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 64px 0 36px; }
.search { position: relative; flex: 0 1 300px; }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); fill: none; stroke: var(--faint); stroke-width: 2; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 33px; border: 0; border-radius: 10px; background: rgba(118, 118, 128, .12); font: 15px var(--sans); color: var(--ink); outline: none; }
.search input:focus { box-shadow: 0 0 0 3px rgba(0, 122, 255, .3); }
.hours { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.count { margin-left: auto; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 44px 28px; margin: 0; padding: 0; list-style: none; }
.agents-grid a { display: block; }
.agents-grid img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 22%; transition: transform .35s var(--ease); }
@media (hover: hover) and (pointer: fine) { .agents-grid a:hover img { transform: translateY(-4px); } }
.agents-grid .c-chosen { display: block; margin-top: 14px; font-family: var(--serif); font-size: 22px; line-height: 1.1; font-weight: 410; letter-spacing: -.01em; }
.agents-grid .c-name { display: block; margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.agents-grid .c-purpose { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.agents-grid [hidden] { display: none; }
.after { margin-top: 72px; font-size: 14px; color: var(--muted); }
.after a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(0, 0, 0, .2); text-underline-offset: .2em; }

.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 40px; }
.agent-head { display: flex; gap: 32px; align-items: center; }
.agent-head img { width: 132px; height: 132px; border-radius: 30px; flex: none; }
.agent-head p { margin-top: 12px; font-size: 16px; color: var(--muted); }
.agent-head .mono { color: var(--ink); }
.figure-papers { margin: 64px 0 0; max-width: 880px; }
.figure-papers img { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 30px 70px -40px rgba(0, 0, 0, .5); }
.figure-papers figcaption { margin-top: 14px; font-size: 13px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; margin: 64px 0 0; max-width: 880px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-size: 17px; }
.facts dd small { display: block; margin-top: 2px; font: 11.5px var(--mono); color: var(--faint); }
.agent-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 56px; font-size: 15px; }
.agent-links .button { background: var(--ink); color: #fff; }
@media (max-width: 720px) { .agent-head { flex-direction: column; align-items: flex-start; gap: 20px; } .facts { grid-template-columns: 1fr; } }

body.agents-page { background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"), linear-gradient(180deg, var(--night0) 0%, color-mix(in oklab, var(--night0) 95.7%, var(--night1)) 12.5%, color-mix(in oklab, var(--night0) 84.4%, var(--night1)) 25%, color-mix(in oklab, var(--night0) 68.4%, var(--night1)) 37.5%, color-mix(in oklab, var(--night0) 50%, var(--night1)) 50%, color-mix(in oklab, var(--night0) 31.6%, var(--night1)) 62.5%, color-mix(in oklab, var(--night0) 15.6%, var(--night1)) 75%, color-mix(in oklab, var(--night0) 4.3%, var(--night1)) 87.5%, var(--night1) 100%) fixed; color: var(--on-night); }
.editor { width: min(940px, calc(100% - 32px)); margin: 0 auto; padding: 120px 0 80px; font: 14px/1.75 var(--mono); }
.editor .tab { margin: 48px 0 12px 66px; font-size: 12.5px; color: var(--on-night-muted); }
.editor .tab:first-child { margin-top: 0; }
.code { list-style: none; margin: 0; padding: 0; }
.code li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 18px; }
.code .ln { text-align: right; color: rgba(247, 238, 246, .26); user-select: none; }
.code .tx { white-space: pre-wrap; overflow-wrap: anywhere; color: rgba(247, 238, 246, .8); }
.code b { color: #fff; font-weight: 600; }
.code i { font-style: normal; color: var(--on-night-muted); }
.code a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: .2em; }
.agents-page .foot { width: min(940px, calc(100% - 32px)); margin: 0 auto; }
.plain .foot { color: var(--muted); padding-top: 96px; }
.plain .foot a { color: var(--ink); }

/* ── the hero's one toolbar: the directory, who the page is for, and the rooms, all of one height, in one glass ── */
/* two pieces of glass side by side, one height: the site on the left, the rooms on the right */
.toolbar { position: absolute; left: 50%; bottom: clamp(24px, 5vh, 48px); z-index: 3; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.tb-box { position: relative; display: flex; align-items: center; gap: 2px; height: 48px; padding: 4px; border-radius: 999px; }
.toolbar .tb-link { display: grid; place-items: center; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: background-color .2s, transform .16s var(--ease); }
.toolbar .tb-link:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .toolbar .tb-link:hover { background: color-mix(in oklch, currentColor 12%, transparent); } }
/* the segmented control at the toolbar's height, in capsules, as glass toolbars draw them */
.hero .seg { height: 40px; padding: 3px; border-radius: 999px; font-size: 14px; background: color-mix(in oklch, currentColor 10%, transparent); }
.hero .seg a { display: grid; place-items: center; padding: 0 16px; border-radius: 999px; }
.hero .seg [aria-current="true"] { background: var(--room-light); color: var(--room-dark); box-shadow: 0 2px 6px rgba(0, 0, 0, .1); }

/* the big wordmark, and on a phone the menu button beside it */
.hero-top { position: absolute; inset: 0 0 auto 0; z-index: 3; display: flex; align-items: center; justify-content: center; height: clamp(72px, 9vh, 96px); padding: 0 clamp(20px, 4vw, 56px); pointer-events: none; }
.hero-top > * { pointer-events: auto; }
.hero-mark { position: relative; display: block; color: inherit; }
/* the logo developing as the page loads: the birth engine's wave, recorded as a strip of frames and played here as a
   mask filled with the room's own ink. It covers the wordmark's frame exactly; the wordmark takes over at the end */
.wm-wave { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: currentColor;
  -webkit-mask: url('/assets/logo-wave.png') 0 0 / 100% calc(var(--frames) * 100%) no-repeat; mask: url('/assets/logo-wave.png') 0 0 / 100% calc(var(--frames) * 100%) no-repeat; }
/* one frame at a time: the step count is written into the page as a plain number (steps() takes no formula) */
.waving .wm-wave { opacity: 1; animation: wave var(--wave-dur) var(--wave-steps) forwards; }
.waving .hero-mark .wm, .wave-wait .hero-mark .wm { opacity: 0; }
.hero-mark .wm { transition: opacity .2s var(--ease); }
@keyframes wave { from { -webkit-mask-position: 0 0; mask-position: 0 0; } to { -webkit-mask-position: 0 100%; mask-position: 0 100%; } }
.hero-mark .wm { height: clamp(20px, 1.9vw, 28px); width: auto; display: block; }
.menu-btn { display: none; position: absolute; right: 16px; width: 44px; height: 44px; border-radius: 50%; place-items: center; }
.menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* the two lines cross into a close mark while the menu is open */
.menu-btn path { transform-box: fill-box; transform-origin: center; transition: transform .2s var(--ease); }
.menu-btn[aria-expanded="true"] path:first-child { transform: translateY(3px) rotate(45deg); }
.menu-btn[aria-expanded="true"] path:last-child { transform: translateY(-3px) rotate(-45deg); }
.menu { position: absolute; z-index: 4; top: 76px; right: 16px; width: min(280px, calc(100% - 32px)); padding: 8px; border-radius: 24px; display: grid; gap: 6px;
  transform-origin: top right; transition: opacity .18s var(--ease), transform .18s var(--ease); }
.menu[hidden] { display: grid; opacity: 0; transform: scale(.96) translateY(-4px); pointer-events: none; visibility: hidden; }
.menu > a { display: flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 16px; font-size: 16px; font-weight: 500; }
.menu .seg { display: grid; width: 100%; }
@media (prefers-reduced-motion: reduce) { .menu, .menu[hidden] { transform: none; } }

/* the headline and its line, by layout */
.page-headline { display: none; }
@media (min-width: 721px) {
  /* A, masthead: the words at the top right, across from the wordmark */
  .layout-a .hero-text { left: auto; right: clamp(20px, 4vw, 56px); top: clamp(22px, 3.2vw, 40px); bottom: auto; max-width: 440px; text-align: right; }
  .layout-a .hero-text h2 { font-size: clamp(30px, 3vw, 44px); }
  .layout-a .hero-text p { margin-left: auto; }
  /* B, caption: the words low on the left, the toolbar low on the right */
  .layout-b .toolbar { left: auto; right: clamp(20px, 4vw, 56px); transform: none; }
  /* C, the clean room: no words over the room; the headline opens the page instead */
  .layout-c .hero-text { display: none; }
  .layout-c .page-headline { display: block; padding-top: clamp(120px, 18vh, 200px); font-size: clamp(48px, 6.4vw, 96px); line-height: 1; letter-spacing: -.01em; }
  .layout-c .statement { padding-top: 36px; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.3; max-width: 30em; color: rgba(18, 19, 24, .72); }
}
@media (min-width: 721px) and (max-width: 1240px) {
  /* where the line would run into the toolbar, the words sit above it */
  .layout-b .hero-text { bottom: calc(clamp(24px, 5vh, 48px) + 72px); }
}
@media (max-width: 720px) {
  .toolbar .wide { display: none; }
  .toolbar { bottom: 20px; }
  .menu-btn { display: grid; }
  .hero-mark .wm { height: 20px; }
  .hero-text { left: 20px; right: 20px; bottom: 92px; }
  .layout-c .hero-text { display: none; }
  .layout-c .page-headline { display: block; padding-top: 96px; font-size: 40px; line-height: 1.02; }
  .layout-c .statement { padding-top: 24px; }
}
/* the layout picker, for comparing only */
.layout-pick { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 50; display: flex; gap: 2px; padding: 4px; border-radius: 999px; color: var(--ink); }
.layout-pick[hidden] { display: none; }
.layout-pick button { width: 36px; height: 36px; border-radius: 50%; font-size: 13px; font-weight: 600; }
.layout-pick button[aria-pressed="true"] { background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }

/* ── arrival: once the first room is drawn, the wordmark glides down from the top and the two pieces of glass rise
   from the bottom, a beat apart, on the iOS sheet curve. Only transform and opacity move. ── */
.toolbar .tb-box { transition: opacity .7s var(--sheet-ease), transform .8s var(--sheet-ease); }

.home:not(.ready) .toolbar .tb-box { opacity: 0; transform: translateY(28px) scale(.96); }
.home.ready .toolbar .tb-box:nth-child(2) { transition-delay: .07s; }
@media (prefers-reduced-motion: reduce) {
  .toolbar .tb-box { transition: opacity .3s ease; }
  .home:not(.ready) .toolbar .tb-box { transform: none; }
}

@media (max-width: 600px) {
  .agents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
  .agents-grid .c-chosen { font-size: 19px; }
  .hours { margin: 0 -24px; padding: 0 24px; -webkit-mask: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 40px), transparent); mask: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 40px), transparent); }
}
/* while the birth piece loads, its band shows the wordmark in the sky's colours, where the scene itself begins */
.born { position: relative; }
.born-wait { position: absolute; left: 50%; top: 50%; width: min(34vw, 470px); transform: translate(-50%, -50%); transition: opacity .4s var(--ease); pointer-events: none;
  color: #8fb6f2; }
.born-wait .wm { width: 100%; height: auto; display: block; }
.born.live .born-wait { opacity: 0; }
@media (max-width: 600px) { .born-wait { width: 70vw; } }
