/* ------------------------------------------------------------------ tokens */
:root {
  --paper: #F7F5F0;
  --ink: #1A1A1A;
  --accent: #6E8F7A;          /* muted sage: numbers and small markers only */
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad: clamp(20px, 4vw, 56px);
  --maxw: 1320px;
}

/* Each section defines its own foreground/background; everything else reads these. */
.light { --bg: var(--paper); --fg: var(--ink); --muted: rgba(26, 26, 26, 0.55); --line: rgba(26, 26, 26, 0.12); --dim: rgba(26, 26, 26, 0.13); --surface: #EFECE5; }
.dark  { --bg: var(--ink); --fg: var(--paper); --muted: rgba(247, 245, 240, 0.5); --line: rgba(247, 245, 240, 0.12); --dim: rgba(247, 245, 240, 0.12); --surface: #222222; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); position: relative; z-index: 1; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px var(--pad);
  color: var(--ink);
  background: rgba(247, 245, 240, 0.82);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid rgba(26, 26, 26, 0.06);
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; }
.mark { width: 20px; height: 20px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; opacity: 0.6; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  height: 44px; padding: 0 6px 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn .sq {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px;
  background: var(--accent); color: var(--paper); font-family: var(--sans); font-size: 14px;
}
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #000; }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #ffffff; }
.btn-outline { padding: 0 18px; border-color: currentColor; color: var(--fg, var(--ink)); background: transparent; }
.btn-outline:hover { background: var(--fg); color: var(--bg); }
.btn-sm { height: 36px; padding-left: 14px; }
.btn-sm .sq { width: 26px; height: 26px; font-size: 12px; }
.btn-lg { height: 56px; padding-left: 24px; font-size: 12px; }
.btn-lg .sq { width: 42px; height: 42px; font-size: 16px; }

/* ------------------------------------------------------------------ sections */
.section {
  position: relative; overflow: hidden;
  background: var(--bg); color: var(--fg);
  padding: clamp(96px, 14vw, 170px) 0 clamp(80px, 10vw, 140px);
}

.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
}
.dark .tag { background: var(--surface); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.tag .num { color: var(--accent); }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.section-head { display: flex; align-items: center; gap: 20px; margin-bottom: clamp(48px, 7vw, 96px); }
.rule { flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------------ headlines
   The signature effect: each line starts partly "sunk" into the background
   (--dim, nearly the section colour) and fills in left-to-right as the
   section scrolls into view. main.js sets --p (0..1) per line. */
.headline {
  margin: 0;
  font-weight: 400;
  font-size: clamp(48px, 9.2vw, 136px);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.headline .line {
  --p: 1;
  display: block; width: fit-content; padding-bottom: 0.06em;
  color: var(--fg);
}
.js .headline .line {
  color: transparent;
  /* Soft 8%-wide edge; scaled so p = 1 is fully solid (no faded last letter). */
  background-image: linear-gradient(90deg,
    var(--fg) calc(var(--p) * 108% - 4%),
    var(--dim) calc(var(--p) * 108% + 4%));
  -webkit-background-clip: text;
  background-clip: text;
}

/* ------------------------------------------------------------------ decorative bars */
.bars {
  position: absolute; inset: auto 0 0 0; height: 100%;
  display: grid; grid-template-columns: repeat(8, 1fr);
  align-items: end; pointer-events: none; z-index: 0;
}
.bars i {
  display: block; height: var(--h);
  border: 1px solid var(--line); border-bottom: 0;
  margin-right: -1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
}
.bars-low { opacity: 0.8; }

/* ------------------------------------------------------------------ hero */
.hero { min-height: 100svh; display: flex; align-items: stretch; padding-top: 0; padding-bottom: 0; }
.hero-inner { display: flex; flex-direction: column; justify-content: center; min-height: 100svh; padding-top: 120px; padding-bottom: 48px; }
.hero .tag { align-self: flex-start; margin-bottom: clamp(28px, 4vw, 44px); }
.hero .headline { font-size: clamp(56px, 11vw, 168px); }
.hero-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  margin-top: auto; padding-top: clamp(48px, 8vw, 96px);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.aside { margin: 0; max-width: 300px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ------------------------------------------------------------------ how it works */
.head-grid { display: grid; grid-template-columns: 1fr 3fr; align-items: end; gap: 32px; margin-bottom: clamp(56px, 8vw, 110px); }
.aside-left { max-width: 220px; font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  background: #141414; border: 1px solid var(--line); border-radius: 4px;
  padding: 20px; min-height: 360px;
}
/* App screenshot framed as a small Mac window. */
.shot {
  margin: 0 0 28px;
  border: 1px solid rgba(247, 245, 240, 0.14); border-radius: 10px;
  overflow: hidden; background: #000;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.shot-bar { display: flex; gap: 6px; padding: 9px 10px; background: #161616; border-bottom: 1px solid rgba(247, 245, 240, 0.08); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(247, 245, 240, 0.18); }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; }
.card h3 { margin: 0 0 8px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.card p { margin: 0 0 28px; font-size: 13px; color: var(--muted); max-width: 30ch; }
.card-foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; color: var(--muted);
}
.chip { padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--accent); }

/* ------------------------------------------------------------------ philosophy */
.aside-corner { margin: clamp(48px, 7vw, 96px) 0 0 auto; max-width: 360px; font-size: 15px; }

/* ------------------------------------------------------------------ download */
.download { margin-top: clamp(48px, 7vw, 88px); max-width: 720px; }
.meta { margin: 14px 0 0; color: var(--muted); }

/* Post-install steps: same weight as the download button, plain and direct. */
.install {
  margin-top: 40px; max-width: 720px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(247, 245, 240, 0.03);
}
.install-title { margin: 0 0 18px; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 0 0 20px 44px; font-size: 17px; line-height: 1.5; color: var(--fg);
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  background: var(--accent); color: var(--paper);
}
kbd {
  font-family: var(--mono); font-size: 0.8em;
  padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--line); border-bottom-width: 2px;
  background: rgba(247, 245, 240, 0.06);
}
.install-foot { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }

/* The command: its own block, darker than the section, easy to copy. */
.code {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px;
  background: #0E0E0E; color: var(--paper);
  border: 1px solid rgba(247, 245, 240, 0.14); border-radius: 10px;
  padding: 12px 12px 12px 18px;
}
.code code {
  /* Wrap instead of scrolling sideways, so the whole command is always visible. */
  flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: var(--mono); font-size: 14px; line-height: 1.6;
  user-select: all; -webkit-user-select: all; /* one click selects the whole line */
}
.copy {
  flex: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  border: 0; border-radius: 8px; padding: 9px 14px;
  background: var(--paper); color: var(--ink);
  transition: background-color .2s;
}
.copy:hover { background: #fff; }
.copy.copied { background: var(--accent); color: var(--paper); }

/* ------------------------------------------------------------------ waitlist */
.waitlist { margin-top: clamp(48px, 7vw, 88px); display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: end; max-width: 980px; }
.form {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 22px;
}
.form input[type="email"] {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg);
  font-family: var(--sans); font-size: 16px; height: 44px;
}
.form input::placeholder { color: var(--muted); }
.form:focus-within { border-color: var(--accent); }
.form-status { grid-column: 2; margin: 0; min-height: 1.5em; color: var(--muted); }
.form-status.ok { color: var(--accent); }
.form-status.err { color: #A64B4B; }
.dark .form-status.err { color: #D9A3A3; }

/* ------------------------------------------------------------------ footer */
.footer { background: var(--ink); color: var(--paper); border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 36px; padding-bottom: 36px; }
.footer-link { text-decoration: none; color: var(--muted); }
.footer-link:hover { color: var(--paper); }

/* ------------------------------------------------------------------ scroll fade-ins */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .head-grid { grid-template-columns: 1fr; }
  .head-grid .aside-left { order: 2; }
  .waitlist { grid-template-columns: 1fr; }
  .form-status { grid-column: 1; }
  .bars { grid-template-columns: repeat(5, 1fr); }
  .bars i:nth-child(n+6) { display: none; }
}
@media (max-width: 560px) {
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; justify-content: space-between; }
  .btn-lg { width: 100%; justify-content: space-between; }
  .form { flex-direction: column; align-items: stretch; border-radius: 16px; padding: 8px; }
  .form input[type="email"] { padding: 0 12px; }
  .form .btn { justify-content: space-between; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .code { flex-direction: column; align-items: stretch; padding: 14px; }
  .copy { padding: 11px 14px; }
}

/* ------------------------------------------------------------------ download disclaimer modal */
.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto; padding: 0; border: 0; border-radius: 20px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: auto;
}
.modal::backdrop { background: rgba(26, 26, 26, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal[open] { animation: modal-in .22s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-inner { padding: clamp(24px, 5vw, 40px); }
.modal .tag { margin-bottom: 20px; }
.modal h2 { margin: 0 0 18px; font-size: clamp(30px, 5vw, 40px); font-weight: 400; line-height: 1; letter-spacing: -0.04em; }
.modal p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: rgba(26, 26, 26, 0.75); }
.modal .lead { color: var(--ink); font-weight: 500; }
.modal ul { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid rgba(26, 26, 26, 0.12); }
.modal li { position: relative; padding: 10px 0 10px 26px; font-size: 14.5px; line-height: 1.5; border-bottom: 1px solid rgba(26, 26, 26, 0.12); color: rgba(26, 26, 26, 0.8); }
.modal li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.modal .sign-off { color: var(--ink); font-weight: 500; margin-bottom: 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.modal .btn-outline { --fg: var(--ink); --bg: var(--paper); }
body.modal-open { overflow: hidden; }
@media (max-width: 560px) {
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; justify-content: space-between; }
  .modal-actions .btn-outline { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }
