:root {
  --paper:#fff;
  --ink:#172237;
  --muted:#586477;
  --open:#234ed8;
  --open-soft:#d3ddff;
  --grace:#ffc34d;
  --line:#eaedf2;
  --danger:#ad2836;
  font-family:"Roboto Flex",system-ui,sans-serif;
  font-synthesis:none;
  color:var(--ink);
  background:var(--paper);
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

::selection {
  background:var(--ink);
  color:var(--paper);
}

a {
  color:inherit;
  text-decoration-thickness:1px;
  text-underline-offset:5px;
}

a:hover {
  text-decoration-thickness:2px;
}

a:focus-visible,summary:focus-visible {
  outline:3px solid currentColor;
  outline-offset:5px;
}

p {
  font-size:17px;
  line-height:1.6;
  margin:0 0 1em;
  max-width:65ch;
}

h1,h2,h3 {
  margin:0;
  text-wrap:balance;
}

h1 {
  font-size:clamp(3.4rem,6.5vw,6rem);
  font-weight:640;
  line-height:.98;
  letter-spacing:-.04em;
}

h2 {
  font-size:clamp(2rem,3.5vw,3.3rem);
  font-weight:640;
  line-height:1.07;
  letter-spacing:-.035em;
}

h3 {
  font-size:24px;
  font-weight:680;
  line-height:1.2;
  letter-spacing:-.02em;
}

.wrap {
  padding-inline:clamp(24px,6.25vw,100px);
  max-width:1600px;
  margin-inline:auto;
}

.icon {
  width:24px;
  height:24px;
  flex:none;
  vertical-align:middle;
}

.skip {
  position:absolute;
  top:8px;
  left:12px;
  background:white;
  padding:12px;
  transform:translateY(-180%);
  z-index:10;
}

.skip:focus {
  transform:translateY(0);
}

.site-header {
  min-height:100px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.brand {
  font-size:24px;
  font-weight:760;
  letter-spacing:-.035em;
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:7px;
  min-height:44px;
}

.brand-dot {
  width:6px;
  height:6px;
  background:currentColor;
  border-radius:50%;
  align-self:flex-end;
  margin-bottom:11px;
}

nav {
  display:flex;
  flex-wrap:wrap;
  gap:12px 28px;
}

nav a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  font-size:14px;
}

.hero {
  display:grid;
  grid-template-columns:1.12fr 1fr;
  gap:clamp(32px,5vw,80px);
  padding-top:44px;
  padding-bottom:72px;
}

.hero-copy {
  padding-top:20px;
}

.hero-copy>p {
  margin-top:28px;
  max-width:470px;
  font-size:18px;
}

.actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px 24px;
  margin-top:28px;
}

.button {
  background:var(--ink);
  color:var(--paper);
  min-height:56px;
  padding:16px 20px;
  display:inline-flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  font-weight:680;
  font-size:16px;
}

.button:hover {
  background:#22304a;
}

.button:focus-visible {
  outline:3px solid var(--grace);
  outline-offset:-6px;
}

.text-link {
  min-height:48px;
  display:inline-flex;
  align-items:center;
  gap:12px;
  font-size:15px;
}

.small,.hero-copy>.small {
  font-size:13px;
  color:var(--muted);
  margin-top:12px;
}

.hero-state {
  background:var(--open);
  color:white;
  padding:40px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:36px;
  min-height:540px;
}

.stage {
  position:relative;
  align-self:center;
  width:240px;
  max-width:100%;
}

.mascot {
  position:relative;
  display:block;
  width:100%;
  height:auto;
}

.state-signal {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:15px;
  color:var(--open-soft);
}

.state-title {
  font-weight:640;
  font-size:clamp(40px,4.5vw,64px);
  letter-spacing:-.035em;
  line-height:1.02;
  margin:16px 0 22px;
}

.state-caption {
  font-size:13px;
  color:var(--open-soft);
  margin:0;
}

.agents {
  padding-block:28px 36px;
  border-block:1px solid var(--line);
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:18px 44px;
}

.agents h2 {
  font-size:15px;
  font-weight:400;
  letter-spacing:0;
  color:var(--muted);
}

.agents ul {
  list-style:none;
  display:flex;
  flex-wrap:wrap;
  gap:16px 38px;
  margin:0;
  padding:0;
  font-size:24px;
  font-weight:650;
  letter-spacing:-.02em;
}

