/* wisp landing v2 · HEYLOLA paper system. Light only. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f5f1ea;
  --paper-2: #ece6dc;
  --paper-3: #e2dbce;
  --line: #d9d1c3;
  --graphite: #1c1a17;
  --graphite-2: #5a554f;
  --graphite-3: #6b655d;
  --amber: #e2a254;

  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* motion tokens */
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ghost: cubic-bezier(0.2, 0, 0, 1);
  --ease-accept: cubic-bezier(0.32, 0.72, 0, 1);
  --m-settle: 640ms;
  --m-ghost: 180ms;
  --m-accept: 320ms;

  --gutter: clamp(16px, 4vw, 32px);
  --col: 1080px;
  --section: clamp(112px, 13vw, 184px);
  --fs-term: clamp(0.71875rem, 0.55rem + 0.75vw, 0.9375rem);

  color-scheme: light;
  scrollbar-color: var(--line) var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font: 400 1.0625rem/1.5 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, p, figure, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
button { font: inherit; color: inherit; }

::selection { background: var(--amber); color: var(--graphite); }

:focus-visible {
  outline: 2px solid var(--graphite);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--amber);
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }
.center { text-align: center; margin-inline: auto; }

.skip {
  position: absolute; left: var(--gutter); top: 12px; z-index: 10;
  padding: 8px 16px; border-radius: 999px;
  background: var(--graphite); color: var(--paper); text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus-visible { transform: none; }

/* ---------- Type ---------- */

.display {
  font-size: clamp(2.375rem, 1.1rem + 4.2vw, 4.75rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
  max-width: 20ch;
  margin-inline: auto;
}
.h2 {
  font-size: clamp(2rem, 1.25rem + 2.6vw, 3.5rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lead {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--graphite-2);
  text-wrap: pretty;
  max-width: 34ch;
}
.body { color: var(--graphite-2); max-width: 46ch; text-wrap: pretty; }
.small { font-size: 0.875rem; line-height: 1.45; color: var(--graphite-3); max-width: 62ch; text-wrap: pretty; }

.link {
  color: var(--graphite);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: text-decoration-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: var(--graphite); }
}

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--graphite); color: var(--paper);
  font-weight: 500; font-size: 1.0625rem; letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-accept), opacity 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .pill:hover { opacity: 0.88; }
}
.pill:active { transform: scale(0.97); }

.actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 16px 28px;
}

/* ---------- Header / footer ---------- */

.top, .foot {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center;
}
.top { height: 72px; justify-content: space-between; }
.wordmark {
  font-weight: 500; font-size: 1.375rem; letter-spacing: -0.04em;
  color: var(--graphite); text-decoration: none;
}
.nav { display: flex; gap: clamp(18px, 3vw, 32px); }
.nav a, .foot a, .foot span {
  color: var(--graphite-2); text-decoration: none; font-size: 0.9375rem;
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover, .foot a:hover { color: var(--graphite); }
}

.foot {
  flex-wrap: wrap; gap: 12px 28px;
  padding-block: 32px 40px;
  border-top: 1px solid var(--line);
}
.foot .wordmark { font-size: 1.0625rem; margin-right: auto; color: var(--graphite); }
.foot .maker { display: inline-flex; align-items: center; gap: 7px; }
.foot .maker img { height: 15px; width: auto; transform: translateY(2px); }
@media (max-width: 480px) {
  .foot { gap: 12px 16px; }
  .foot a, .foot span { font-size: 0.875rem; }
  .foot .maker { gap: 5px; }
  .foot .maker img { height: 13px; }
}

/* ---------- Sections ---------- */

main > section {
  padding: var(--section) var(--gutter) 0;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin-inline: auto;
}
main > section:last-child { padding-bottom: var(--section); }

.hero { text-align: center; padding-top: clamp(40px, 6vw, 88px) !important; }
.hero .lead { margin: 24px auto 0; }
.hero .actions { margin-top: 32px; }
.hero-demo { max-width: 760px; margin: clamp(48px, 6vw, 72px) auto 0; text-align: left; }

.head { text-align: center; }
.head .body, section > .body { margin: 20px auto 0; }

/* ---------- Terminal ---------- */

