/* Leoku v2 · Inner Edge, dark. One stylesheet, one self-hosted serif, no third parties. */

@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/newsreader.woff2') format('woff2');
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette (identity pack, exact) */
  --charcoal: #121619;
  --light: #ECEEEF;
  --gunmetal: #465158;
  --ember: #CC5500;

  /* Text is always Light at strength, never gunmetal (gunmetal on charcoal is 2.2:1). */
  --ink: var(--light);
  --ink-2: rgb(236 238 239 / .76);
  --ink-3: rgb(236 238 239 / .58);
  --line: rgb(70 81 88 / .45);
  --line-2: rgb(70 81 88 / .8);
  --surface: rgb(70 81 88 / .22);
  --surface-2: rgb(70 81 88 / .3);

  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 4.5vw, 4rem);
  --max: 1240px;
  --bar: 4rem;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--charcoal);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body.sheet-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
button, textarea, input { font: inherit; color: inherit; }
p, figure { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
::selection { background: rgb(204 85 0 / .45); color: var(--light); }
:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; border-radius: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 60; background: var(--light); color: var(--charcoal); padding: .6rem 1rem; border-radius: 6px; }
.skip:focus { left: 1rem; top: 1rem; }

/* Type */
.display { font-family: var(--serif); font-weight: 400; font-optical-sizing: auto; font-size: clamp(1.9rem, 1rem + 2.9vw, 3.4rem); line-height: 1.1; letter-spacing: -0.012em; text-wrap: balance; }
.fine { font-size: .8125rem; line-height: 1.5; color: var(--ink-3); }
.fine a { color: var(--ink-2); }
.nobr { white-space: nowrap; }

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--bar);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color .5s var(--ease), border-color .5s var(--ease);
}
.bar.scrolled { background: rgb(18 22 25 / .82); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
/* The brand slot has the official horizontal lock-up's proportions at 192px wide (viewBox 1540.9x480, with
   clear space): the dimensional mark sits where the lock-up's symbol sits (centre 15.57% across, 50% down,
   diamond 20.77% of the width; the signature render's diamond fills 79.4% of its image), the standalone
   wordmark where the lock-up's wordmark sits. Both are pack files, untouched. */
.brand { position: relative; display: block; width: 192px; height: 59.8px; margin-left: -12px; }
.brand-sym { position: absolute; left: 4.75px; top: 4.9px; width: 50.3px; height: 50.3px; display: block; }
.brand-sym img { width: 100%; height: 100%; }
.brand-word { position: absolute; left: 54.96px; top: 11.62px; width: 133.2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(100svh, 1000px);
  padding: calc(var(--bar) + 2rem) var(--gutter) 4rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.net { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.hero-shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 52% 46% at 50% 50%, rgb(18 22 25 / .92), rgb(18 22 25 / .55) 55%, rgb(18 22 25 / 0) 100%),
    linear-gradient(180deg, rgb(18 22 25 / .6), rgb(18 22 25 / 0) 25%, rgb(18 22 25 / 0) 75%, var(--charcoal) 100%);
}
.hero-copy { position: relative; z-index: 2; width: 100%; max-width: 46rem; display: flex; flex-direction: column; align-items: center; }
h1 {
  font-family: var(--serif); font-weight: 400; font-optical-sizing: auto;
  font-size: clamp(2.5rem, 1.1rem + 5.2vw, 5.25rem); line-height: 1.02; letter-spacing: -0.018em; text-wrap: balance;
}
.sub {
  margin-top: 1.25rem; max-width: 34rem; color: var(--ink-2);
  font-size: clamp(1.0625rem, .9rem + .7vw, 1.3125rem); line-height: 1.5; text-wrap: balance;
}

/* The talk box: say it here, the conversation opens */
.talk {
  width: 100%; max-width: 40rem; margin-top: clamp(1.75rem, 4vh, 2.75rem); text-align: left;
  background: rgb(26 31 35 / .9); border: 1px solid var(--line-2); border-radius: 20px;
  padding: 1rem 1rem .75rem 1.25rem;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / .7);
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.talk:focus-within { border-color: rgb(236 238 239 / .35); box-shadow: 0 30px 60px -30px rgb(0 0 0 / .7), 0 0 0 4px rgb(204 85 0 / .14); }
.talk.live { max-width: 46rem; padding-top: .85rem; }
.talk-head { display: flex; align-items: center; gap: .6rem; padding: 0 0 .75rem; border-bottom: 1px solid var(--line); margin-bottom: .25rem; }
.talk-mark { width: 40px; height: 40px; margin-left: -6px; flex: none; display: block; }
.talk-mark img { width: 100%; height: 100%; }
.talk-title { display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.talk-title strong { font-weight: 500; font-size: .9375rem; line-height: 1.2; }
.talk-title span { font-size: .8125rem; color: var(--ink-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk.working .talk-title span { color: var(--ink-2); }
.talk-reset { margin-left: auto; border: 0; background: transparent; color: var(--ink-3); font-size: .8125rem; cursor: pointer; padding: .4rem .2rem; transition: color .3s var(--ease); }
.talk-reset:hover { color: var(--ink); }
.talk .log { display: flex; flex-direction: column; gap: 1rem; max-height: min(60vh, 600px); overflow-y: auto; overscroll-behavior: contain; padding: .75rem .25rem 1rem 0; margin-bottom: .35rem; -webkit-overflow-scrolling: touch; }
.talk.live .ask-box { border-top: 1px solid var(--line); padding-top: .5rem; }
.talk textarea {
  display: block; width: 100%; min-height: 2.5rem; max-height: 9rem; resize: none; border: 0; outline: 0; background: transparent;
  padding: .35rem 0; font-size: 1.0625rem; line-height: 1.5; color: var(--ink); overflow-y: hidden;
}
.talk textarea::placeholder { color: var(--ink-3); }
.talk-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .5rem; }
.talk-who { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--ink-3); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); flex: none; }
.dot.live { animation: breathe 1.5s var(--ease-io) infinite; }
.hero .fine { margin-top: .9rem; }
.offline { margin-top: .9rem; color: var(--ink-2); max-width: 32rem; }
.offline a { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 3rem;
  background: var(--light); color: var(--charcoal); text-decoration: none; font-weight: 500; border: 0; cursor: pointer;
  padding: .8rem 1.5rem; border-radius: 999px; transition: box-shadow .4s var(--ease), transform .3s var(--ease), opacity .3s var(--ease);
}
.btn:hover { box-shadow: 0 0 0 4px rgb(204 85 0 / .3); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn-sm { min-height: 2.5rem; padding: .55rem 1.15rem; font-size: .9375rem; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { box-shadow: none; border-color: var(--ink-3); }
.text-link {
  color: var(--ink); text-decoration: none; padding-bottom: 3px;
  background: linear-gradient(var(--ember), var(--ember)) 0 100% / 0 1px no-repeat, linear-gradient(var(--line-2), var(--line-2)) 0 100% / 100% 1px no-repeat;
  transition: background-size .6s var(--ease);
}
.text-link:hover { background-size: 100% 1px, 100% 1px; }

/* Composer in the sheet: a line, not a box */
.ask { position: relative; display: flex; align-items: flex-end; gap: .25rem; }
.ask::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-2); }
.ask::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--ember), rgb(204 85 0 / .25));
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .8s var(--ease);
}
.ask:focus-within::after { transform: scaleX(1); }
.ask textarea {
  flex: 1; min-height: 2.75rem; max-height: 9rem; resize: none; border: 0; outline: 0; background: transparent;
  padding: .65rem 0; font-size: 1.0625rem; line-height: 1.5; color: var(--ink); overflow-y: hidden;
}
.ask textarea::placeholder { color: var(--ink-3); }
.send {
  flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer; transition: color .3s var(--ease), box-shadow .3s var(--ease);
}
.send svg { transition: transform .3s var(--ease); }
.send:hover { color: var(--ember); }
.send:hover svg { transform: translateX(3px); }
.send:disabled { opacity: .35; cursor: default; }
.send-solid { background: var(--light); color: var(--charcoal); width: 2.5rem; height: 2.5rem; }
.send-solid:hover { color: var(--charcoal); box-shadow: 0 0 0 4px rgb(204 85 0 / .3); }