.agents p {
  flex-basis:100%;
  margin:0;
  font-size:14px;
  color:var(--muted);
}

.section {
  padding-block:92px;
}

.how,.modes,.privacy,.faq {
  display:grid;
  grid-template-columns:1fr 1.2fr;
  gap:64px;
}

.steps {
  list-style:none;
  counter-reset:step;
  padding:0;
  margin:0;
}

.steps li {
  counter-increment:step;
  display:flex;
  align-items:baseline;
  gap:24px;
  margin-bottom:36px;
}

.steps li:last-child {
  margin-bottom:0;
}

.steps li::before {
  content:counter(step);
  font-size:17px;
  font-variant-numeric:tabular-nums;
  flex:0 0 24px;
  color:var(--muted);
}

.steps h3 {
  margin-bottom:12px;
}

.steps p {
  color:var(--muted);
  margin-bottom:8px;
}

.steps a {
  display:inline-flex;
  align-items:center;
  gap:12px;
  min-height:44px;
  font-size:15px;
}

.grace {
  background:var(--grace);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:48px;
  padding-block:56px;
}

.grace h2 {
  margin-bottom:24px;
}

.grace p {
  max-width:520px;
  margin:0;
}

.grace img {
  width:240px;
  height:auto;
  flex-shrink:0;
}

.modes>div>p {
  margin-top:24px;
  color:var(--muted);
}

.mode-list article {
  margin-bottom:36px;
}

.mode-list h3 {
  display:flex;
  align-items:baseline;
  gap:18px;
  margin-bottom:12px;
}

.mode-list h3 span {
  font-size:13px;
  font-weight:400;
  color:var(--muted);
  letter-spacing:0;
}

.mode-list article p {
  margin:0;
}

.mode-list>.small {
  margin-bottom:0;
}

.privacy {
  border-top:1px solid var(--line);
}

.privacy .lead {
  font-size:24px;
  line-height:1.4;
  letter-spacing:-.015em;
}

.privacy a {
  display:inline-flex;
  align-items:center;
  gap:16px;
  min-height:44px;
}

.pricing {
  padding-top:28px;
  padding-bottom:72px;
}

.pricing h2 {
  font-size:32px;
  margin-bottom:16px;
}

.pricing p {
  color:var(--muted);
  margin:0;
}

.faq {
  border-top:1px solid var(--line);
}

details {
  border-bottom:1px solid var(--line);
}

summary {
  padding:22px 32px 22px 0;
  cursor:pointer;
  font-size:18px;
  font-weight:600;
  position:relative;
  list-style:none;
}

summary::-webkit-details-marker {
  display:none;
}

summary::after {
  content:"";
  position:absolute;
  right:4px;
  top:27px;
  width:9px;
  height:9px;
  border-right:1.7px solid;
  border-bottom:1.7px solid;
  transform:rotate(45deg);
}

details[open] summary::after {
  transform:rotate(225deg);
  top:32px;
}

summary:hover {
  text-decoration:underline;
  text-underline-offset:5px;
}

details p {
  padding:0 24px 20px 0;
  color:var(--muted);
  font-size:16px;
  margin:0;
}

.faq-list details:first-child summary {
  padding-top:4px;
}

.faq-list details:first-child summary::after {
  top:9px;
}

.faq-list details:first-child[open] summary::after {
  top:14px;
}

.floor {
  background:var(--ink);
  color:white;
  min-height:132px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding-block:32px;
  text-decoration:none;
  font-size:26px;
  font-weight:680;
  letter-spacing:-.02em;
}

.floor small {
  display:block;
  font-size:14px;
  font-weight:400;
  color:#c2ccdc;
  margin-top:8px;
  letter-spacing:0;
}

.floor .icon {
  width:32px;
  height:32px;
  transition:transform 180ms ease-out;
}

.floor:hover .icon {
  transform:translateX(4px);
}

.floor:focus-visible {
  outline:3px solid var(--grace);
  outline-offset:-8px;
}

