/* ration — site stylesheet
   Tokens mirror the Ration V3 iOS design system (phthalo-gold default theme,
   phthalo-gold-light companion). Dark is the brand default; light follows the
   viewer's system setting or an explicit data-theme stamp. */

/* ---------- tokens: dark (brand default) ---------- */
:root {
  --bg-app: #0a1a1a;
  --surface: #0e2020;
  --surface-2: #132828;
  --surface-3: #1a3030;
  --border: #1f3636;
  --border-strong: #2a4545;
  --text: #f2ece0;
  --text-strong: #ffffff;
  --text-muted: #9aafa9;
  --text-dim: #60787a;
  --accent: #4db896;
  --accent-deep: #2e7d6c;
  --editorial: #c9a36f;
  --editorial-dim: #8c7352;
  --on-accent: #0a1a1a;
  --tint-accent: rgba(77, 184, 150, 0.12);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 24px;
  --measure: 38rem;
  --wide: 66rem;
  --radius-card: 14px;
  --radius-control: 12px;
  --radius-pill: 999px;

  --dur-fast: 150ms;
  --ease: cubic-bezier(0.4, 0.8, 0.2, 1);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-app: #f4eadc;
    --surface: #fbf4e4;
    --surface-2: #ede2cc;
    --surface-3: #e5d9be;
    --border: #d8c9ac;
    --border-strong: #b8a685;
    --text: #1a2828;
    --text-strong: #0a1a1a;
    --text-muted: #5e5246;
    --text-dim: #8e8170;
    --accent: #1f6b5c;
    --accent-deep: #12413a;
    --editorial: #8f6b38;
    --editorial-dim: #b89263;
    --on-accent: #f4eadc;
    --tint-accent: rgba(31, 107, 92, 0.1);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg-app: #f4eadc;
  --surface: #fbf4e4;
  --surface-2: #ede2cc;
  --surface-3: #e5d9be;
  --border: #d8c9ac;
  --border-strong: #b8a685;
  --text: #1a2828;
  --text-strong: #0a1a1a;
  --text-muted: #5e5246;
  --text-dim: #8e8170;
  --accent: #1f6b5c;
  --accent-deep: #12413a;
  --editorial: #8f6b38;
  --editorial-dim: #b89263;
  --on-accent: #f4eadc;
  --tint-accent: rgba(31, 107, 92, 0.1);
  color-scheme: light;
}

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-app);
  color: var(--text);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease);
}

a:hover { color: var(--text-strong); }

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

::selection {
  background: var(--tint-accent);
  color: var(--text-strong);
}

em { font-style: italic; }

/* ---------- type roles ---------- */
.overline {
  font: 500 10px/1.4 var(--font-body);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.125rem, 1.4rem + 3.1vw, 2.875rem);
  line-height: 1.1;
  letter-spacing: 0.005em;
  color: var(--text-strong);
  margin: 0;
  text-wrap: balance;
}

.display em {
  font-weight: 500;
  color: var(--editorial);
}

.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 1.1rem + 1.7vw, 1.875rem);
  line-height: 1.25;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}

.tagline em {
  font-weight: 600;
  color: var(--editorial);
}

.section-title {
  font: 600 1.375rem/1.2 var(--font-display);
  color: var(--text-strong);
  margin: 0;
  text-wrap: balance;
}

.block-title {
  font: 500 1.25rem/1.25 var(--font-display);
  color: var(--text-strong);
  margin: 0;
}

.lede {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
  max-width: var(--measure);
}

.meta {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-dim);
  margin: 0;
}

/* placeholder values the build has to resolve before launch */
.ph {
  color: var(--editorial);
  border-bottom: 1px dashed var(--editorial-dim);
  white-space: nowrap;
}

/* ---------- layout ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface-2);
  color: var(--text-strong);
  padding: 10px 16px;
  border-radius: var(--radius-control);
  z-index: 10;
}

.skip:focus { left: var(--gutter); top: 10px; }

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: color-mix(in srgb, var(--bg-app) 92%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.wordmark {
  font: 600 1.0625rem/1 var(--font-body);
  letter-spacing: -0.01em;
  color: var(--text-strong);
  text-decoration: none;
  text-transform: lowercase;
}

.wordmark:hover { color: var(--text-strong); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a {
  font: 500 0.8125rem/1 var(--font-body);
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
}

.nav a:hover { color: var(--text-strong); }

.nav a[aria-current="page"] {
  color: var(--text-strong);
  background: var(--tint-accent);
}

main { display: block; }

.section {
  padding-block: clamp(40px, 7vw, 72px);
  border-top: 1px solid var(--border);
}

.section:first-of-type { border-top: 0; }

.section > .wrap { display: grid; gap: clamp(20px, 3vw, 28px); }

.hero {
  padding-block: clamp(48px, 10vw, 104px) clamp(40px, 7vw, 72px);
}

.hero > .wrap { gap: 20px; }

/* From laptop width the section head moves to a left rail and the content sits
   on its own axis. Hero blocks stay on the rail axis so the page has one spine. */