/* Staging-only replay control (app.js adds it inside the sheet on preview addresses) */
.replay {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: .25rem; padding: .5rem .9rem; align-self: flex-start;
  border: 1px solid rgb(204 85 0 / .5); border-radius: 999px; background: transparent; color: var(--ink-2);
  font-size: .8125rem; cursor: pointer; transition: color .3s var(--ease), border-color .3s var(--ease);
}
.replay:hover { color: var(--ink); border-color: var(--ember); }
.replay:disabled { opacity: .45; cursor: default; }

/* ---------- Beats ---------- */
.beat { padding: clamp(4.5rem, 12vh, 8rem) 0; }
.beat .rule { height: 1px; margin: 1.5rem 0 1.75rem; max-width: 7rem; background: linear-gradient(90deg, var(--ember), rgb(204 85 0 / .15)); transform-origin: 0 50%; transition: transform 1.6s .2s var(--ease); }
.js .beat .rule { transform: scaleX(0); }
.js .beat .in .rule { transform: scaleX(1); }
.beat p { color: var(--ink-2); max-width: 34rem; font-size: clamp(1.0625rem, 1rem + .35vw, 1.1875rem); line-height: 1.6; }
.beat p + p { margin-top: 1rem; }
.beat .display { max-width: 24ch; }
.example { color: var(--ink-3); font-size: 1rem !important; }
.how-inner, .who-inner, .name-inner { display: grid; gap: 2.5rem; align-items: center; }
.name-mark { width: min(220px, 60vw); margin-left: -10px; }
.name-mark img { width: 100%; aspect-ratio: 1; }