.site-footer {
  padding-block:32px 40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.studio-link {
  display:inline-flex;
  align-items:center;
  gap:12px;
  font-size:14px;
  min-height:44px;
}

.site-footer nav {
  gap:12px 24px;
}

.document {
  padding-block:68px 100px;
  min-height:calc(100vh - 240px);
}

.document h1 {
  font-size:clamp(42px,6vw,72px);
  max-width:850px;
  margin-bottom:28px;
}

.document>.intro {
  font-size:21px;
  max-width:680px;
}

.document-content {
  max-width:760px;
}

.document-content section {
  margin-top:56px;
}

.document h2 {
  font-size:30px;
  margin-bottom:18px;
}

.document h3 {
  font-size:22px;
  margin:28px 0 14px;
}

.document p {
  max-width:65ch;
}

.document .text-link {
  margin-top:12px;
}

.platform-nav {
  display:flex;
  flex-wrap:wrap;
  gap:24px;
  margin-block:24px;
}

.platform-nav a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
}

pre {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  background:var(--ink);
  color:white;
  padding:22px 24px;
  font-size:15px;
  line-height:1.6;
  margin:20px 0;
}

code {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
}

p code {
  font-size:.9em;
}

.todo {
  font-size:14px;
  color:var(--muted);
}

.pair-code {
  display:flex;
  flex-wrap:wrap;
  gap:0 .6em;
  font-size:clamp(30px,5vw,54px);
  letter-spacing:.08em;
  font-weight:650;
  font-variant-numeric:tabular-nums;
  margin-block:40px;
  line-height:1.5;
}

.pair-code[hidden],[hidden] {
  display:none!important;
}

.pair-error {
  color:var(--danger);
  font-weight:600;
}

.instruction-list {
  padding-left:24px;
  margin:28px 0;
}

.instruction-list li {
  padding-left:8px;
  margin-bottom:18px;
  font-size:18px;
  line-height:1.6;
}

.draft {
  display:inline-block;
  font-size:14px;
  font-weight:700;
  letter-spacing:.06em;
  margin:4px 0 24px;
}

.document-footer {
  border-top:1px solid var(--line);
}

@media(min-width:1601px) {
  .hero-state {
    min-height:580px;
  }
}

@media(max-width:900px) {
  .hero {
    grid-template-columns:1.15fr 1fr;
    gap:28px;
  }
  .hero-state {
    padding:28px;
    min-height:510px;
  }
  .hero h1 {
    font-size:clamp(48px,6.6vw,60px);
  }
  .hero-copy>p {
    font-size:16px;
  }
  .how,.modes,.privacy,.faq {
    gap:36px;
    grid-template-columns:1fr 1.3fr;
  }
  .section {
    padding-block:64px;
  }
  .grace {
    gap:28px;
  }
  .site-footer {
    align-items:flex-start;
    flex-direction:column;
    gap:8px;
  }
}

@media(max-width:640px) {
  .site-header {
    min-height:102px;
    align-items:flex-start;
    justify-content:center;
    flex-direction:column;
    gap:0;
    padding-block:14px;
  }
  .brand {
    font-size:23px;
  }
  .site-header nav {
    gap:28px;
  }
  .site-header nav a {
    min-height:40px;
  }
  .hero {
    grid-template-columns:1fr;
    padding-top:32px;
    padding-bottom:40px;
    gap:32px;
  }
  .hero-copy {
    padding-top:0;
  }
  .hero h1 {
    font-size:clamp(52px,12vw,72px);
  }
  .hero-copy>p {
    font-size:17px;
  }
  .hero-state {
    margin-inline:calc(-1 * clamp(24px,6.25vw,100px));
    padding:32px 24px;
    min-height:0;
    gap:24px;
    display:grid;
    grid-template-columns:1fr;
  }
  .stage {
    justify-self:end;
    width:240px;
  }
  .state-title {
    font-size:48px;
  }
  .agents {
    gap:16px;
    padding-block:24px;
  }
  .agents h2 {
    flex-basis:100%;
  }
  .agents ul {
    gap:12px 24px;
    font-size:20px;
  }
  .section {
    padding-block:56px;
  }
  .how,.modes,.privacy,.faq {
    grid-template-columns:1fr;
    gap:32px;
  }
  .steps li {
    gap:16px;
    margin-bottom:32px;
  }
  .steps h3 {
    font-size:22px;
  }
  .grace {
    flex-direction:column;
    align-items:flex-start;
    padding-block:40px;
    gap:24px;
  }
  .grace img {
    align-self:flex-end;
  }
  .mode-list article:last-of-type {
    margin-bottom:24px;
  }
  .modes>div>p {
    margin-top:18px;
    margin-bottom:0;
  }
  .privacy .lead {
    font-size:22px;
  }
  .pricing {
    padding-top:0;
  }
  .pricing h2 {
    font-size:30px;
  }
  .floor {
    font-size:23px;
    min-height:128px;
  }
  .site-footer nav {
    gap:8px 24px;
  }
  .document {
    padding-block:40px 64px;
  }
  .document>.intro {
    font-size:19px;
  }
  .document-content section {
    margin-top:40px;
  }
  .document h2 {
    font-size:27px;
  }
  .pair-code {
    font-size:30px;
    gap:.5em;
  }
  .document h1 {
    font-size:44px;
  }
}

