:root {
  --fog: #e4ebef;
  --fog-deep: #d3dee5;
  --ink: #0d2436;
  --ink-soft: #3d5568;
  --cobalt: #2251e8;
  --signal: #f2b649;
  --hull: #0f2130;
  --hull-edge: #1d3547;

  /* terminal palette */
  --t-fg: #c8dce6;
  --t-dim: #5f7d90;
  --t-cy: #6cc7e8;
  --t-gr: #7fd99a;
  --t-am: #f2b649;
  --t-rd: #f07167;
  --t-sel: #20425c;

  --display: "Anybody", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --measure: 62ch;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  overflow-x: hidden;
}
a { color: inherit; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .88em; background: var(--fog-deep); padding: .08em .35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--fog); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

kbd {
  display: inline-grid; place-items: center;
  min-width: 1.9em; height: 1.75em; padding: 0 .45em;
  font-size: .8em; font-weight: 600; line-height: 1;
  color: var(--ink);
  background: #f6f9fb;
  border: 1px solid #b7c6d0;
  border-bottom-width: 3px;
  border-radius: 6px;
  vertical-align: .1em;
}

h2 {
  font: 800 clamp(2rem, 1.2rem + 3.4vw, 3.6rem)/1.02 var(--display);
  font-variation-settings: "wdth" 112;
  letter-spacing: -.02em;
  margin: 0 0 .6em;
  max-width: 18ch;
}
h3 { font: 700 1.05rem/1.3 var(--body); margin: 0 0 .9rem; }
p { margin: 0 0 1em; max-width: var(--measure); }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px var(--gutter);
  position: relative; z-index: 2;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 1.3rem/1 var(--display); font-variation-settings: "wdth" 120;
  text-decoration: none; color: var(--ink);
}
.wordmark svg { width: 30px; height: 30px; color: var(--cobalt); }
.nav nav { display: flex; gap: clamp(12px, 2.5vw, 28px); font-weight: 500; font-size: .95rem; }
.nav nav a { text-decoration: none; color: var(--ink-soft); }
.nav nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .nav nav a:not(:last-child) { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(24px, 6vw, 72px) var(--gutter) clamp(56px, 8vw, 110px);
  isolation: isolate;
  overflow-x: clip;
}
.tide {
  position: absolute; inset: 18% 0 auto 0; height: 70%; width: 200%;
  z-index: -1; pointer-events: none;
}
.tide path { fill: none; stroke: var(--cobalt); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.tide-a { opacity: .16; animation: drift 38s linear infinite; }
.tide-b { opacity: .11; animation: drift 54s linear infinite reverse; }
.tide-c { opacity: .08; animation: drift 70s linear infinite; }
@keyframes drift { to { transform: translateX(-50%); } }

.hero-copy { max-width: 1180px; margin: 0 auto; }
.flow-title {
  margin: 0 0 .45em;
  font: 900 clamp(2.3rem, .6rem + 6.2vw, 6.4rem)/.95 var(--display);
  letter-spacing: -.035em;
  font-variation-settings: "wdth" 118;
}
.flow-title .line { display: block; }
.flow-title .word { display: inline-block; white-space: nowrap; }
.flow-title .ch {
  display: inline-block;
  animation: widen 1.25s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i) * 28ms);
}
.flow-title .line + .line { color: var(--cobalt); }
@keyframes widen {
  from { font-variation-settings: "wdth" 50; opacity: 0; transform: translateY(.18em); }
  60% { opacity: 1; }
  to { font-variation-settings: "wdth" 118; opacity: 1; transform: none; }
}
.lede { font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); color: var(--ink-soft); max-width: 56ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  font: 600 1rem/1 var(--body); text-decoration: none;
  border-radius: 999px; transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--fog); }