@media (min-width: 62rem) {
  .section:not(.hero) > .wrap {
    grid-template-columns: 15rem minmax(0, 1fr);
    column-gap: 56px;
  }

  .section:not(.hero) > .wrap > * { grid-column: 2; }

  .section:not(.hero) > .wrap > .stack-s:first-child {
    grid-column: 1;
    align-self: start;
  }

  .section.doc > .wrap { grid-template-columns: minmax(0, 1fr); }
  .section.doc > .wrap > * { grid-column: 1; }
}

.stack { display: grid; gap: 16px; }
.stack-s { display: grid; gap: 10px; }
.stack-l { display: grid; gap: 28px; }

/* ---------- cards and rows ---------- */
.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface-2);
}

.steps li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 4px 14px;
  padding: 18px 20px;
  border-top: 1px solid var(--border);
}

.steps li:first-child { border-top: 0; }

.steps .step-n {
  grid-row: span 2;
  font: 500 1.125rem/1.3 var(--font-display);
  color: var(--editorial);
  font-variant-numeric: tabular-nums;
}

.steps .step-t {
  font: 600 0.9375rem/1.4 var(--font-body);
  color: var(--text-strong);
}

.steps .step-d {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.terms-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.terms-list div {
  display: grid;
  gap: 2px;
  padding-left: 14px;
  border-left: 1px solid var(--border-strong);
}

.terms-list dt {
  font: 600 0.9375rem/1.5 var(--font-body);
  color: var(--text-strong);
}

.terms-list dd {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.note {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  padding: 16px 18px;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: var(--measure);
}

.note strong { color: var(--text-strong); font-weight: 600; }

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

.pill {
  font: 500 0.75rem/1 var(--font-body);
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 0.75rem/1 var(--font-body);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  width: fit-content;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- long-form documents ---------- */
.doc { padding-block: clamp(32px, 6vw, 56px); }

.doc-grid {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 62rem) {
  .doc-grid { grid-template-columns: 15rem minmax(0, 1fr); }
  .toc {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 84px);
  }
}

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  counter-reset: toc;
}

.toc a {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-decoration: none;
}

.toc a:hover { color: var(--text-strong); }

.prose { max-width: var(--measure); }

.prose h2 {
  font: 600 1.375rem/1.25 var(--font-display);
  color: var(--text-strong);
  margin: 40px 0 10px;
  scroll-margin-top: 90px;
}

.prose h2:first-child { margin-top: 0; }

.prose h3 {
  font: 600 0.9375rem/1.4 var(--font-body);
  color: var(--text-strong);
  margin: 24px 0 6px;
}

.prose p { margin: 0 0 14px; color: var(--text); }

.prose ul,
.prose ol { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; }

.prose li { color: var(--text); }

.prose li::marker { color: var(--editorial-dim); }

.table-wrap {
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control, 12px);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.prose thead th {
  border-top: 0;
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 600;
}

.faq .answer ul,
.faq .answer ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.doc-head {
  display: grid;
  gap: 10px;
  padding-bottom: 24px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.faq {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface-2);
}

.faq details { border-top: 1px solid var(--border); }
.faq details:first-child { border-top: 0; }

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font: 600 0.9375rem/1.45 var(--font-body);
  color: var(--text-strong);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

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

.faq summary::after {
  content: "+";
  color: var(--editorial);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1;
}

.faq details[open] summary::after { content: "\2013"; }

.faq .answer {
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: var(--measure);
}

.faq .answer p { margin: 0 0 10px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px));
  margin-top: clamp(40px, 7vw, 72px);
}

.site-footer .wrap {
  display: grid;
  gap: 24px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 48px;
  justify-content: space-between;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-nav a:hover { color: var(--text-strong); }

.footer-legal {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
