:root {
  --ground: #F4F3EF;
  --ink: #111111;
  --muted: #4A4A4A;
  --accent: #FF4D1A;
  --line: #DAD8D1;
  --max: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a:hover { color: var(--accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
h1, h2, .brand { font-family: "Space Grotesk", sans-serif; letter-spacing: -0.03em; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; text-decoration: none; }
.brand img { width: 30px; height: auto; }
.nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: none; font-size: 16px; color: var(--muted); }
.nav ul a:hover { color: var(--ink); }

/* Hero */
.hero { text-align: center; padding: 96px 0 120px; }
.hero .mark { width: 168px; height: auto; margin-bottom: 40px; }
.hero h1 { font-size: clamp(48px, 9vw, 96px); line-height: 1; margin: 0 0 20px; font-weight: 600; }
.hero p { font-size: clamp(18px, 2.4vw, 22px); color: var(--muted); margin: 0 0 40px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 28px; border-radius: 999px;
  background: var(--ink); color: var(--ground); text-decoration: none;
  font-weight: 500; font-size: 16px; border: 0; cursor: pointer;
}
.button:hover { background: var(--accent); color: var(--ink); }

/* Sections */
section { padding: 96px 0; border-top: 1px solid var(--line); }
.eyebrow { font-family: "Space Grotesk", sans-serif; font-size: 14px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 0 0 16px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; }
h2 { font-size: clamp(32px, 4.5vw, 48px); line-height: 1.05; margin: 0; font-weight: 600; }
.prose p { margin: 0 0 20px; max-width: 60ch; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: normal; color: var(--accent); font-weight: 500; }

.status { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; color: var(--muted); margin-top: 8px; }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* Signup */
.signup { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; max-width: 520px; }
.signup label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.signup input {
  flex: 1 1 260px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font: inherit; font-size: 16px; color: var(--ink);
}
.signup input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-note { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 15px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  .grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero { padding: 64px 0 88px; }
  section { padding: 72px 0; }
  .nav ul { gap: 16px; }
}

/* ───────── Motion (enabled by animations.js; off for reduced motion) ───────── */
header { position: sticky; top: 0; z-index: 10; transition: background-color .3s, box-shadow .3s, backdrop-filter .3s; }
header.scrolled { background: rgba(244, 243, 239, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.nav { transition: padding .3s; }
header.scrolled .nav { padding: 14px 0; }

/* Nav link underline slide */
.nav ul a { position: relative; }
.nav ul a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.nav ul a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Buttons: lift + shine sweep */
.button { position: relative; overflow: hidden; transition: background-color .25s, color .25s, transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.button::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-120%);
}
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(255, 77, 26, .7); }
.button:hover::before { transform: translateX(120%); transition: transform .7s ease; }
.button:active { transform: translateY(0) scale(.97); }

/* Brand mark wiggles on hover */
.brand img { transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.brand:hover img { transform: rotate(-12deg) scale(1.12); }

.motion .hero .mark {
  translate: var(--px, 0) var(--py, 0);
  transition: translate .6s cubic-bezier(.2,.8,.2,1);
  animation: mark-in 1.1s cubic-bezier(.2,1.4,.4,1) both, heartbeat 2.4s ease-in-out 1.1s infinite;
  filter: drop-shadow(0 18px 22px rgba(255, 77, 26, .18));
}
@keyframes mark-in {
  from { opacity: 0; scale: .4; rotate: -35deg; }
  to   { opacity: 1; scale: 1;  rotate: 0deg; }
}
@keyframes heartbeat {
  0%, 40%, 100% { transform: scale(1);    filter: drop-shadow(0 18px 22px rgba(255, 77, 26, .18)); }
  10%           { transform: scale(1.12); filter: drop-shadow(0 18px 34px rgba(255, 77, 26, .45)); }
  20%           { transform: scale(1.02); }
  30%           { transform: scale(1.08); filter: drop-shadow(0 18px 30px rgba(255, 77, 26, .35)); }
}

.motion .hero p, .motion .hero .button { animation: fade-up .9s cubic-bezier(.2,.8,.2,1) backwards; }
.motion .hero p { animation-delay: 1s; }
.motion .hero .button { animation-delay: .5s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Scroll reveals */
.motion .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1);
  transition-delay: var(--d, 0ms);
}
.motion .reveal.in { opacity: 1; transform: none; }
.motion h2.reveal { filter: blur(8px); transition-property: opacity, transform, filter; }
.motion h2.reveal.in { filter: none; }

/* "fake plastic dreams" shimmer */
.prose em {
  background: linear-gradient(90deg, var(--accent) 0%, #ffb08f 45%, var(--accent) 60%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.motion .prose em { animation: shimmer 4s linear infinite; }
@keyframes shimmer { to { background-position: -250% 0; } }

/* Status dot pulse */
.status .dot { position: relative; }
.motion .status .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* Input focus glow */
.signup input { transition: border-color .25s, box-shadow .25s; }
.signup input:focus { border-color: var(--accent); box-shadow: 0 0 0 6px rgba(255, 77, 26, .12); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Typing tagline */
.motion .hero p { animation: none; }
.hero p .ch { visibility: hidden; }
.hero p .ch.on { visibility: visible; }
.hero p .caret {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -0.18em;
  background: var(--accent); animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* Prototype card */
.proto-card { display: none; margin: 28px 0 0; max-width: 560px; border: 1px solid var(--line); border-radius: 18px; background: #fff; overflow: hidden; }
.js .proto-card { display: block; }
.proto-card canvas { display: block; width: 100%; height: 200px; }
.proto-card figcaption {
  display: flex; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line);
  font-family: "Space Grotesk", sans-serif; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.proto-score { color: var(--accent); }
.proto-score b { font-weight: 600; color: var(--ink); }
.proto-card { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; transition: border-color .25s, box-shadow .25s; }
.proto-card:hover { border-color: #c9c6bd; }
.proto-card:focus-visible, .proto-card.playing { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 77, 26, .12); }
.proto-picker { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); overflow-x: auto; cursor: default; }
.proto-picker button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 10px 6px;
  border: 1px solid transparent; border-radius: 12px; background: transparent; cursor: pointer;
  font-family: "Space Grotesk", sans-serif; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  transition: border-color .2s, background-color .2s, color .2s;
}
.proto-picker button canvas { width: 44px; height: 52px; }
.proto-picker button:hover { background: var(--ground); color: var(--ink); }
.proto-picker button[aria-checked="true"] { border-color: var(--accent); color: var(--ink); background: rgba(255, 77, 26, .06); }
.proto-picker button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.prose .proto-intro { margin: 16px 0 0; font-weight: 500; }
.proto-intro span { font-weight: 400; color: var(--muted); }
.proto-intro + .proto-card { margin-top: 14px; }
.proto-intro { display: none; }
.js .proto-intro { display: block; }

/* Signup states */
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup button:disabled { cursor: default; opacity: .85; transform: none; }
.signup-msg { font-size: 15px; margin: 12px 0 0 !important; min-height: 0; }
.signup-msg:empty { display: none; }
.signup-msg[data-state="ok"] { color: var(--ink); font-weight: 500; }
.signup-msg[data-state="ok"]::before { content: "✓ "; color: var(--accent); }
.signup-msg[data-state="error"] { color: #C2410C; }

/* ───────── Signup celebration: agent ID card ───────── */
.signup.folding { transition: opacity .35s ease, transform .35s cubic-bezier(.5,0,.75,0), filter .35s; opacity: 0; transform: scale(.92) translateY(10px); filter: blur(4px); }
.agent-stage { perspective: 1200px; margin-top: 8px; max-width: 440px; }
.agent-card {
  position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px 20px;
  background: radial-gradient(120% 140% at 100% 0%, #2a160f 0%, #111 55%);
  color: #F4F3EF; box-shadow: 0 30px 60px -25px rgba(17,17,17,.55), 0 0 0 1px rgba(255,255,255,.06) inset;
  font-family: "Space Grotesk", sans-serif; transform-style: preserve-3d;
}
.ac-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
}
.ac-top { position: relative; display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.ac-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.ac-brand img { width: 22px; animation: ac-beat 2.4s ease-in-out infinite; }
@keyframes ac-beat { 0%, 40%, 100% { transform: scale(1); } 10% { transform: scale(1.15); } 20% { transform: scale(1.03); } 30% { transform: scale(1.1); } }
.ac-tag { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(255,77,26,.5); border-radius: 999px; padding: 4px 10px; }
.agent-card p { margin: 0 !important; max-width: none !important; }
.ac-label { position: relative; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: rgba(244,243,239,.6); }
.ac-num { position: relative; font-size: clamp(56px, 12vw, 76px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin: 6px 0 10px !important; font-variant-numeric: tabular-nums; }
.ac-num span { color: var(--accent); }
.ac-email { position: relative; font-family: "Inter", sans-serif; font-size: 14px; color: rgba(244,243,239,.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-bottom { position: relative; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding-top: 14px; border-top: 1px dashed rgba(244,243,239,.18); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(244,243,239,.55); }
.ac-status { display: inline-flex; align-items: center; gap: 8px; color: #F4F3EF; }
.ac-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255,77,26,.6); animation: ac-ping 1.8s infinite; }
@keyframes ac-ping { 70% { box-shadow: 0 0 0 8px rgba(255,77,26,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,26,0); } }
.ac-stamp {
  position: absolute; right: 22px; top: 64px; padding: 6px 12px; border: 2.5px solid var(--accent); border-radius: 8px;
  color: var(--accent); font-weight: 700; font-size: 15px; line-height: 1.05; letter-spacing: .08em; text-transform: uppercase; text-align: center;
  transform: rotate(-12deg); opacity: .9; mix-blend-mode: screen;
}
.ac-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.14) 45%, rgba(255,176,143,.18) 50%, transparent 62%); transform: translateX(-110%); }
.ac-note { margin: 14px 0 0 !important; font-size: 15px; color: var(--muted); }

/* entrance choreography (motion only) */
.motion .agent-stage .agent-card { opacity: 0; transform: rotateX(75deg) translateY(60px) scale(.85); }
.motion .agent-stage.enter .agent-card { animation: ac-in 1s cubic-bezier(.2,1.25,.35,1) forwards; }
@keyframes ac-in {
  0%   { opacity: 0; transform: rotateX(75deg) translateY(60px) scale(.85); }
  55%  { opacity: 1; transform: rotateX(-8deg) translateY(-6px) scale(1.02); }
  100% { opacity: 1; transform: none; }
}
.motion .agent-stage .ac-stamp { opacity: 0; transform: rotate(-12deg) scale(2.4); }
.motion .agent-stage.stamped .ac-stamp { animation: ac-stamp .45s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes ac-stamp { 0% { opacity: 0; transform: rotate(-4deg) scale(2.4); } 100% { opacity: .9; transform: rotate(-12deg) scale(1); } }
.motion .agent-stage.stamped { animation: ac-thump .3s ease-out; }
@keyframes ac-thump { 0% { translate: 0 0; } 30% { translate: 0 3px; } 60% { translate: -2px -1px; } 100% { translate: 0 0; } }
.motion .agent-stage.enter .ac-shine { animation: ac-shine 4s ease-in-out .9s infinite; }
@keyframes ac-shine { 0% { transform: translateX(-110%); } 35%, 100% { transform: translateX(110%); } }
.motion .agent-stage .ac-note { opacity: 0; transform: translateY(8px); transition: opacity .6s .9s, transform .6s .9s; }
.motion .agent-stage.enter .ac-note { opacity: 1; transform: none; }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }
.ac-brand img { background: #F4F3EF; border-radius: 7px; padding: 3px; width: 26px; }
