:root {
  --bg: #f7e1c3;
  --fg: #0a0a0a;
  --muted: #7c5b3a;
  --accent: #d9651a;
  --border: #e9c9a0;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* nav */

.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -24px);
  z-index: 100;
  width: min(680px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: rgba(245, 240, 230, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease;
}

.nav.in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.nav-logo {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 22px;
  margin: 0 auto;
}

.nav-links a {
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--fg); }

.nav-links .is-current {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 20px;
  height: 38px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pill:hover { opacity: 0.85; }

.pill-cta {
  background: var(--fg);
  color: var(--bg);
  height: 34px;
  padding: 0 18px;
}

.pill-primary {
  background: var(--fg);
  color: var(--bg);
}

/* hero */

.hero {
  position: relative;
  overflow-x: clip;
}

/* the hero sits in normal flow; the hands flipbook plays as the band
   scrolls up through the viewport, no pinning */
.hero-pin {
  padding: 130px 0 0;
}

/* each shot brings its own words: the wide shot keeps the headline in
   flow above the band, the close shots overlay theirs on the viewport */
.stage-copy {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .4s ease-out, transform .5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}
.stage-copy.on { opacity: 1; transform: none; }
/* the second line follows the hands once the fingers have met */
.stage-copy-low {
  padding: 56px 24px 24px;
  text-align: center;
}
.stage-copy-low .hero-h2 { max-width: 820px; margin: 0 auto 12px; }
.stage-copy-low .hero-sub { margin: 0 auto; }

.hero-h2 {
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 0 24px;
  will-change: opacity;
}

.hero-h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--fg);
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 520px;
  margin: 0;
}

.hero-copy .pill-primary { margin-top: 6px; }

.flip { display: block; }

/* shots stack in the band; only the active one is visible, switched by
   scroll position in main.js, so the cut reads like a camera change */
.hands-band { position: relative; margin-top: 40px; width: 100%; }
.shot {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity .18s ease-out;
}
.shot.on { opacity: 1; }
.shot-wide { position: relative; width: 100%; height: auto; }
.shot-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
  z-index: 1;
}

/* hero margin fill: an old-mac log window on the left, an idling agent
   on the right, and a token burst where the hands meet */

.plate {
  background: var(--bg);
  border: 2px solid var(--fg);
  box-shadow: 4px 4px 0 var(--fg);
}

.log-plate {
  position: absolute;
  left: max(24px, calc(50% - 720px));
  top: 300px;
  width: 300px;
  z-index: 1;
}

.plate-bar {
  position: relative;
  height: 22px;
  border-bottom: 2px solid var(--fg);
  background: repeating-linear-gradient(to bottom, var(--fg) 0 2px, transparent 2px 4px);
}

.plate-close {
  position: absolute;
  left: 6px;
  top: 5px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--fg);
  background: var(--bg);
}

.plate-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 8px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.plate-body {
  margin: 0;
  padding: 10px 12px;
  min-height: calc(7 * 1.7em);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--fg);
  white-space: pre;
}

.log-cursor {
  animation: log-blink 1s steps(2) infinite;
}
@keyframes log-blink {
  50% { opacity: 0; }
}

.agent-plate {
  position: absolute;
  right: max(24px, calc(50% - 720px));
  top: 296px;
  width: 180px;
  text-align: center;
  z-index: 1;
}

.px { image-rendering: pixelated; }

.px-robot, .px-rocket { vertical-align: bottom; }

.px-robot { animation: bob 1.2s steps(2) infinite; }

.px-rocket {
  display: inline-block;
  margin-left: 12px;
  animation: launch 7s steps(7) infinite;
}

@keyframes bob {
  50% { transform: translateY(-4px); }
}

@keyframes launch {
  0%      { transform: translateY(0); opacity: 1; }
  20%     { transform: translateY(-140px); opacity: 0; }
  20.01%  { transform: translateY(0); opacity: 1; }
  100%    { transform: translateY(0); opacity: 1; }
}

.px-label {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg);
}

.px-status {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .log-plate, .agent-plate { display: none; }
}

.burst {
  position: absolute;
  left: 49.6%;
  top: 56%;
  width: 0;
  height: 0;
}

.burst img { position: absolute; opacity: 0; }

.burst .coin-1  { left: -100px; top: -30px; }
.burst .coin-2  { left: 20px;   top: -80px; }
.burst .coin-3  { left: -30px;  top: -140px; }
.burst .spark-1 { left: 60px;   top: -20px; }
.burst .spark-2 { left: -130px; top: -110px; }

.burst.on img { animation: rise 1.6s steps(6) infinite; }
.burst.on .coin-1  { animation-delay: 0s; }
.burst.on .coin-2  { animation-delay: .3s; }
.burst.on .coin-3  { animation-delay: .6s; }
.burst.on .spark-1 { animation-delay: .2s; }
.burst.on .spark-2 { animation-delay: .5s; }

@keyframes rise {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-60px); opacity: 0; }
}

.dither {
  width: 100%;
  height: 8px;
  margin: 8px 0 0;
  background-image: repeating-conic-gradient(rgba(10, 10, 10, .18) 0 25%, transparent 0 50%);
  background-size: 8px 8px;
}

/* sections */