/* ---------- Motion ----------
   One authored moment: the hero panel opens from the mascot, the mascot jumps with a burst, then the panel plays
   the product loop (working → grace countdown → blocked → working). Sections rise in once as they scroll into view.
   Everything is static under prefers-reduced-motion, and nothing is hidden without JS (.js gates the hidden states). */

.hero-state {
  transition:background-color 700ms cubic-bezier(.2,.7,.2,1), color 700ms cubic-bezier(.2,.7,.2,1);
}
.hero-state[data-state="grace"] { background:var(--grace); color:var(--ink); }
.hero-state[data-state="blocked"] { background:var(--ink); }
.hero-state[data-state="grace"] .state-signal,.hero-state[data-state="grace"] .state-caption { color:#5a4100; }
.hero-state .state-signal,.hero-state .state-caption { transition:color 700ms; }

.js .hero-state { animation:panel-open 900ms cubic-bezier(.2,.7,.2,1) 120ms both; }
@keyframes panel-open {
  from { clip-path:circle(0% at 50% 28%); }
  to { clip-path:circle(150% at 50% 28%); }
}

.js .mascot { animation:jump 820ms cubic-bezier(.3,.7,.3,1) 520ms both, breathe 3.6s ease-in-out 1400ms infinite; transform-origin:50% 100%; }
.hero-state.rejump .mascot { animation:jump 820ms cubic-bezier(.3,.7,.3,1) both, breathe 3.6s ease-in-out 900ms infinite; }
@keyframes jump {
  0% { transform:translateY(12px) scale(1.04,.92); opacity:0; }
  22% { transform:translateY(8px) scale(1.06,.9); opacity:1; }
  55% { transform:translateY(-34px) scale(.97,1.04); }
  80% { transform:translateY(0) scale(1.05,.94); }
  100% { transform:translateY(0) scale(1); }
}
@keyframes breathe {
  0%,100% { transform:translateY(0) scale(1); }
  50% { transform:translateY(-3px) scale(1.01,.99); }
}

.rings,.burst { position:absolute; left:50%; top:48%; width:0; height:0; }
.rings i,.burst i {
  position:absolute; left:-110px; top:-110px; width:220px; height:220px; border-radius:50%;
  border:2px solid rgba(255,255,255,.55); opacity:0;
}
.js .hero-state[data-state="working"] .rings i { animation:beat 2.6s cubic-bezier(.2,.7,.2,1) infinite; }
.js .hero-state[data-state="working"] .rings i:nth-child(2) { animation-delay:.24s; }
.js .hero-state[data-state="working"] .rings i:nth-child(3) { animation-delay:1.3s; }
.js .hero-state[data-state="grace"] .rings i { border-color:rgba(23,34,55,.35); animation:beat 4.8s ease-out infinite; }
@keyframes beat {
  0% { transform:scale(.55); opacity:0; }
  8% { opacity:.7; }
  70%,100% { transform:scale(1.35); opacity:0; }
}
.burst i { border-width:3px; border-color:rgba(255,255,255,.8); }
.js .hero-state .burst i { animation:burst 1s cubic-bezier(.1,.7,.2,1) 700ms both; }
.js .hero-state.rejump .burst i { animation:burst 1s cubic-bezier(.1,.7,.2,1) 180ms both; }
.js .hero-state .burst i:nth-child(2) { animation-delay:820ms; }
.js .hero-state .burst i:nth-child(3) { animation-delay:940ms; }
.js .hero-state.rejump .burst i:nth-child(2) { animation-delay:300ms; }
.js .hero-state.rejump .burst i:nth-child(3) { animation-delay:420ms; }
@keyframes burst {
  0% { transform:scale(.5); opacity:0; }
  15% { opacity:.9; }
  100% { transform:scale(1.9); opacity:0; }
}

.state-text [data-title],.state-text [data-signal],.state-text [data-caption] { transition:opacity 220ms ease, transform 220ms ease; }
.state-text.swap [data-title],.state-text.swap [data-signal],.state-text.swap [data-caption] { opacity:0; transform:translateY(6px); }

.js .hero-copy>* { animation:rise 700ms cubic-bezier(.2,.7,.2,1) both; }
.js .hero-copy>*:nth-child(2) { animation-delay:90ms; }
.js .hero-copy>*:nth-child(3) { animation-delay:180ms; }
.js .hero-copy>*:nth-child(4) { animation-delay:240ms; }
@keyframes rise {
  from { opacity:0; transform:translateY(18px); }
  to { opacity:1; transform:none; }
}

.js [data-reveal] { opacity:0; transform:translateY(24px); transition:opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1); }
.js [data-reveal].in { opacity:1; transform:none; }
.js .steps li { opacity:0; transform:translateY(16px); transition:opacity 600ms cubic-bezier(.2,.7,.2,1), transform 600ms cubic-bezier(.2,.7,.2,1); }
.js .in .steps li { opacity:1; transform:none; }
.js .in .steps li:nth-child(2) { transition-delay:120ms; }
.js .in .steps li:nth-child(3) { transition-delay:240ms; }