/* Motion graphics: inline SVG, in palette, looping, nothing loaded. */
.motion { width: 100%; max-width: 560px; }
.motion svg { width: 100%; height: auto; display: block; overflow: visible; }
.map svg { overflow: hidden; }
.motion text { font-family: var(--sans); font-size: 13px; fill: var(--ink-3); letter-spacing: .01em; }

/* Beat 1, three acts on an 18s loop. Act 1 (0-33%): data sources come together into one view.
   Act 2 (33-67%): a slow process is drawn, then automated. Act 3 (67-95%): the leverage that creates. */
.g-curve, .g-chain, .g-short, .g-arc { stroke: rgb(236 238 239 / .42); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.g-arc { stroke: rgb(204 85 0 / .75); }
.g-src circle, .g-end { fill: var(--charcoal); stroke: var(--ink-2); stroke-width: 1.5; }
.g-end { stroke: var(--ember); }
.g-hub rect { stroke: var(--ink-2); stroke-width: 1.5; }
.g-step { stroke: var(--ink-2); stroke-width: 1.5; fill: var(--charcoal); transform-box: fill-box; transform-origin: center; }
.g-ember { fill: var(--ember); }
.g-stream, .g-crawl, .g-fast { fill: var(--ember); opacity: 0; }
.g-src, .g-hub, .g-steps, .g-slow, .g-auto, .g-end, .g-lev { opacity: 0; }
.js .in .g-hub { animation: g-in-hub 18s var(--ease) infinite; }
.js .in .g-s1 { animation: g-in-a 18s var(--ease) infinite; } .js .in .g-s2 { animation: g-in-b 18s var(--ease) infinite; }
.js .in .g-s3 { animation: g-in-c 18s var(--ease) infinite; } .js .in .g-s4 { animation: g-in-d 18s var(--ease) infinite; }
.js .in .g-s5 { animation: g-in-e 18s var(--ease) infinite; }
.js .in .g-c1 { animation: g-draw-a 18s var(--ease) infinite; } .js .in .g-c2 { animation: g-draw-b 18s var(--ease) infinite; }
.js .in .g-c3 { animation: g-draw-c 18s var(--ease) infinite; } .js .in .g-c4 { animation: g-draw-d 18s var(--ease) infinite; }
.js .in .g-c5 { animation: g-draw-e 18s var(--ease) infinite; }
.js .in .g-stream { animation: g-stream 18s linear infinite; }
.js .in .g-chain { animation: g-chain 18s var(--ease) infinite; }
.js .in .g-steps { animation: g-in-steps 18s var(--ease) infinite; }
.js .in .g-gone { animation: g-gone 18s var(--ease) infinite; }
.js .in .g-last { animation: g-last 18s var(--ease) infinite; }
.js .in .g-short { animation: g-short 18s var(--ease) infinite; }
.js .in .g-slow { animation: g-slow 18s var(--ease) infinite; }
.js .in .g-auto { animation: g-auto 18s var(--ease) infinite; }
.js .in .g-crawl { animation: g-crawl 18s linear infinite; }
.js .in .g-fast { animation: g-fast 18s linear infinite; }
.js .in .g-arc { animation: g-arc 18s var(--ease) infinite; }
.js .in .g-end { animation: g-endin 18s var(--ease) infinite; }
.js .in .g-lev { animation: g-lev 18s var(--ease) infinite; }
@keyframes g-in-hub { 0%, 2% { opacity: 0; } 5%, 95% { opacity: 1; } 99%, 100% { opacity: 0; } }
@keyframes g-in-a { 0%, 4% { opacity: 0; transform: translateX(-6px); } 7%, 95% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; } }
@keyframes g-in-b { 0%, 6% { opacity: 0; transform: translateX(-6px); } 9%, 95% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; } }
@keyframes g-in-c { 0%, 8% { opacity: 0; transform: translateX(-6px); } 11%, 95% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; } }
@keyframes g-in-d { 0%, 10% { opacity: 0; transform: translateX(-6px); } 13%, 95% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; } }
@keyframes g-in-e { 0%, 12% { opacity: 0; transform: translateX(-6px); } 15%, 95% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; } }
@keyframes g-draw-a { 0%, 8% { stroke-dashoffset: 1; opacity: 1; } 14%, 95% { stroke-dashoffset: 0; opacity: 1; } 99%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes g-draw-b { 0%, 10% { stroke-dashoffset: 1; opacity: 1; } 16%, 95% { stroke-dashoffset: 0; opacity: 1; } 99%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes g-draw-c { 0%, 12% { stroke-dashoffset: 1; opacity: 1; } 18%, 95% { stroke-dashoffset: 0; opacity: 1; } 99%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes g-draw-d { 0%, 14% { stroke-dashoffset: 1; opacity: 1; } 20%, 95% { stroke-dashoffset: 0; opacity: 1; } 99%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes g-draw-e { 0%, 16% { stroke-dashoffset: 1; opacity: 1; } 22%, 95% { stroke-dashoffset: 0; opacity: 1; } 99%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes g-stream { 0%, 19% { opacity: 0; } 21%, 32% { opacity: 1; } 33%, 100% { opacity: 0; } }
@keyframes g-chain { 0%, 34% { stroke-dashoffset: 1; opacity: 1; } 38%, 50% { stroke-dashoffset: 0; opacity: 1; } 54%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes g-in-steps { 0%, 34% { opacity: 0; } 37%, 95% { opacity: 1; } 99%, 100% { opacity: 0; } }
@keyframes g-gone { 0%, 51% { transform: scale(1); opacity: 1; } 55%, 100% { transform: scale(0); opacity: 0; } }
@keyframes g-last { 0%, 51% { transform: none; } 56%, 100% { transform: translateX(-168px); } }
@keyframes g-short { 0%, 52% { stroke-dashoffset: 1; opacity: 1; } 56%, 95% { stroke-dashoffset: 0; opacity: 1; } 99%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes g-slow { 0%, 35% { opacity: 0; } 38%, 51% { opacity: 1; } 54%, 100% { opacity: 0; } }
@keyframes g-auto { 0%, 54% { opacity: 0; } 57%, 95% { opacity: 1; } 99%, 100% { opacity: 0; } }
@keyframes g-crawl { 0%, 37% { opacity: 0; } 39%, 49% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes g-fast { 0%, 57% { opacity: 0; } 58%, 66% { opacity: 1; } 67%, 100% { opacity: 0; } }
@keyframes g-arc { 0%, 68% { stroke-dashoffset: 1; opacity: 1; } 78%, 95% { stroke-dashoffset: 0; opacity: 1; } 99%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes g-endin { 0%, 76% { opacity: 0; } 80%, 95% { opacity: 1; } 99%, 100% { opacity: 0; } }
@keyframes g-lev { 0%, 79% { opacity: 0; transform: translateY(4px); } 83%, 95% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; } }

/* Across Australia: the outline is drawn once, then Perth, Melbourne, Sydney and Brisbane light up. */
.m-fill { fill: rgb(70 81 88 / .16); opacity: 0; }
.m-line { stroke: rgb(236 238 239 / .55); stroke-width: 1.25; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.m-dot { fill: var(--ember); opacity: 0; transform-box: fill-box; transform-origin: center; }
.m-ring { stroke: var(--ember); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; }
.js .in .m-line { animation: m-draw 4s var(--ease) forwards; }
.js .in .m-fill { animation: fade 2s 2.5s var(--ease) forwards; }
.js .in .m-dot { animation: m-pop .9s var(--ease) forwards; }
.js .in .m-ring { animation: m-ring 3.6s var(--ease-io) infinite; }
.js .in .m-1 .m-dot { animation-delay: 3.4s; } .js .in .m-1 .m-ring { animation-delay: 3.4s; }
.js .in .m-2 .m-dot { animation-delay: 4.4s; } .js .in .m-2 .m-ring { animation-delay: 4.4s; }
.js .in .m-3 .m-dot { animation-delay: 5.2s; } .js .in .m-3 .m-ring { animation-delay: 5.2s; }
.js .in .m-4 .m-dot { animation-delay: 6s; } .js .in .m-4 .m-ring { animation-delay: 6s; }
@keyframes m-draw { to { stroke-dashoffset: 0; } }
@keyframes m-pop { 0% { opacity: 0; transform: scale(.2); } 60% { opacity: 1; transform: scale(1.25); } 100% { opacity: 1; transform: scale(1); } }
@keyframes m-ring { 0% { opacity: .6; transform: scale(1); } 100% { opacity: 0; transform: scale(5); } }

.start-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 2rem; }

/* ---------- Footer ---------- */
.foot { padding: 2.5rem 0 max(2rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--ink-3); font-size: .875rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- Scroll reveals ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease), transform 1.3s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Opening: the words rise while the network grows behind them ---------- */
.rise { animation: rise 1.1s var(--ease) both; }
h1.rise { animation-delay: .35s; }
.sub.rise { animation-delay: .55s; }
.talk.rise { animation-delay: .75s; }
.hero .fine.rise { animation-delay: .95s; }
.bar .rise { animation-delay: .9s; animation-duration: .9s; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes word-in { from { opacity: 0; filter: blur(3px); transform: translateY(2px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-in { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Sheets: the conversation and the Connect note ---------- */
.backdrop { position: fixed; inset: 0; z-index: 45; background: rgb(18 22 25 / .62); animation: fade .4s var(--ease) both; }
.sheet {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--charcoal); animation: sheet-up .55s var(--ease) both;
}
.sheet-head {
  display: flex; align-items: center; gap: .75rem; padding: max(.75rem, env(safe-area-inset-top)) var(--gutter) .75rem;
  border-bottom: 1px solid var(--line); flex: none;
}
.close {
  margin-left: auto; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; transition: background-color .3s var(--ease), color .3s var(--ease);
}
.close:hover { background: var(--surface); color: var(--ink); }

.msg-agent { font-size: 1.0625rem; line-height: 1.55; max-width: 36rem; color: var(--ink); text-wrap: pretty; }
.msg-agent p + p { margin-top: .7em; }
.msg-agent.streaming::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: .35em; border-radius: 50%;
  background: var(--ember); vertical-align: middle; animation: breathe 1.2s var(--ease-io) infinite;
}
.w { animation: word-in .45s var(--ease) both; }
.msg-user {
  align-self: flex-end; max-width: min(30rem, 86%); background: var(--surface); border-radius: 16px 16px 4px 16px;
  padding: .65rem .95rem; color: var(--ink); font-size: 1rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Working state: a line that only ever names a real step */
.status { display: flex; align-items: center; gap: .6rem; min-height: 1.5rem; font-size: .875rem; }
.shimmer {
  color: var(--ink-3);
  background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-3) 40%, var(--ink) 50%, var(--ink-3) 60%, var(--ink-3) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 2.2s linear infinite;
}

/* Research trail: each real step the agent takes on their business */
.trail { list-style: none; margin: 0; padding: .85rem 1rem; border-left: 1px solid var(--line-2); font-size: .875rem; max-width: 34rem; }
.trail-head { display: flex; justify-content: space-between; gap: 1rem; color: var(--ink-2); margin-bottom: .4rem; }
.trail-head span:last-child { flex: none; white-space: nowrap; color: var(--ink-3); }
.trail li { display: flex; align-items: baseline; gap: .6rem; color: var(--ink-3); padding: .12rem 0; animation: word-in .5s var(--ease) both; overflow-wrap: anywhere; }
.trail li.step::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); translate: 0 -2px; }
.trail li.now { color: var(--ink-2); }
.trail li.now::before { background: var(--ember); animation: breathe 1.4s var(--ease-io) infinite; }
.trail.done li.step::before { background: var(--ink-3); animation: none; }

/* Edge card: the conversation, resolved */
.card { position: relative; max-width: 34rem; padding: 1.5rem 0 .5rem; border-top: 1px solid var(--line-2); animation: card-in .9s var(--ease) both; }
.card::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%; background: linear-gradient(90deg, var(--ember), rgb(204 85 0 / 0) 85%); transform-origin: 0 50%; animation: draw 1.4s .2s var(--ease) both; }
.card h3 { font-size: .75rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 1.1rem 0 .3rem; }
.card h3:first-child { margin-top: 0; }
.card p { color: var(--ink); line-height: 1.5; }
.card .edge-line { font-size: 1.25rem; font-weight: 500; line-height: 1.35; }
.card-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.card > * { animation: word-in .7s var(--ease) both; }
.card > *:nth-child(2) { animation-delay: .15s; } .card > *:nth-child(3) { animation-delay: .25s; }
.card > *:nth-child(4) { animation-delay: .35s; } .card > *:nth-child(5) { animation-delay: .45s; }
.card > *:nth-child(6) { animation-delay: .55s; } .card > *:nth-child(7) { animation-delay: .65s; }


/* Connect form */
.connect-form { flex: 1; overflow-y: auto; padding: 1.5rem var(--gutter) max(1.5rem, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 1.25rem; max-width: 36rem; width: 100%; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .8125rem; letter-spacing: .04em; color: var(--ink-3); }
.field input, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; outline: 0;
  padding: .55rem 0; font-size: 1.0625rem; line-height: 1.5; color: var(--ink); border-radius: 0; resize: vertical;
  transition: border-color .3s var(--ease);
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--ember); }
.connect-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: .5rem; }

/* Legal placeholders and 404 */
.legal { min-height: 100svh; padding-top: 3rem; padding-bottom: 4rem; display: grid; align-content: start; gap: 1.5rem; max-width: 46rem; }
.legal-brand { display: block; width: 192px; margin-left: -12px; }
.legal p { color: var(--ink-2); max-width: 36rem; }
.nf { min-height: 100svh; display: grid; align-content: center; gap: 1.5rem; }
.nf-mark { width: 96px; margin-left: -16px; }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  .who-inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 5rem); }
  .name-inner { grid-template-columns: 340px minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
  .name-mark { width: 340px; margin-left: -18px; }
}
@media (min-width: 960px) {
  :root { --bar: 4.5rem; }
  .brand { margin-left: -14px; }
  .how-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 6rem); }
  .sheet { inset: 0 0 0 auto; width: min(560px, 100%); border-left: 1px solid var(--line); animation: sheet-in .5s var(--ease) both; }
}

@media (max-width: 600px) {
  .talk textarea { min-height: 4rem; }
  .talk.live textarea { min-height: 2.5rem; }
  .talk .log { max-height: 56svh; }
}

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .beat .rule { transform: none; }
  .shimmer { -webkit-text-fill-color: var(--ink-2); background: none; }
  /* The graphics rest in their finished state. */
  .g-curve, .g-short, .g-arc, .m-line { stroke-dashoffset: 0; animation: none !important; opacity: 1; }
  .g-src, .g-hub, .g-steps, .g-auto, .g-end, .g-lev, .m-dot, .m-fill { opacity: 1; animation: none !important; }
  .g-gone { transform: scale(0); opacity: 0; animation: none !important; }
  .g-last { transform: translateX(-168px); animation: none !important; }
  .g-chain, .g-slow, .g-stream, .g-crawl, .g-fast, .m-ring { opacity: 0; animation: none !important; }
}