.term {
  display: grid;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 28px;
  font: 400 var(--fs-term)/1.65 var(--mono);
  color: var(--graphite-2);
  font-variant-ligatures: none;
}
@media (max-width: 560px) { .term { padding: 18px 16px; } }
/* The hero demo is the page's proof, so it reads at body size on wide screens. */
.hero-demo .term { --fs-term: clamp(0.75rem, 0.5rem + 0.85vw, 1.0625rem); }
@media (min-width: 900px) { .hero-demo .term { padding: 32px 40px; } }

.scene {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-width: 0;
  transition: opacity 400ms var(--ease-settle);
}
.scene.is-off { opacity: 0; }

.ln { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.65em; }
.ln.c, .prompt { color: var(--graphite); }
.ps { color: var(--graphite-3); }

.prompt { display: flex; align-items: flex-end; gap: 12px; }
.cmd { display: grid; flex: 1; min-width: 0; }
.live, .done { grid-area: 1 / 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.done { opacity: 0; transition: opacity var(--m-accept) var(--ease-accept); }
.ghost { color: var(--graphite-3); opacity: 0; transition: opacity var(--m-ghost) var(--ease-ghost); }

.caret { position: relative; display: inline-block; width: 0; height: 1.25em; vertical-align: -0.28em; }
.caret::after {
  content: ""; position: absolute; left: -1px; top: 0;
  width: 2px; height: 100%;
  background: var(--amber);
  animation: blink 1s steps(1) infinite;
}
.live .caret { transition: opacity 120ms linear; }
.done .caret::after { opacity: 1; }

.src { position: relative; z-index: 0; white-space: nowrap; }
.has-lit .src { color: var(--graphite); }
.src::before {
  content: ""; position: absolute; z-index: -1;
  inset: 0.1em -0.3em 0.05em;
  border-radius: 3px;
  background: var(--amber);
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--m-accept) var(--ease-accept);
}

.key {
  flex: none;
  display: inline-grid; place-items: center;
  width: 2.1em; height: 1.6em;
  margin-bottom: 0.03em;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--paper);
  color: var(--graphite);
  opacity: 0;
  transition: opacity var(--m-ghost) var(--ease-ghost), transform 160ms var(--ease-accept);
}
.key svg, .keycap svg {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* states (the static HTML carries the settled frame) */
.scene:not(.has-out) .ln { opacity: 0; transform: translateY(6px); }
.scene .ln {
  transition: opacity var(--m-settle) var(--ease-settle), transform var(--m-settle) var(--ease-settle);
  transition-delay: calc(var(--i, 0) * 40ms);
}
.scene.no-tx, .scene.no-tx * , .scene.no-tx *::before { transition: none !important; }
.has-ghost .ghost { opacity: 1; }
.has-key .key { opacity: 1; }
.is-press .key { transform: scale(0.94); transition-duration: 80ms; }
.has-accept .done { opacity: 1; }
.has-accept .live .caret { opacity: 0; transition: none; } /* one caret at a time */
/* Hide the typed layer once the accepted line is fully in. A long line can wrap differently in
   the two layers, and leaving both visible would overprint them. */
.live { transition: opacity 120ms linear; }
.has-accept .live { opacity: 0; transition-delay: var(--m-accept); }
.has-accept .key { opacity: 0; transition-delay: 240ms; }
.has-lit .src::before { transform: scaleX(1); }
/* Second source (history), lit after the first so the eye follows name, then flags. */
/* It can wrap, so it is painted as a cloned inline background instead of a scaled block. */
.src.alt { white-space: normal; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  transition: background-color var(--m-accept) var(--ease-accept) 160ms; }
.src.alt::before { content: none; }
.has-lit .src.alt { background-color: var(--line); }
.is-typing .caret::after, .is-paused .caret::after { animation: none; }
.done .caret::after { animation: none; }
.has-accept .done .caret::after { animation: blink 1s steps(1) 400ms infinite; }

@keyframes blink { 50% { opacity: 0; } }

.demo-foot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px;
  margin-top: 16px;
  font-size: 0.8125rem; line-height: 1.45; color: var(--graphite-3);
}
.toggle {
  flex: none;
  padding: 6px 2px; border: 0; background: none; cursor: pointer;
  color: var(--graphite-2); font-size: 0.8125rem;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.25em;
}
@media (hover: hover) and (pointer: fine) { .toggle:hover { color: var(--graphite); text-decoration-color: var(--graphite); } }
@media (max-width: 560px) { .demo-foot { flex-direction: column; } }