.button .icon:last-child,.text-link .icon { transition:transform 180ms ease-out; }
.button:hover .icon:last-child,.text-link:hover .icon { transform:translateX(4px); }
.button:active { transform:scale(.98); }

/* Scroll-driven effects (browsers with scroll timelines; elsewhere the page simply stays still).
   A reading-progress line, the hero drifting apart as it leaves, step numbers filling a line as they pass,
   the grace mascot climbing in, and section headings sliding in from the left. */
.progress { display:none; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress {
      display:block; position:fixed; inset:0 0 auto; height:3px; z-index:50;
      background:var(--open); transform-origin:0 50%;
      animation:progress linear both; animation-timeline:scroll(root);
    }
    @keyframes progress { from { transform:scaleX(0); } to { transform:scaleX(1); } }

    .hero-state .stage { animation:drift linear both; animation-timeline:view(); animation-range:exit 0% exit 100%; }
    @keyframes drift { to { transform:translateY(-80px) scale(.92); } }
    .hero-copy { animation:recede linear both; animation-timeline:view(); animation-range:exit 10% exit 90%; }
    @keyframes recede { to { opacity:.15; transform:translateY(-48px); } }

    .steps { position:relative; }
    .steps::before {
      content:""; position:absolute; left:6px; top:6px; bottom:6px; width:2px; background:var(--open);
      transform-origin:50% 0; animation:fill linear both; animation-timeline:view(); animation-range:entry 60% cover 70%;
    }
    @keyframes fill { from { transform:scaleY(0); } to { transform:scaleY(1); } }
    .steps li::before { background:var(--paper); position:relative; }

    .grace img { animation:climb linear both; animation-timeline:view(); animation-range:entry 0% cover 45%; }
    @keyframes climb { from { transform:translateY(90px) rotate(-8deg); opacity:0; } to { transform:none; opacity:1; } }

    main section h2 { animation:slide linear both; animation-timeline:view(); animation-range:entry 10% cover 30%; }
    @keyframes slide { from { transform:translateX(-36px); opacity:0; } to { transform:none; opacity:1; } }
  }
}

@media(prefers-reduced-motion:reduce) {
  .js [data-reveal],.js .steps li { opacity:1!important; transform:none!important; }
  .js .hero-state,.js .mascot { clip-path:none!important; }
  *,*::before,*::after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important;
  }
  .floor:hover .icon {
    transform:none;
  }
}


/* Scrollbar: a floating cobalt pill on paper (WebKit/Blink); Firefox gets the same colours natively. */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: #fff; }
::-webkit-scrollbar-thumb {
  background: #234ed8; border-radius: 999px;
  border: 4px solid #fff; /* inset from the edge so it floats */
  min-height: 48px;
}
::-webkit-scrollbar-thumb:hover { background: #172237; }
::-webkit-scrollbar-thumb:active { background: #ffc34d; }
::-webkit-scrollbar-corner { background: #fff; }
@supports (-moz-appearance: none) {
  html { scrollbar-color: #234ed8 #fff; scrollbar-width: thin; }
}
