/* The Machine: ink on paper. One quiet page, one living element, one sentence that says what to do.
   Shared tokens and building blocks. Screen-specific rules live next to each screen. */

:root {
  --paper-hi: #f7f5f0;
  --paper: #eeebe5;
  --paper-lo: #e5e1d9;
  --ink: #16181d;
  --ink-2: #3a3d44;
  --muted: #5c5f66;
  --line: rgba(22, 24, 29, 0.14);
  --line-strong: rgba(22, 24, 29, 0.28);
  --red: #c8452f;
  --red-text: #b5382a;
  --red-wash: #d9503c;
  --blue: #2b4a8b;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-edge: rgba(255, 255, 255, 0.92);
  --shadow-soft: 0 10px 30px rgba(22, 24, 29, 0.06);
  --shadow-card: 0 24px 60px rgba(22, 24, 29, 0.1);
  --shadow-ink: 0 14px 34px rgba(22, 24, 29, 0.22);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 6vw, 96px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body, #root { min-height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.5; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* ── page frame */
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: max(24px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: radial-gradient(120% 80% at 50% 0%, var(--paper-hi) 0%, var(--paper) 55%, var(--paper-lo) 100%);
}
.page-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.side-label {
  position: absolute; left: 30px; top: 132px;
  writing-mode: vertical-rl;
  font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted);
  pointer-events: none;
}
@media (max-width: 900px) { .side-label { display: none; } }
/* phone: the mark alone, so the product switch fits on the same row and the screen keeps its height */
@media (max-width: 480px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top { flex-wrap: nowrap; }
  .switch button { height: 40px; padding: 0 14px; font-size: 14px; }
  .page { gap: 16px; }
}