.btn-primary:hover { background: var(--cobalt); }
.btn-quiet { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-quiet:hover { background: #fff6; }

/* ---------- terminal ---------- */
.term-shell {
  max-width: 1180px; margin: clamp(40px, 6vw, 72px) auto 0;
  background: var(--hull);
  border-radius: 18px;
  box-shadow: 0 1px 0 var(--hull-edge) inset, 0 40px 80px -30px #0d243680, 0 12px 24px -12px #0d243650;
  overflow: hidden;
}
.term-chrome {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--hull-edge);
  color: var(--t-fg); font: 400 .85rem/1 var(--mono);
}
.term-prompt .dim { color: var(--t-dim); }
.seg { display: inline-flex; background: #0a1924; border-radius: 999px; padding: 3px; }
.seg button {
  font: 600 .78rem/1 var(--mono); color: var(--t-dim);
  background: none; border: 0; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.seg button[aria-pressed="true"] { background: var(--t-sel); color: var(--t-cy); }
.term-scroll { overflow-x: auto; padding: clamp(10px, 2vw, 26px); container-type: inline-size; }
.term {
  margin: 0 auto; width: max-content;
  font: 400 clamp(8px, calc((100cqi - 4px) / 47.2), 17px)/1.2 var(--mono);
  color: var(--t-fg);
  outline: none; cursor: text;
  border-radius: 6px;
}
.term:focus-visible { box-shadow: 0 0 0 2px var(--t-cy); outline: none; }
.term .dim { color: var(--t-dim); }
.term .cy { color: var(--t-cy); }
.term .gr { color: var(--t-gr); }
.term .am { color: var(--t-am); }
.term .rd { color: var(--t-rd); }
.term .b { font-weight: 600; }
.term .sel { background: var(--t-sel); }
.term .inv { background: var(--t-cy); color: var(--hull); }
.term .cur { background: var(--t-fg); color: var(--hull); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { background: transparent; color: inherit; } }

.term-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 14px 18px 18px; border-top: 1px solid var(--hull-edge);
}
.keypad { display: flex; flex-wrap: wrap; gap: 6px; }
.keypad button {
  font: 600 .8rem/1 var(--mono); color: var(--t-fg);
  min-width: 34px; height: 32px; padding: 0 9px;
  background: #16303f; border: 1px solid #284a5e; border-bottom-width: 3px; border-radius: 7px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, transform .1s ease, border-color .25s ease;
}
.keypad button:hover { border-color: var(--t-cy); }
.keypad button.hit {
  background: var(--signal); color: var(--hull); border-color: #b27c19;
  transform: translateY(2px); border-bottom-width: 1px; transition-duration: 0s;
}
.term-status { margin: 0; color: var(--t-dim); font-size: .9rem; }
.term-status.live #term-status { color: var(--t-gr); }
.linkish {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.term-status .linkish { color: var(--t-cy); margin-left: 8px; }

/* ---------- shared section rhythm ---------- */
.themes, .features, .flow, .install {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(64px, 9vw, 128px) var(--gutter);
}
.code {
  margin: 0; padding: 20px 22px;
  background: var(--hull); color: var(--t-fg);
  border-radius: 14px; overflow-x: auto;
  font-size: .9rem; line-height: 1.6;
}
.code.small { font-size: .85rem; padding: 16px 18px; }
.c-dim { color: var(--t-dim); }
.c-key { color: var(--t-cy); }
.c-str { color: var(--t-gr); }
.c-num { color: var(--t-am); }
.c-flash.flash { animation: cfg 1s ease; }
@keyframes cfg { 0% { background: var(--signal); color: var(--hull); } 100% { background: transparent; } }

/* ---------- themes ---------- */
.themes {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 6vw, 80px); align-items: center;
}
.themes .code { align-self: center; }
.theme-list { margin: 28px 0 0; display: grid; gap: 18px; }
.theme-list > div {
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--fog-deep);
  transition: border-color .3s ease;
}
.theme-list > div.on { border-left-color: var(--cobalt); }
.theme-list dt { font: 800 1.4rem/1.2 var(--display); font-variation-settings: "wdth" 110; margin-bottom: 4px; }
.theme-list dt .linkish { text-decoration-thickness: 2px; text-decoration-color: #0d243633; }
.theme-list > div.on dt .linkish { text-decoration-color: var(--cobalt); }
.theme-list dd { margin: 0; color: var(--ink-soft); max-width: 56ch; }

/* ---------- features ---------- */
.features { border-top: 1px solid #0d24361a; }
.feature-cols {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
}
.feature-cols h3 {
  font: 800 1.6rem/1 var(--display); font-variation-settings: "wdth" 130;
  color: var(--cobalt); padding-bottom: 14px; border-bottom: 2px solid var(--ink);
}
.feature-cols ul { list-style: none; margin: 0; padding: 0; }
.feature-cols li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px;
  padding: 12px 0; border-bottom: 1px solid #0d24361a; color: var(--ink-soft);
}
.feature-cols li > span { flex: 1 1 14ch; }
.feature-cols li kbd { flex: none; }
.runtime-note { margin-top: 40px; color: var(--ink-soft); }

/* ---------- flow ---------- */
.flow {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px); align-items: start;
}
.flow-copy .code { margin-top: 8px; }
.pipeline {
  --dot-y: 0px;
  list-style: none; margin: 0; padding: 0 0 0 44px;
  position: relative;
}
.pipeline::before {
  content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 6px, transparent 6px 12px);
  opacity: .25;
}
.pipeline::after {
  content: ""; position: absolute; left: 6px; top: 7px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 0 5px #f2b64940, 0 0 18px #f2b649;
  transform: translateY(var(--dot-y));
  transition: transform .55s cubic-bezier(.6, 0, .3, 1);
}
.pipeline li {
  position: relative; padding: 4px 0 22px;
  color: var(--ink-soft);
  transition: color .35s ease;
}
.pipeline li::before {
  content: ""; position: absolute; left: -36px; top: 10px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--fog); border: 2px solid #0d243655;
  transition: border-color .35s ease, background .35s ease;
}
.pipeline li b { display: block; font: 700 1.15rem/1.3 var(--body); color: var(--ink); }
.pipeline li.lit { color: var(--ink); }
.pipeline li.lit::before { border-color: var(--cobalt); background: var(--cobalt); }
.pipeline li.return { padding-top: 14px; }
.pipeline li.return b { color: var(--cobalt); }

