/*
 * ZChart site. Layout: one column of full-width bands; the page background
 * eases between warm paper and ZChart's ink as each band reaches the middle
 * of the screen (main.js sets body[data-tone]). The app appears in framed
 * windows, always dark, like the app itself.
 */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'ZMono';
  src: url('/fonts/mono.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  /* Paper: the light tone */
  --paper: #f4f2ee;
  --paper-2: #eceae4;
  --paper-ink: #0e1116;
  --paper-muted: #686d75;
  --paper-faint: #a2a6ad;
  --paper-line: rgba(14, 17, 22, 0.1);
  /* Ink: the dark tone, ZChart's canvas */
  --ink: #0b0d10;
  --ink-2: #111418;
  --ink-text: #f3f5f7;
  --ink-muted: #8b919b;
  --ink-faint: #596069;
  --ink-line: rgba(255, 255, 255, 0.09);
  /* The one accent */
  --accent: #3d7eff;

  /* Live values, swapped by tone */
  --bg: var(--paper);
  --fg: var(--paper-ink);
  --muted: var(--paper-muted);
  --faint: var(--paper-faint);
  --line: var(--paper-line);
  --raised: #ffffff;
  --btn-bg: var(--paper-ink);
  --btn-fg: #ffffff;

  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'ZMono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --tone-time: 600ms;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}

body[data-tone='dark'] {
  --bg: var(--ink);
  --fg: var(--ink-text);
  --muted: var(--ink-muted);
  --faint: var(--ink-faint);
  --line: var(--ink-line);
  --raised: var(--ink-2);
  --btn-bg: #ffffff;
  --btn-fg: var(--paper-ink);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.55 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  transition:
    background-color var(--tone-time) var(--ease),
    color var(--tone-time) var(--ease);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

.wrap.wide {
  max-width: 1360px;
}

.wrap.narrow {
  max-width: 820px;
}

.center {
  text-align: center;
}

/* ---------- type ---------- */

.eyebrow {
  margin: 0 0 22px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--tone-time) var(--ease);
}

.display {
  margin: 0;
  font-size: clamp(56px, 9.2vw, 132px);
  line-height: 0.92;
  font-weight: 650;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.display .dim {
  color: var(--faint);
}

.title {
  margin: 0 0 22px;
  font-size: clamp(34px, 4.6vw, 60px);
  line-height: 1.02;
  font-weight: 640;
  letter-spacing: -0.042em;
  text-wrap: balance;
}

.lede {
  max-width: 560px;
  margin: 28px 0 0;
  font-size: clamp(19px, 1.7vw, 22px);
  line-height: 1.45;
  color: var(--muted);
}

.body-lg {
  max-width: 64ch;
  margin: 0;
  font-size: clamp(19px, 1.8vw, 23px);
  line-height: 1.5;
  color: var(--muted);
}

.body {
  max-width: 52ch;
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

/* Headline words brighten one after another as the band arrives. */
.words .w {
  display: inline-block;
  opacity: 0.18;
  transition: opacity 500ms var(--ease);
  transition-delay: calc(var(--i) * 45ms);
}

.words.in .w {
  opacity: 1;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  font: 600 15px/1 var(--font);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms var(--ease),
    background-color var(--tone-time) var(--ease),
    color var(--tone-time) var(--ease),
    opacity 160ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible,
.platform:focus-visible,
summary:focus-visible,
.head-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-dark {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn-dark:hover {
  opacity: 0.88;
}

.btn-lg {
  height: 56px;
  padding: 0 26px;
  border-radius: 14px;
  font-size: 17px;
}

.btn-sm {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
}

.btn-ghost {
  background: transparent;
  color: var(--faint);
  border: 1px solid var(--line);
  cursor: default;
}

.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  transition:
    background-color var(--tone-time) var(--ease),
    border-color var(--tone-time) var(--ease);
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 19px;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0;
  transition:
    background-color var(--tone-time) var(--ease),
    color var(--tone-time) var(--ease);
}

.mark.sm {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--ink-text);
  color: var(--ink);
}

.head-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
}

.head-nav a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.head-nav a:not(.btn):hover {
  color: var(--fg);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(72px, 11vw, 140px) 0 clamp(64px, 8vw, 110px);
  overflow: hidden;
}

.hero-candles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

.hero > .wrap {
  position: relative;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
  margin-top: 40px;
}

.cta-meta {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.hero-window {
  margin-top: clamp(56px, 7vw, 96px);
}

/* ---------- app windows ---------- */

.window {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 2px rgba(14, 17, 22, 0.08),
    0 30px 80px -20px rgba(14, 17, 22, 0.35);
}

body[data-tone='dark'] .window {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 30px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 16px;
  background: var(--ink-2);
  border-bottom: 1px solid var(--ink-line);
  color: var(--ink-text);
  font-size: 13px;
  font-weight: 600;
}

.window-title {
  margin-left: auto;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

/* ---------- bands ---------- */

.band {
  padding: clamp(88px, 10vw, 140px) 0;
}

.faq {
  padding-top: clamp(48px, 6vw, 80px);
}

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
}

.feature-grid.flip > .feature-copy {
  order: 2;
}

.feature-copy {
  min-width: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 13px/1 var(--mono);
  color: var(--muted);
}

.kbd-line {
  display: flex;
  gap: 6px;
  margin: 28px 0 0;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 8px;
  background: var(--raised);
  font: 500 13px/1 var(--mono);
  color: var(--fg);
}

/* The phone snapshot, in a simple device outline. */
.phone {
  justify-self: center;
  width: min(100%, 340px);
  margin: 0;
  padding: 10px;
  border-radius: 54px;
  background: #16191e;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(14, 17, 22, 0.1),
    0 40px 90px -24px rgba(14, 17, 22, 0.45);
}

.phone img {
  border-radius: 44px;
}

/* ---------- facts ---------- */

.facts {
  padding: clamp(72px, 9vw, 120px) 0;
}

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

.fact {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.fact .i {
  width: 24px;
  height: 24px;
  color: var(--muted);
}

.fact p {
  margin: 18px 0 0;
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

/* ---------- download ---------- */

.platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 44px 0 28px;
  text-align: left;
}

.platform {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--raised);
  text-decoration: none;
  transition:
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease),
    background-color var(--tone-time) var(--ease);
}

.platform .i {
  width: 26px;
  height: 26px;
  margin-bottom: 18px;
  color: var(--fg);
}

.platform.live:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -18px rgba(14, 17, 22, 0.3);
}

.platform.soon {
  opacity: 0.62;
}

.platform.mine {
  outline: 2px solid var(--fg);
  outline-offset: -1px;
}

.p-name {
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.p-meta {
  font-size: 14px;
  color: var(--muted);
}

.platform .btn {
  margin-top: 18px;
  width: 100%;
}

.note {
  max-width: 60ch;
  margin: 10px auto 0;
  font-size: 15px;
  color: var(--muted);
}

.note b {
  color: var(--fg);
  font-weight: 600;
}

/* ---------- steps ---------- */

.steps-band {
  padding-top: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border-radius: 18px;
  background: var(--paper-2);
}

.steps b {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.steps li > span:last-child {
  font-size: 15px;
  color: var(--muted);
}

.step-n {
  margin-bottom: 18px;
  font: 500 13px/1 var(--mono);
  color: var(--muted);
}

.steps-band .note {
  margin-left: 0;
}

/* ---------- FAQ ---------- */

details {
  border-bottom: 1px solid var(--line);
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(currentColor, currentColor) center / 14px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 14px no-repeat;
  color: var(--muted);
  transition: transform 200ms var(--ease);
}

details[open] summary::after {
  transform: rotate(45deg);
}

details p {
  max-width: 62ch;
  margin: -6px 0 26px;
  color: var(--muted);
}

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

.site-foot {
  padding: 64px 0 calc(48px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}

.foot-row {
  display: grid;
  gap: 14px;
}

.foot-line {
  margin: 10px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 640;
  letter-spacing: -0.04em;
}

.foot-small {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--faint);
}

/* ---------- motion: things rise a few pixels as they arrive ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 800ms var(--ease),
    transform 800ms var(--ease),
    box-shadow var(--tone-time) var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Without the script, everything simply shows. */
.no-js .reveal,
.no-js .words .w {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    animation-duration: 1ms !important;
  }

  .reveal,
  .words .w {
    opacity: 1;
    transform: none;
  }
}

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-grid.flip > .feature-copy {
    order: 0;
  }

  .facts-grid,
  .platforms,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .head-nav a:not(.btn) {
    display: none;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .hide-sm {
    display: none;
  }

  .window {
    border-radius: 12px;
  }

  .window-bar {
    height: 34px;
  }
}
