/*
  TryMyDays public web — one stylesheet, no framework, no preprocessor.

  Palette and type follow the mobile app's single visual foundation
  (apps/mobile/src/ui/tokens.ts): a warm near-white product shell, near-black
  ink, one blue interaction accent, one pink emotional accent, one yellow
  highlight. The dark board mirrors the same keys. The four registered legal
  routes are verified after deployment against this exact file's bytes
  (src/legal/deployed-verifier.ts), so any change here is a legal-chrome
  change and must be redeployed together with those routes.
*/

:root {
  color-scheme: light dark;
  --bg: #f8f7f3;
  --bg-sheet: #fcfbf8;
  --surface: #ffffff;
  --surface-2: #efeeea;
  --surface-inverse: #0a0c0f;
  --ink: #0b0c0f;
  --ink-2: #555a62;
  --muted: #6a6f77;
  --on-inverse: #f6f7f9;
  --on-inverse-2: #b8bbc1;
  --blue: #1554ff;
  --blue-pressed: #0e43d8;
  --blue-soft: #e8eeff;
  --pink: #f451a2;
  --pink-text: #cc2675;
  --pink-soft: #ffe5f1;
  --yellow: #ffd84a;
  --yellow-soft: #fff5ce;
  --on-highlight: #15130a;
  --line: #e2e1dd;
  --line-strong: #c8c7c2;
  --focus: #1554ff;
  --note-bg: #fcf0d9;
  --note-border: #e6c98a;
  --note-ink: #5a3a05;
  --max-width: 1040px;
  --text-width: 68ch;
  --radius: 16px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e11;
    --bg-sheet: #0e1114;
    --surface: #111519;
    --surface-2: #1a1f24;
    --surface-inverse: #050608;
    --ink: #f7f6f2;
    --ink-2: #b8bbc1;
    --muted: #969ba4;
    --on-inverse: #f7f7f5;
    --on-inverse-2: #b8bbc1;
    --blue: #3568ff;
    --blue-pressed: #2855df;
    --blue-soft: #18295b;
    --pink: #ff5aae;
    --pink-text: #ff8bc5;
    --pink-soft: #45182f;
    --yellow: #f0d65b;
    --yellow-soft: #3d361b;
    --line: #23282e;
    --line-strong: #363c44;
    --focus: #6f92ff;
    --note-bg: #2a2210;
    --note-border: #6b551f;
    --note-ink: #f0d998;
  }
}

* {
  box-sizing: border-box;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: var(--blue-pressed);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus-visible {
  top: 12px;
}

.content-anchor {
  height: 0;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
}

.wordmark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: var(--surface-2);
}

/* Page content */

.page {
  padding-top: 40px;
  padding-bottom: 80px;
}