/* ---------- install ---------- */
.install { border-top: 1px solid #0d24361a; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 12px; }
.tabs button {
  font: 600 .92rem/1 var(--body); color: var(--ink-soft);
  background: none; border: 0; padding: 11px 16px; border-radius: 999px; cursor: pointer;
}
.tabs button:hover { color: var(--ink); background: #fff7; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--fog); }
.install-panel { position: relative; }
.install-panel .code { padding-right: 96px; min-height: 110px; white-space: pre; }
.copy {
  position: absolute; top: 14px; right: 14px;
  font: 600 .82rem/1 var(--body); color: var(--hull);
  background: var(--signal); border: 0; border-radius: 999px; padding: 9px 14px; cursor: pointer;
}
.install-after {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px); margin-top: 48px;
}
.install-after p { color: var(--ink-soft); }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 32px var(--gutter) 48px;
  max-width: 1180px; margin: 0 auto;
  border-top: 2px solid var(--ink);
  font-size: .92rem; color: var(--ink-soft);
}
.foot p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .themes, .flow, .install-after { grid-template-columns: minmax(0, 1fr); }
  .feature-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .term-chrome { flex-wrap: wrap; }
  .term-prompt { display: none; }
  .term-shell { border-radius: 14px; margin-left: calc(var(--gutter) * -.5); margin-right: calc(var(--gutter) * -.5); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tide g, .flow-title .ch, .term .cur { animation: none !important; }
  .pipeline::after { transition: none; }
}
