/* snekot.app: one page, after Marbs's (Luma's front page): the bar on top, bits of the app floating around the
   headline, what snekot does, getting it, and the footer. The app's own colours, light and dark. */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #121212;
  --muted: #6c737e;
  --faint: #9da4ad;
  --line: rgba(18, 18, 18, 0.08);
  --track: rgba(118, 118, 130, 0.1);
  --shadow: 0 18px 40px rgba(40, 30, 20, 0.12), 0 2px 6px rgba(40, 30, 20, 0.06);
  --claude: #d9913a;
  --codex: #3e9e95;
  --input: #8b7cf6;
  --output: #e0705a;
  --read: #3fb8d0;
  --write: #6aa7d8;
  --live: #2fa84a;
  --accent: #d9913a;
  --on-accent: #1b1408;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412;
    --surface: #23201d;
    --text: #f1eee9;
    --muted: #a59f97;
    --faint: #6f6a64;
    --line: rgba(255, 255, 255, 0.08);
    --track: rgba(255, 255, 255, 0.08);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
    --claude: #eba652;
    --codex: #57bcb2;
    --read: #5cc9de;
    --live: #3fb950;
    --accent: #eba652;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif; }
p { margin: 0; }

/* The wordmark, the snake across the name, painted in the text's colour. */
.wordmark { display: block; width: 84px; height: 54px; background: var(--text);
  -webkit-mask: url(assets/wordmark.svg) center / contain no-repeat; mask: url(assets/wordmark.svg) center / contain no-repeat; }

/* The bar across the top, over the hero, glass once the page moves under it. */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: 72px; display: flex; align-items: center; gap: 24px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2)); background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--line); }
.brand .wordmark { width: 64px; height: 41px; }
.links { display: flex; gap: 22px; margin-left: auto; font-size: 15px; color: var(--muted); }
.links a:hover { color: var(--text); }

.button { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 14px; background: var(--text);
  color: var(--bg); font-size: 16px; font-weight: 600; transition: transform 0.15s ease, opacity 0.15s ease; }
.button:hover { opacity: 0.88; }
.button:active { transform: scale(0.97); }
.button.secondary { background: var(--track); color: var(--text); }
.button.small { height: 38px; padding: 0 16px; border-radius: 11px; font-size: 14px; }
/* The Apple has room around it in its box, so a size up it sits closer to the words. */
.button svg { width: 22px; height: 22px; margin: -2px -3px 0 -4px; fill: currentColor; }

/* The hero: the words in the middle, the bits of the app around them. */
.hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 96px 24px 48px; overflow: hidden; }
.words { position: relative; z-index: 1; max-width: 760px; text-align: center; display: flex; flex-direction: column; gap: 22px; }
h1 { font-size: clamp(44px, 7vw, 84px); line-height: 1.02; font-weight: 700; text-wrap: balance; }
.lead { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); max-width: 560px; margin: 0 auto; text-wrap: pretty; }
.actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 34px; }

/* Each tile is a bit of snekot in a white frame that rises in, then floats up and down on its own slow breath, each at
   its own pace and depth, so the crowd never moves in step. On a wide screen they sit at --x, --y around the words, the
   nearer (--d) a little larger, and lean toward the pointer (--mx, --my, from live.js), the nearer the more. */
.float { position: absolute; inset: 0; pointer-events: none; }
.tile { position: absolute; left: var(--x); top: var(--y); opacity: 0; scale: calc(0.86 + var(--d, 1) * 0.1);
  translate: calc(-50% + var(--mx, 0) * var(--d, 1) * 18px) calc(-50% + var(--my, 0) * var(--d, 1) * 14px);
  transition: translate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) calc(0.08s + var(--i) * 0.06s) forwards; }
.tile .card, .art .card { padding: 14px 16px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow);
  border: 1px solid var(--line); }
