/* Ryth landing page. Tokens are copied from Ryth's src/index.css (light by default, dark follows the device). */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/inter-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  color-scheme: light;
  --bg-canvas: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8f8fa;
  --bg-elevated: #eaeaef;
  --bg-input: #ffffff;
  --bg-selected: #ffffff;
  --border-subtle: #e2e2e7;
  --border-focus: #c4c4cc;
  --text-primary: #1a1a1f;
  --text-secondary: #55555f;
  --text-muted: #6d6d78;
  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-text: #1d4ed8;
  --accent-soft: #eaf1ff;
  --on-accent: #ffffff;
  --status-danger: #dc2626;
  --shadow-float: 0 16px 40px rgba(20, 20, 26, 0.14), 0 2px 8px rgba(20, 20, 26, 0.06);
  --shadow-segment: 0 1px 2px rgba(20, 20, 26, 0.08);
  --font-main: 'Inter Variable', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg-canvas: #111113;
    --bg-surface: #1c1c1f;
    --bg-surface-hover: #222226;
    --bg-elevated: #27272b;
    --bg-input: #18181b;
    --bg-selected: #3a3a40;
    --border-subtle: #2e2e33;
    --border-focus: #4a4a52;
    --text-primary: #f2f2f4;
    --text-secondary: #a6a6b0;
    --text-muted: #8a8a94;
    --accent-primary: #2563eb;
    --accent-hover: #3570f0;
    --accent-text: #7aa7ff;
    --accent-soft: rgba(59, 130, 246, 0.16);
    --status-danger: #f87171;
    --shadow-float: 0 0 0 1px var(--border-subtle);
    --shadow-segment: none;
  }
}

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0;
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3, p, ol, ul { margin: 0; }
  a { color: var(--accent-text); text-underline-offset: 2px; }
  :focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
  [hidden] { display: none !important; }
}

.wrap {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
@media (min-width: 768px) { .wrap { padding: 0 24px; } }
@media (min-width: 960px) { .wrap-wide { max-width: 1040px; } }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: max(1rem, env(safe-area-inset-top));
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
}
.brand img { width: 32px; height: 32px; display: block; }

/* Language switch: the same segmented control as in the app, the current language is the raised segment */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg-elevated);
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms;
}
.lang-switch a:hover { color: var(--text-primary); }
.lang-switch a[aria-current] {
  background: var(--bg-selected);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-segment);
}

/* First screen: text and form, on wide screens with the phone beside it */
.intro { display: grid; gap: 40px; padding-top: 24px; }
@media (min-width: 960px) {
  .intro { grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; align-items: center; padding-top: 48px; }
}
.hero h1 {
  text-wrap: balance;
  font-size: clamp(32px, 8.5vw, 48px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.h1-quiet { display: block; color: var(--text-muted); }
.lead {
  max-width: 30rem;
  margin-top: 12px;
  font-size: 17px;
  color: var(--text-secondary);
}

/* Sign-up card */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}
.signup { margin-top: 20px; padding: 16px; }
@media (min-width: 640px) { .signup { padding: 20px; } }
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.email-row { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 560px) {
  .email-row { flex-direction: row; }
  .email-row .input { flex: 1; }
}
.input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 16px;
  transition: border-color 150ms, box-shadow 150ms;
}
.input::placeholder { color: var(--text-muted); }
.input:hover { border-color: var(--border-focus); }
.input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary {
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-primary);
  color: var(--on-accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms, transform 150ms;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.btn-ghost {
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }
.btn-ghost:disabled { opacity: 0.4; cursor: default; }

.step-title { font-size: 16px; font-weight: 600; }
.step-text { margin-top: 2px; font-size: 14px; color: var(--text-secondary); }
.questions { display: grid; gap: 8px; margin-top: 16px; }
.questions fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.questions legend { padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0 8px; }
.choice { position: relative; display: inline-flex; align-items: center; min-height: 44px; }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 150ms, color 150ms;
}
.choice input:checked + span { background: var(--accent-primary); color: var(--on-accent); }
.choice input:focus-visible + span { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.step-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
@media (min-width: 560px) { .step-actions { flex-direction: row; align-items: center; gap: 8px; } }
/* Headings that only receive focus for screen readers after a step change */
[tabindex="-1"]:focus { outline: none; }

.fine { margin-top: 12px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-error { margin-top: 12px; font-size: 14px; font-weight: 500; color: var(--status-danger); }
.form-error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done-text { margin-top: 6px; color: var(--text-secondary); }

/* Phone mock-up: the sentence, then the Plan as Ryth draws it */
.demo { display: flex; justify-content: center; }
.phone {
  width: 100%;
  max-width: 340px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 36px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
}
.screen { padding: 18px 12px 14px; border-radius: 28px; background: var(--bg-canvas); }
.demo-label {
  margin: 0 4px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 48px;
  padding: 8px 6px 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-input);
  font-size: 14px;
  line-height: 20px;
}
.composer p { flex: 1; min-width: 0; min-height: 60px; padding-bottom: 2px; }
.composer p.typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 16px;
  margin-left: 1px;
  vertical-align: -3px;
  background: var(--accent-primary);
}
.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-primary);
  transition: background-color 150ms;
}
.send svg { width: 16px; height: 16px; stroke: var(--on-accent); transition: stroke 150ms; }
.demo-pending .send { background: var(--bg-elevated); }
.demo-pending .send svg { stroke: var(--text-muted); }
.demo-label-plan { margin-top: 16px; margin-bottom: 16px; }