.shot-label { font-size: 0.875rem; color: var(--graphite-2); margin-bottom: 12px; }

/* ---------- S2 · reads (stacked by default) ---------- */

.reads-stage { display: grid; gap: 48px; }
.reads-copy { text-align: center; }
.reads-copy .body { margin: 20px auto 0; }
.reads-shots { display: grid; gap: 40px; max-width: 760px; width: 100%; margin-inline: auto; }
.dots, .reads-track { display: none; }

@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  .motion .reads {
    display: grid;
    max-width: none;
    padding-top: calc(var(--section) - 18svh);
  }
  .motion .reads-stage, .motion .reads-track { grid-area: 1 / 1; }
  .motion .reads-stage {
    position: sticky; top: 0; align-self: start;
    height: 100svh;
    width: 100%; max-width: calc(1180px + 2 * var(--gutter));
    margin-inline: auto; padding-inline: var(--gutter);
    grid-template-columns: 5fr 7fr; align-items: center; gap: clamp(48px, 6vw, 96px);
  }
  .motion .reads-copy { text-align: left; }
  .motion .reads-copy .body { margin-left: 0; }
  .motion .reads-shots { grid-template-areas: "s"; gap: 0; }
  .motion .reads .shot {
    grid-area: s;
    opacity: 0; transform: translateY(12px);
    transition: opacity 200ms var(--ease-ghost), transform 200ms var(--ease-ghost);
    pointer-events: none;
  }
  .motion .reads[data-active="0"] .shot[data-step="0"],
  .motion .reads[data-active="1"] .shot[data-step="1"],
  .motion .reads[data-active="2"] .shot[data-step="2"] {
    opacity: 1; transform: none; pointer-events: auto;
    transition-duration: var(--m-settle); transition-timing-function: var(--ease-settle);
    transition-delay: 120ms;
  }
  .motion .dots { display: flex; gap: 10px; margin-top: 40px; }
  .motion .dots li {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--graphite); opacity: 0.2;
    transition: opacity 200ms ease;
  }
  .motion .reads[data-active="0"] .dots li:nth-child(1),
  .motion .reads[data-active="1"] .dots li:nth-child(2),
  .motion .reads[data-active="2"] .dots li:nth-child(3) { opacity: 1; }
  .motion .reads-track { display: block; position: relative; height: 270svh; }
  .motion .reads-track span { position: absolute; left: 0; width: 1px; }
  .motion .reads-track [data-marker="0"] { top: 0; height: 90svh; }
  .motion .reads-track [data-marker="1"] { top: 90svh; height: 80svh; }
  .motion .reads-track [data-marker="2"] { top: 170svh; height: 100svh; }
  .motion .moments { padding-top: calc(var(--section) - 18svh); }
}

/* ---------- S3 · moments ---------- */

.pair {
  display: grid; gap: 40px 24px;
  margin-top: clamp(48px, 6vw, 72px);
}
.pair .shot { display: flex; flex-direction: column; }
.pair .term { flex: 1; }
@media (min-width: 900px) { .pair { grid-template-columns: 1fr 1fr; } }

.long-demo { max-width: 1040px; margin: clamp(40px, 5vw, 64px) auto 0; }
.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px;
  margin-top: 16px; font-size: 0.875rem; color: var(--graphite-2);
}
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .sw { width: 14px; height: 10px; border-radius: 3px; background: var(--amber); }
.legend .sw.alt { background: var(--line); }
.legend-note { flex-basis: 100%; justify-content: center; text-align: center; color: var(--graphite-3); font-size: 0.8125rem; }

.keys { margin-top: 28px; text-align: center; color: var(--graphite-2); font-size: 0.9375rem; }
.keycap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2em; padding: 0.5em 0.6em; line-height: 1;
  vertical-align: middle; margin-top: -0.2em;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--paper-2); color: var(--graphite);
  font-size: 1em; line-height: 1;
}
.keycap-text { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; line-height: 1; }
.keycap svg { width: 0.75rem; height: 0.75rem; }
.keys .plus { margin: 0 0.2em; color: var(--graphite-3); }

/* ---------- S4 · terminals ---------- */

.terminals { text-align: center; }
.names {
  display: flex; flex-wrap: wrap; justify-content: center;
  margin: clamp(40px, 5vw, 64px) auto clamp(32px, 4vw, 48px);
}
.names li {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px clamp(20px, 3.4vw, 44px);
}
.names li { position: relative; }
.names li + li::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 1px; background: var(--line);
}
.name { font-size: clamp(1.375rem, 1rem + 1.2vw, 2rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.name-note { font-size: 0.875rem; color: var(--graphite-3); }
.name-note code { font-size: 0.8125rem; color: var(--graphite-2); }
@media (max-width: 720px) {
  .names { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 0; max-width: 440px; }
  .names li:nth-child(odd)::before { content: none; }
}

/* ---------- S5 · local ---------- */

.local { text-align: center; }
.statement { font-size: clamp(2.25rem, 1.2rem + 3.6vw, 4.25rem); letter-spacing: -0.04em; line-height: 1.04; }
.statement .l { display: block; overflow: clip; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.statement .l > span { display: inline-block; }
.local .lead { margin-top: 24px; max-width: 40ch; }

.figures {
  display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: 880px; margin: clamp(56px, 7vw, 88px) auto 0;
  border-top: 1px solid var(--line);
}
.figures div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; padding: 28px 20px 0; }
.figures div + div { border-left: 1px solid var(--line); }
.figures dd {
  font-size: clamp(2rem, 1.4rem + 1.8vw, 3rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.figures dt { font-size: 0.9375rem; color: var(--graphite-2); text-wrap: balance; }
.local .small { margin-top: 32px; }
@media (max-width: 720px) {
  .figures { grid-template-columns: 1fr; border-top: 0; max-width: 360px; }
  .figures div { padding: 22px 16px; border-top: 1px solid var(--line); }
  .figures div + div { border-left: 0; }
}

/* ---------- S6 · install ---------- */

.install { text-align: center; }
.install-panel {
  max-width: 760px; margin: clamp(40px, 5vw, 56px) auto 0;
  text-align: left;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 14px 14px 28px;
}
@media (max-width: 560px) { .install-panel { padding: 10px 8px 10px 16px; } }
.cmds li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 6px 0;
}
.cmds code {
  flex: 1; min-width: 0;
  font: 400 var(--fs-term)/1.65 var(--mono);
  color: var(--graphite);
  white-space: pre-wrap; overflow-wrap: anywhere;
  padding-left: 1.2em; text-indent: -1.2em;
  padding-top: 0.25em;
}
.cmds code::before { content: "$ "; color: var(--graphite-3); }
.cmds .check { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }

.copy {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--graphite-2);
  transition: background-color 150ms ease, transform 160ms var(--ease-accept);
}
.copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.copy:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .copy:hover { background: var(--paper-3); color: var(--graphite); } }
.copied {
  position: absolute; right: calc(100% + 6px); top: 50%;
  font-size: 0.8125rem; color: var(--graphite-2);
  opacity: 0; transform: translateY(-50%);
  transition: opacity var(--m-ghost) var(--ease-ghost);
  pointer-events: none;
}
.copy.is-copied .copied { opacity: 1; }
.copy.is-copied svg { opacity: 0.35; }
.install .actions { margin-top: 32px; }

/* ---------- S5 line reveal (only when JS adds .motion) ---------- */

.motion [data-lines] .l > span {
  transform: translateY(105%); opacity: 0;
  transition: opacity var(--m-settle) var(--ease-settle), transform var(--m-settle) var(--ease-settle);
}
.motion [data-lines] .l + .l > span { transition-delay: 80ms; }
.motion [data-lines].is-in .l > span { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .caret::after, .has-accept .done .caret::after { animation: none; }
}

/* ---------- 404 ---------- */

.lost {
  min-height: calc(100svh - 72px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  padding: 48px var(--gutter) 96px; text-align: center;
}
.lost .term { width: min(560px, 100%); text-align: left; margin-bottom: 16px; }
.lost .body { margin-inline: auto; }