.page h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4.5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.page h2 {
  margin: 0 0 10px;
  font-size: clamp(21px, 2.6vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.lede {
  max-width: var(--text-width);
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 18px;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: var(--blue);
  color: #ffffff;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--blue-pressed);
  color: #ffffff;
}

.button.quiet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button.quiet:hover,
.button.quiet:focus-visible {
  border-color: var(--ink);
  color: var(--ink);
}

/* Home: hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
  padding: 16px 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--on-highlight);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (prefers-color-scheme: dark) {
  .eyebrow {
    color: var(--yellow);
  }
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero h1 .accent {
  color: var(--blue);
}

.hero-copy {
  max-width: 54ch;
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 19px;
}

.hero-slogan {
  margin: 0 0 24px;
  color: var(--pink-text);
  font-size: 16px;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.hero-note {
  max-width: 54ch;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Home: phone-style loop visual, pure CSS */

.hero-visual {
  display: flex;
  justify-content: center;
}

.phone {
  width: min(300px, 100%);
  padding: 14px;
  border-radius: 40px;
  background: var(--surface-inverse);
  color: var(--on-inverse);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.5);
}

.phone-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 520px;
  padding: 20px 16px;
  border-radius: 28px;
  background: linear-gradient(160deg, #15191f 0%, #0a0c0f 60%);
}

.phone-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-logo {
  width: 40px;
  height: auto;
}

.phone-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-inverse-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.phone-day {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.phone-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.phone-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

.phone-step-time {
  flex: none;
  min-width: 38px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--on-inverse-2);
}

.phone-step-clip {
  flex: none;
  width: 28px;
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(145deg, #3568ff, #f451a2);
  opacity: 0.9;
}

.phone-step.done .phone-step-clip {
  background: linear-gradient(145deg, #12b37a, #3568ff);
}

.phone-step.skipped .phone-step-clip {
  background: repeating-linear-gradient(135deg, #3a3f47 0 4px, #24282e 4px 8px);
}

.phone-step-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}

.phone-step-state {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-inverse-2);
}

.phone-step.done .phone-step-state {
  color: #6fe0b4;
}

.phone-cta {
  margin-top: auto;
  padding: 14px;
  border-radius: 999px;
  background: #ffffff;
  color: #05070b;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

/* Home: sections */

.section {
  margin-top: 72px;
}

.section-head {
  max-width: var(--text-width);
  margin-bottom: 28px;
}

.section-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 17px;
}

.loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: loop;
}

.loop-step {
  position: relative;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.loop-step::before {
  counter-increment: loop;
  content: counter(loop);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.loop-step h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.loop-step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

.loop-step .term {
  color: var(--pink-text);
  font-weight: 700;
}

.loop-note {
  max-width: var(--text-width);
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compare-card {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.compare-card.is {
  background: var(--blue-soft);
  border-color: transparent;
}

.compare-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.compare-card ul {
  margin: 0;
  padding-left: 20px;
}

.compare-card li {
  margin: 8px 0;
  color: var(--ink);
}

.compare-card li + li {
  margin-top: 8px;
}

.status {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface-inverse);
  color: var(--on-inverse);
}

.status h2 {
  color: inherit;
}

.status p {
  margin: 0 0 12px;
  color: var(--on-inverse-2);
  font-size: 16px;
}

.status p:last-child {
  margin-bottom: 0;
}

.status a {
  color: #9db4ff;
}

.status-facts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-facts li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

.status-facts strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-inverse-2);
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.status .button.primary {
  background: #ffffff;
  color: #05070b;
}

.status .button.primary:hover,
.status .button.primary:focus-visible {
  background: #e8eeff;
  color: #05070b;
}

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

.link-grid a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.link-grid a:hover,
.link-grid a:focus-visible {
  border-color: var(--ink);
}

.link-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.link-grid span {
  display: block;
  color: var(--ink-2);
  font-size: 14px;
}

/* Article-style pages (support, deletion, informational, legal) */

.article-page,
.legal-page {
  max-width: var(--text-width);
}

.legal-page p,
.article-page p,
.legal-page li,
.article-page li {
  font-size: 16px;
}

.legal-intro p,
.article-page .lede {
  color: var(--ink-2);
}

.legal-section,
.article-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.legal-section h2,
.article-section h2 {
  font-size: 22px;
}

.legal-section p,
.article-section p {
  margin: 10px 0;
  color: var(--ink);
}

.legal-section ul,
.article-section ul,
.legal-section ol,
.article-section ol {
  margin: 10px 0;
  padding-left: 22px;
}

.legal-section li,
.article-section li {
  margin: 6px 0;
}

.legal-metadata {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.legal-artifact-bytes {
  font: inherit;
  line-height: 1.7;
  margin: 2rem 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 20px 0;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.contact-card strong {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.contact-card a {
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.contact-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

.steps {
  margin: 12px 0;
  padding-left: 24px;
}

.steps li {
  margin: 8px 0;
}

.draft-banner,
.info-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 28px;
  padding: 14px 16px;
  border: 1px solid var(--note-border);
  border-radius: var(--radius-sm);
  background: var(--note-bg);
  color: var(--note-ink);
}

.draft-banner strong,
.info-banner strong {
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.draft-banner span,
.info-banner span {
  font-size: 14px;
}

.draft-banner a,
.info-banner a {
  color: inherit;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-sheet);
}

.site-footer .wrap {
  padding-top: 40px;
  padding-bottom: 40px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 32px;
  margin-bottom: 28px;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer-tagline {
  flex-basis: 100%;
  color: var(--ink-2);
  font-size: 14px;
}

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

.footer-heading {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.footer-fine-print {
  max-width: 70ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Responsive */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .loop {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status {
    grid-template-columns: 1fr;
  }

  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .site-header-row {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .nav-links a {
    padding: 8px 8px;
    font-size: 13px;
  }

  .page {
    padding-top: 28px;
    padding-bottom: 56px;
  }

  .hero h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  .hero-copy {
    font-size: 17px;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .phone-screen {
    min-height: 440px;
  }

  .section {
    margin-top: 52px;
  }

  .loop,
  .compare,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .status {
    padding: 22px 18px;
  }

  .footer-groups {
    grid-template-columns: 1fr 1fr;
  }
}