.timeline { position: relative; padding-left: 44px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 44px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}
.row { position: relative; margin-bottom: 8px; }
.row:last-child { margin-bottom: 0; }
.tick {
  position: absolute;
  left: -44px;
  width: 36px;
  text-align: right;
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.tick-start { top: -7px; }
.tick-end { bottom: -7px; }
.tick-mid { top: calc(50% - 7px); }
.block {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 15px 12px 12px 22px;
  font-size: 14px;
  font-weight: 500;
}
.block .shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.block .shape path { fill: var(--bg-surface); stroke: var(--border-subtle); stroke-width: 1; }
.block .check {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-focus);
  border-radius: 50%;
}
.block .title { position: relative; line-height: 18px; }
.block-reminder { align-items: center; padding-top: 12px; }
.block-long { min-height: 104px; }
.block-mid { min-height: 64px; }
.free {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 8px 0 12px;
  border: 1px dashed var(--border-focus);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.free svg { width: 16px; height: 16px; stroke: var(--text-muted); }

/* The rows appear one after another once the sentence is sent (only with JavaScript and without reduced motion) */
.demo-pending .row { opacity: 0; transform: translateY(6px); }
.row { transition: opacity 200ms ease-out, transform 200ms ease-out; transition-delay: calc(var(--i, 0) * 140ms); }
.row:nth-child(2) { --i: 1; }
.row:nth-child(3) { --i: 2; }
.row:nth-child(4) { --i: 3; }
.row:nth-child(5) { --i: 4; }

/* Sections below the first screen */
.section { padding-top: 56px; }
.section h2 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.points { display: grid; gap: 8px; margin-top: 16px; padding: 0; list-style: none; }
@media (min-width: 640px) { .points { grid-template-columns: repeat(3, 1fr); } }
.points li { padding: 16px; }
.points h3 { font-size: 15px; font-weight: 600; }
.points p { margin-top: 6px; font-size: 14px; color: var(--text-secondary); }
.steps { display: grid; gap: 12px; margin-top: 16px; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: flex; gap: 12px; align-items: flex-start; counter-increment: step; }
.steps li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}
.steps p { padding-top: 3px; color: var(--text-secondary); }
.steps strong { color: var(--text-primary); font-weight: 600; }
.cta-again { margin-top: 24px; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--bg-surface-hover); border-color: var(--border-focus); }

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin-top: 64px;
  padding: 16px 0 max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.foot a, .foot span { display: inline-flex; align-items: center; min-height: 44px; }
.foot a { color: var(--text-secondary); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* Legal and confirmation pages */
.legal { padding-top: 24px; }
.legal h1, .confirmed h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.legal h2 { margin-top: 28px; font-size: 17px; font-weight: 600; }
.legal p, .legal li { margin-top: 8px; color: var(--text-secondary); }
.legal ul { padding-left: 20px; }
.legal address { margin-top: 8px; font-style: normal; color: var(--text-primary); }
.legal .stand { margin-top: 32px; font-size: 12px; color: var(--text-muted); }
.confirmed { padding-top: 48px; }
.confirmed p { max-width: 34rem; margin-top: 12px; color: var(--text-secondary); }
.confirmed h2 { font-size: 20px; font-weight: 600; }