/* ── header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; color: var(--ink); }
.brand-mark { position: relative; width: 28px; height: 20px; display: block; flex: none; }
.brand-mark::before { content: ""; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); }
.brand-mark::after { content: ""; position: absolute; left: 13px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--red-wash); mix-blend-mode: multiply; }
.brand-name { font-family: var(--serif); font-size: 26px; line-height: 1; }
.switch {
  display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  max-width: 100%; overflow-x: auto;
}
.switch button {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; white-space: nowrap;
}
.switch button[aria-pressed="true"] { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(22, 24, 29, 0.12); }

/* ── bottom navigation pill */
.nav {
  position: sticky; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  align-self: center; margin-top: auto; max-width: 100%;
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 999px; overflow-x: auto;
  background: rgba(255, 255, 255, 0.62); border: 1px solid var(--glass-edge);
  box-shadow: 0 16px 44px rgba(22, 24, 29, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.nav a {
  position: relative; display: flex; align-items: center; justify-content: center; height: 44px; min-width: 44px;
  padding: 0 clamp(11px, 1.6vw, 20px); border-radius: 999px; color: var(--ink); text-decoration: none;
  font-size: 15px; font-weight: 500; white-space: nowrap;
}
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper-hi); font-weight: 600; }
.nav a.nav-ask { padding: 0; width: 44px; flex: none; }
.nav .nav-dot { position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
/* phone: six words and the Ask button fit on one row without scrolling (down to 375 px wide) */
@media (max-width: 480px) {
  .nav { margin-inline: -12px; max-width: calc(100% + 24px); gap: 1px; padding: 4px; }
  .nav a { font-size: 14px; padding: 0 5px; }
}

/* ── type */
.eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.serif { font-family: var(--serif); font-weight: 400; }
.h-hero { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 5.4vw, 76px); line-height: 0.98; letter-spacing: -0.01em; text-wrap: balance; }
.h-screen { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 64px); line-height: 1; letter-spacing: -0.01em; text-wrap: balance; }
.h-card { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.05; }
.h-line { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.14; }
.lead { font-size: 18px; color: var(--ink-2); }
.body-2 { font-size: 15px; color: var(--ink-2); }
.small { font-size: 14px; color: var(--muted); }
.tiny { font-size: 13px; color: var(--muted); }
.strong { font-weight: 600; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.red { color: var(--red-text); }

/* ── state dots */
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.dot.blue { background: var(--blue); }
.dot.red { background: var(--red); }
.dot.hollow { background: transparent; border: 1.5px solid var(--muted); }

/* ── surfaces */
.glass {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 28px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.pad { padding: 26px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.g4 { gap: 4px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; } .g16 { gap: 16px; } .g20 { gap: 20px; } .g24 { gap: 24px; } .g32 { gap: 32px; } .g40 { gap: 40px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { align-items: center; justify-content: center; }
.between { justify-content: space-between; }

/* ── buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.55); color: var(--ink);
  font-size: 16px; font-weight: 600; text-decoration: none;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover:not(:disabled) { background: var(--white); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.ink { border: 0; background: var(--ink); color: var(--paper-hi); box-shadow: var(--shadow-ink); }
.btn.ink:hover:not(:disabled) { background: #000; }
.btn.big { min-height: 68px; border-radius: 22px; font-size: 19px; }
.btn.small-btn { min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 500; }
.btn.block { display: flex; width: 100%; }
.link-btn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.55); color: var(--ink); font-size: 15px; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper-hi); border-color: var(--ink); }

/* ── talk button and listening bars */
.talk {
  flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 0;
  background: var(--ink); color: var(--paper-hi); box-shadow: 0 16px 36px rgba(22, 24, 29, 0.26);
  width: 84px; height: 84px;
}
.talk.mid { width: 60px; height: 60px; }
.talk.quiet { background: var(--white); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.talk.live { background: var(--red); color: var(--white); box-shadow: 0 16px 36px rgba(200, 69, 47, 0.35); }
.talk .stop { width: 24px; height: 24px; border-radius: 6px; background: var(--white); }
.talk.mid .stop { width: 18px; height: 18px; border-radius: 5px; }
.bars { display: flex; align-items: center; gap: 5px; height: 44px; }
.bars span { width: 5px; height: 38px; border-radius: 3px; background: var(--ink); transform-origin: center; animation: bar 0.6s ease-in-out infinite alternate; }
.bars span:nth-child(2) { animation-duration: 0.75s; } .bars span:nth-child(3) { animation-duration: 0.45s; }
.bars span:nth-child(4) { animation-duration: 0.85s; } .bars span:nth-child(5) { animation-duration: 0.55s; }
.bars span:nth-child(6) { animation-duration: 0.7s; }
@keyframes bar { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }

/* ── fields */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); }
.input, .textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 16px; border: 1px solid rgba(22, 24, 29, 0.18);
  background: var(--white); font-size: 17px; color: var(--ink);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
.money { display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 14px; border-radius: 16px; background: var(--white); border: 1px solid rgba(22, 24, 29, 0.18); }
.money input { width: 100%; min-width: 0; border: 0; background: transparent; font-size: 18px; outline-offset: 6px; }
.money span { font-size: 18px; color: var(--muted); }

/* ── lists with hairlines */
.lines > * { border-top: 1px solid var(--line); }
.lines > *:last-child { border-bottom: 1px solid var(--line); }
.line-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; text-decoration: none; color: var(--ink); min-height: 44px; }
.line-row .t { font-size: 18px; font-weight: 600; }
.line-row .s { font-size: 14px; color: var(--muted); }

/* ── refusals: what went wrong and what to do */
.notice {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px;
  background: rgba(200, 69, 47, 0.08); border: 1px solid rgba(200, 69, 47, 0.35); color: var(--ink);
  font-size: 15px;
}
.notice .notice-title { font-weight: 600; color: var(--red-text); }
.notice.calm { background: rgba(43, 74, 139, 0.07); border-color: rgba(43, 74, 139, 0.3); }
.notice.calm .notice-title { color: var(--blue); }

/* ── a 9:16 video frame */
.frame {
  position: relative; aspect-ratio: 9 / 16; border-radius: 30px; overflow: hidden; background: #121317;
  box-shadow: 0 34px 80px rgba(22, 24, 29, 0.3), 0 2px 0 rgba(255, 255, 255, 0.5);
}
.frame video, .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.frame .frame-tag {
  position: absolute; bottom: 12px; padding: 6px 12px; border-radius: 999px; pointer-events: none;
  background: rgba(22, 24, 29, 0.45); border: 1px solid rgba(255, 255, 255, 0.3); color: var(--white); font-size: 13px; font-weight: 500;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.frame .frame-tag.l { left: 12px; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame .frame-tag.r { right: 12px; }

/* ── two-column screens */
.cols { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(28px, 5vw, 80px); }
.cols.top-align { align-items: flex-start; padding-top: 8px; }

/* ── empty and loading */
.quiet-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 48px 0; flex: 1 1 auto; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .bars span, .spinner, .ink-blob { animation: none !important; }
  .btn { transition: none; }
}