.tile .card {
  animation: breathe calc(2.6s + mod(var(--i), 4) * 0.5s) ease-in-out calc(var(--i) * 0.14s) infinite alternate;
  --depth: calc(6px + mod(var(--i), 3) * 3px); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes breathe { from { transform: translateY(calc(var(--depth) * -1)); } to { transform: translateY(var(--depth)); } }
@media (prefers-reduced-motion: reduce) {
  .tile { animation: none; opacity: 1; transition: none; }
  .tile .card, .ring.speaking, .dots i { animation: none; }
}

.card small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.card b { font-variant-numeric: tabular-nums; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.face { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--c);
  color: var(--on-accent); font-size: 11px; font-weight: 700; font-style: normal; }

.today .card { width: 168px; }
.today b { display: block; font-size: 30px; line-height: 1.15; margin: 2px 0 4px; }
.today .tokens { color: var(--muted); font-size: 13px; }
.flame { font-size: 13px; font-weight: 600; color: var(--claude); }

.logo .card { width: 88px; height: 88px; display: grid; place-items: center; padding: 0; }
/* The CLIs' marks, painted through their shapes: Claude's in its orange, Codex's in the text's colour. */
.mark-of { width: 44px; height: 44px; -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; }
.logo.claude .card { background: color-mix(in srgb, var(--claude) 16%, var(--surface)); }
.logo.claude .mark-of { background: var(--claude); }
.logo.codex .card { background: color-mix(in srgb, var(--codex) 16%, var(--surface)); }
.logo.codex .mark-of { background: var(--text); }

.burn .card { width: 176px; }
.burn b { display: block; font-size: 24px; margin: 2px 0 10px; }
.burn b span { font-size: 14px; color: var(--muted); font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 38px; }
.bars i { flex: 1; height: var(--h); border-radius: 3px; background: linear-gradient(var(--claude), color-mix(in srgb, var(--claude) 55%, var(--codex)));
  transition: height 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }

.board .card { width: 198px; display: grid; gap: 9px; }
.rank { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rank em { width: 10px; color: var(--faint); font-style: normal; font-size: 12px; text-align: center; }
.rank span { flex: 1; font-weight: 600; }
.rank b { font-size: 13px; color: var(--muted); }

/* A slice of the menu bar snekot lives in: its mark among the Mac's own, and the tooltip it keeps today's count in. */
.menubar .card { width: 236px; padding: 10px; display: grid; gap: 8px; }
.strip { display: flex; align-items: center; gap: 12px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--track);
  font-size: 12px; font-weight: 600; }
.tray { width: 16px; height: 16px; background: var(--text); }
.wifi { width: 14px; height: 10px; border-radius: 14px 14px 0 0 / 12px 12px 0 0; border: 2px solid var(--text); border-bottom: 0; opacity: 0.75; }
.battery { width: 20px; height: 10px; border-radius: 3px; border: 1.5px solid var(--text); opacity: 0.75;
  background: linear-gradient(90deg, var(--text) 70%, transparent 70%) content-box; padding: 1.5px; }
.clock { margin-left: auto; }
.tip { justify-self: start; margin-left: 4px; padding: 5px 9px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); font-size: 12px; color: var(--muted); position: relative; }
.tip::before { content: ""; position: absolute; left: 10px; top: -5px; width: 8px; height: 8px; rotate: 45deg; background: inherit;
  border-left: 1px solid var(--line); border-top: 1px solid var(--line); }

.heat .card { padding: 12px; }
.cells { display: grid; grid-template-columns: repeat(7, 13px); gap: 4px; }
.cells i { width: 13px; height: 13px; border-radius: 3px; background: color-mix(in srgb, var(--claude) calc(var(--a) * 100%), var(--track)); }

.chat .card { width: 214px; display: grid; gap: 6px; }
.who { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.who b { color: var(--codex); }
.who small { display: inline; color: var(--faint); }
.chat p { font-size: 14px; line-height: 1.35; }
.reaction { justify-self: start; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--claude) 55%, transparent); background: color-mix(in srgb, var(--claude) 12%, transparent); }
.typing { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 11px; color: var(--faint); }
.typing .face { width: 16px; height: 16px; font-size: 8px; }
.dots { display: inline-flex; gap: 3px; margin-left: 1px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; translate: 0 0; } 30% { opacity: 1; translate: 0 -2px; } }