.section {
  /* below-the-fold sections skip layout and paint until they approach the
     viewport, which keeps the scroll stage smooth on phones */
  content-visibility: auto;
  contain-intrinsic-size: 1px 520px;
  border-top: 1px solid var(--border);
  padding: 96px 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.in {
  opacity: 1;
  /* none, not translateY(0): any transform value makes the section a
     stacking context and the flipbooks inside stop blending with the page */
  transform: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 40px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.step-n {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.step p {
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  margin: 0;
  max-width: 30ch;
}

.next-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.next-row .step {
  transition: transform 0.2s steps(2, end);
}

.next-row .step:hover {
  transform: translateY(-6px);
}

.mono-block {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  margin: 0 0 20px;
  overflow-x: auto;
  white-space: pre;
}

.note {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 68ch;
  margin: 0;
}

.lookup-form {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
}

.lookup-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 0 14px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}

.lookup-input:focus {
  outline: none;
  border-color: var(--accent);
}

.lookup-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 0 20px;
  height: 42px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.lookup-btn:hover { opacity: 0.85; }

.lookup-result {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  padding: 20px 24px;
  min-height: 1.7em;
  white-space: pre-wrap;
  word-break: break-word;
}

.lookup-result:empty { display: none; }

.doc-p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg);
  max-width: 70ch;
  margin: 0 0 16px;
}

.doc-p:last-child { margin-bottom: 0; }
.doc-p code { font-family: var(--font-mono); font-size: 0.92em; }

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.calendar-table th,
.calendar-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}

.calendar-table th {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calendar-table td { color: var(--fg); }

.caption {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

.table-status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  padding: 28px 12px !important;
}

.muted { color: var(--muted); }

.token-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.token-facts {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
}

.token-facts dl {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 0;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.fact dt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.fact dd {
  margin: 0;
  font-size: 14px;
  text-align: right;
}

.risk-line {
  font-size: 16px;
  margin: 0 0 14px;
  color: var(--fg);
}

.token-risk .note { max-width: none; }

.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-logo {
  font-weight: 600;
  font-size: 15px;
}

.footer-brand p { margin: 0; font-size: 13px; }

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.footer-links a { color: var(--muted); transition: color 0.2s ease; }
.footer-links a:hover { color: var(--fg); }

.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* tablet: the nav has more links now, so it needs room before phones hide
   them outright, and the six-card next-row drops to two columns */
@media (max-width: 900px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 12px; }
  .next-row { grid-template-columns: repeat(2, 1fr); }
}

/* mobile */

@media (max-width: 700px) {
  .nav {
    padding: 6px 6px 6px 16px;
    gap: 12px;
    justify-content: space-between;
  }
  .nav-links { display: none; }

  .hero-pin { padding-top: 110px; }
  .hero-h1 { font-size: 30px; }

  /* the frames are wide, so on phones the hands canvas is oversized and
     centered; the hero clips the overflow. meet-x is re-solved for the
     shifted canvas: -35% + 0.46 * 170% */
  .hands-band { margin-top: 12vh; }
    .shot-wide { width: 170%; margin-left: -35%; }

  .steps { grid-template-columns: 1fr; gap: 28px; }
  .next-row { grid-template-columns: 1fr; gap: 28px; }

  .lookup-form { flex-direction: column; }

  .token-grid { grid-template-columns: 1fr; gap: 40px; }

  .calendar-table { display: block; overflow-x: auto; }

  .section { padding: 64px 0; }
}

/* reduced motion */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .nav, .section, .hero-copy { opacity: 1 !important; transform: none !important; }
}

/* page-wide motion */

/* a faint violet light that wanders behind the whole page, so nothing
   below the hero reads as a static document */
.drift {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 600px at var(--dx, 20%) var(--dy, 30%), rgba(232, 122, 40, 0.18), transparent 70%);
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { --dx: 15%; --dy: 20%; }
  50%  { --dx: 80%; --dy: 55%; }
  100% { --dx: 30%; --dy: 90%; }
}
@property --dx { syntax: "<percentage>"; inherits: false; initial-value: 20%; }
@property --dy { syntax: "<percentage>"; inherits: false; initial-value: 30%; }

[data-stagger] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease-out var(--sd, 0s), transform .6s cubic-bezier(0.16, 1, 0.3, 1) var(--sd, 0s);
}
.in [data-stagger] { opacity: 1; transform: none; }


.nav-links a { position: relative; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -4px;
  height: 1px;
  background: currentColor;
  transition: right .35s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a:hover::after { right: 0; }

.pill-primary { position: relative; overflow: hidden; }
.pill-primary::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -40%;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(139, 92, 246, 0.35), transparent);
  animation: sheen 5s ease-in-out infinite;
}
@keyframes sheen {
  0%, 60% { left: -40%; }
  100% { left: 120%; }
}

.mono-block[data-typed] .line { display: block; opacity: 0; transform: translateX(-6px); transition: opacity .3s ease-out, transform .3s ease-out; }
.mono-block[data-typed] .line.in { opacity: 1; transform: none; }
.mono-block [data-count] { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  .drift, .pill-primary::after { animation: none !important; }
  [data-stagger], .mono-block[data-typed] .line { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-copy { opacity: 1; transform: none; }
}

/* phones: shorter stage so the cuts arrive within a few flicks, and the
   worked example wraps instead of scrolling sideways */
@media (max-width: 700px) {
  .hero-h1 { font-size: 28px; line-height: 1.12; }
  .hero-h1 br, .hero-h2 br { display: none; }
  .hands-band { margin-top: 5vh; }
  .hero-h2 { font-size: 24px; }
  .stage-copy-low { padding-top: 40px; }
  .mono-block { white-space: pre-wrap; word-break: break-word; font-size: 12px; }
  .shot-cover { object-position: 50% 45%; }
}