.voice .card { width: 150px; height: 96px; display: grid; place-items: center; position: relative; padding: 0; overflow: hidden;
  background: color-mix(in srgb, var(--input) 18%, #111214); border-color: transparent; }
.ring { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #30d158; }
/* Robin is talking: the ring glows as their voice comes and goes. */
.ring.speaking { animation: speak 2.4s ease-in-out infinite; }
@keyframes speak {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
  20% { box-shadow: 0 0 0 5px rgba(48, 209, 88, 0.35); }
  35% { box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.2); }
  55% { box-shadow: 0 0 0 7px rgba(48, 209, 88, 0.3); }
  75% { box-shadow: 0 0 0 1px rgba(48, 209, 88, 0.1); }
}
.ring .face { width: 40px; height: 40px; font-size: 17px; }
.voice .label { position: absolute; left: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.55);
  color: #fff; font-size: 11px; font-weight: 600; }

.limits .card { width: 180px; display: grid; gap: 8px; }
.meter { height: 7px; border-radius: 4px; background: var(--track); overflow: hidden; }
.meter i { display: block; width: var(--w); height: 100%; border-radius: 4px; background: var(--output); }
.limits .row span { color: var(--muted); font-size: 12px; }
.week .meter i { background: var(--input); }

.git .card { width: 150px; }
.git b { display: block; font-size: 18px; margin-top: 2px; }
.plus { color: var(--live); font-size: 13px; font-weight: 600; }

.call .card { width: 250px; display: flex; align-items: center; gap: 9px; padding: 8px 8px 8px 14px; background: #111214;
  color: #f2f3f5; border-color: rgba(255, 255, 255, 0.12); }
.call .dot { width: 8px; height: 8px; border-radius: 50%; background: #30d158; flex: none; }
.call .where { flex: 1; display: grid; }
.call .where b { font-size: 13px; }
.call .where small { color: rgba(242, 243, 245, 0.6); font-size: 11px; }
.call .leave { padding: 7px 12px; border-radius: 10px; background: #ff3b30; font-size: 12px; font-weight: 600; }

/* A terminal running a CLI, for the journey's first step. */
.term .card { width: 228px; display: grid; gap: 4px; background: #111214; color: #e9e9eb; border-color: rgba(255, 255, 255, 0.12);
  font: 12.5px/1.45 ui-monospace, "SF Mono", Menlo, monospace; }
.lights { display: flex; gap: 5px; margin-bottom: 6px; }
.lights i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.term em { font-style: normal; color: #30d158; }
.term .dim { color: rgba(233, 233, 235, 0.55); }
.term b { color: var(--claude); font-weight: 600; }

/* How it works: three steps on alternating sides, each with a pair of snekot's cards, and the snake growing down
   through them behind the cards as you scroll, eating the tokens on its way (live.js). */
.journey { position: relative; padding: 96px max(24px, calc((100vw - 1120px) / 2)) 120px; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.trail .body { fill: var(--text); }
.trail .eye { fill: var(--bg); }
.trail .food circle { fill: var(--c); transform-box: fill-box; transform-origin: center; transition: scale 0.3s ease, opacity 0.3s ease; }
.trail .food circle.eaten { scale: 0; opacity: 0; }
.journey .heading, .step { position: relative; }
.step { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 96px; padding: 64px 0; }
.flip .art { order: -1; }
.say h3 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; font-weight: 700; }
.say p { margin-top: 14px; max-width: 440px; color: var(--muted); font-size: 18px; text-wrap: pretty; }
.art { display: grid; place-items: center; min-height: 300px; }
.art > * { grid-area: 1 / 1; }
.art > :first-child { translate: -44px -40px; rotate: -3deg; }
.art > :last-child { translate: 48px 52px; rotate: 2.5deg; }

/* The page's bands below the hero. */
.band { padding: 96px max(24px, calc((100vw - 1120px) / 2)); }
.heading { text-align: center; display: grid; gap: 12px; padding-bottom: 44px; }
h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 700; }
#get .actions { padding-top: 0; }
/* Where the snake from How it works curls up into snekot's icon, above the heading (live.js), and once it has, an
   Apple fades in the middle. */
.coil { display: grid; place-items: center; width: 120px; height: 120px; margin: 0 auto 36px; }
.coil svg { width: 56px; height: 56px; fill: var(--text); opacity: 0; scale: 0.7;
  transition: opacity 0.6s ease, scale 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.coil.done svg { opacity: 1; scale: 1; }
.fine { color: var(--faint); font-size: 13px; text-align: center; margin-top: 16px; }

.foot { display: grid; justify-items: center; gap: 8px; padding: 48px 24px 64px; color: var(--muted); font-size: 15px; }
.foot .fine { margin-top: 0; }

/* A phone: the bits of the app in a band above the words and a band below the buttons, a little smaller and tilted,
   as a crowd rather than a grid. */
@media (max-width: 900px) {
  .links { display: none; }
  .bar > .button { margin-left: auto; }
  .hero { justify-content: flex-start; padding-top: 92px; min-height: auto; }
  .float { position: static; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; width: calc(100% + 48px);
    max-width: 560px; padding: 10px 0 28px; }
  .float.below { padding: 34px 0 0; }
  .tile { position: relative; left: auto; top: auto; translate: none; scale: none; transition: none; }
  .tile:nth-child(odd) { rotate: -2deg; }
  .tile:nth-child(even) { rotate: 2.5deg; }
  .tile .card { zoom: 0.78; }
  /* Four a band: the menu bar first, as where snekot lives; the rest wait for a wider screen. */
  .tile.menubar { order: -1; }
  .tile.claude, .tile.heat, .tile.git, .tile.call { display: none; }
  .band { padding-top: 64px; padding-bottom: 64px; }
  .journey { padding: 64px 24px 72px 52px; }
  .step { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
  .flip .art { order: 0; }
  .art { min-height: 220px; }
  .art .card { zoom: 0.82; }
  .art > :first-child { translate: -18px -30px; }
  .art > :last-child { translate: 20px 40px; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .tile .card { zoom: 0.86; }
}
