/* Shared styles for the MatchMachine help and legal pages. Tokens match the live landing page. */
:root {
  --obsidian: #0D0D0F;
  --anthracite: #1A1A1E;
  --elevated: #222228;
  --graphite: #2A2A30;
  --gold: #D4A855;
  --rose: #E35F63;
  --starlight: #EDEEF0;
  --ash: #9696A0;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --measure: 54ch;
  --gutter: 20px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--obsidian);
  color: var(--starlight);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

a { color: var(--gold); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--starlight); }
:focus-visible { outline: 2px solid var(--starlight); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--obsidian);
  font-weight: 700;
  border-radius: 8px;
  z-index: 10;
}
.skip-link:focus { top: 12px; color: var(--obsidian); }

.wrap { width: min(100% - 2 * var(--gutter), 1080px); margin-inline: auto; }

/* Header */
.site-header { border-bottom: 1px solid var(--graphite); position: relative; z-index: 2; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--gold); text-decoration: none; }
.logo span { color: var(--rose); }
.logo:hover { color: var(--gold); }
.site-nav { display: flex; gap: 18px; font-family: var(--font-display); font-size: 0.9375rem; }
.site-nav a { color: var(--ash); text-decoration: none; padding: 8px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--starlight); }
.site-nav .wide-only { display: none; }

/* Masthead: part of a chart wheel runs off the edge behind the title */
.masthead { position: relative; overflow: hidden; border-bottom: 1px solid var(--graphite); }
.masthead::after {
  content: "";
  position: absolute;
  right: -190px;
  top: -130px;
  width: 460px;
  height: 460px;
  background: url("/wheel.svg") center / contain no-repeat;
  opacity: 0.35;
  pointer-events: none;
}
.masthead .wrap { position: relative; z-index: 1; padding-block: 48px 40px; }
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 9vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--gold);
  margin: 0;
  max-width: 15ch;
}
.lead { font-size: 1.1875rem; line-height: 1.55; max-width: 34em; margin: 16px 0 0; color: var(--starlight); }

/* Reading column, with a contents rail on wide screens */
.layout { padding-block: 32px 72px; }
.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2.5em 0 0.6em;
  scroll-margin-top: 24px;
}
h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1875rem; line-height: 1.3; margin: 1.8em 0 0.4em; }
p, ul, ol, dl { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
ul li::marker { color: var(--gold); }
li { margin-bottom: 0.45em; }
li > ul { margin: 0.45em 0 0; }
strong { font-weight: 700; }

.toc { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--graphite); font-size: 0.9375rem; }
.toc h2 { font-size: 0.9375rem; font-weight: 600; color: var(--ash); letter-spacing: 0; margin: 0 0 8px; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0; color: var(--starlight); text-decoration: none; }
.toc a:hover { color: var(--gold); text-decoration: underline; }

/* Numbered markers: only on real sequences */
.steps { list-style: none; counter-reset: step; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.5em; margin-bottom: 0.9em; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.7em;
  height: 1.7em;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875em;
  line-height: 1.6em;
  text-align: center;
}

.note { border-left: 3px solid var(--gold); padding: 2px 0 2px 16px; margin: 1.5em 0; }
.note p:last-child { margin-bottom: 0; }
.note-urgent { border-left-color: var(--rose); }

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--obsidian);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--starlight); color: var(--obsidian); }

/* Tables stack on phones; each cell then carries its column name */
.ledger { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 1rem; }
.ledger th { text-align: left; font-family: var(--font-display); font-weight: 600; }
.ledger td, .ledger th { vertical-align: top; }
@media (max-width: 719px) {
  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; }
  .ledger tr { padding: 14px 0; border-top: 1px solid var(--graphite); }
  .ledger td { padding: 0 0 6px; }
  .ledger td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--ash); }
}

.contact { margin: 0 0 1.5em; }
.contact dt { font-family: var(--font-display); font-weight: 600; font-size: 1.1875rem; margin-top: 1.2em; }
.contact dd { margin: 0.2em 0 0; }

mark.todo { background: rgba(212, 168, 85, 0.2); color: var(--starlight); border: 1px dashed var(--gold); border-radius: 4px; padding: 1px 5px; }

/* Footer */
.site-footer { border-top: 1px solid var(--graphite); background: var(--anthracite); padding-block: 32px; font-size: 0.9375rem; color: var(--ash); }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer li { margin: 0; }
.site-footer a { display: inline-block; padding: 4px 0; color: var(--starlight); text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.site-footer p { margin: 0; }

/* 404 */
.not-found main { display: flex; }
.not-found .masthead { border-bottom: 0; flex: 1; }
.not-found .masthead::after { width: 640px; height: 640px; right: -240px; top: -40px; }
.not-found .masthead .wrap { padding-block: 72px 200px; }

@media (min-width: 720px) {
  .ledger td, .ledger th { padding: 12px 16px 12px 0; border-top: 1px solid var(--graphite); }
  .ledger thead th { border-top: 0; color: var(--ash); font-size: 0.9375rem; }
  .ledger td:first-child { width: 34%; }
}

@media (min-width: 760px) {
  body { font-size: 1.125rem; }
  .site-nav { gap: 26px; }
  .site-nav .wide-only { display: inline; }
  .masthead::after { width: 620px; height: 620px; right: -140px; top: -210px; opacity: 0.7; }
  .masthead .wrap { padding-block: 72px 64px; }
  h1 { max-width: 16ch; }
  .layout { padding-block: 48px 96px; }
}

@media (min-width: 1000px) {
  .layout.has-toc { display: grid; grid-template-columns: 210px minmax(0, 1fr); column-gap: 64px; align-items: start; }
  .has-toc .toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .site-nav, .site-footer, .toc, .skip-link, .masthead::after { display: none; }
  h1, a, .logo, .logo span { color: #000; }
}

/* Library pages */
.crumbs { font-family: var(--font-display); font-size: 0.9375rem; margin-bottom: 20px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.crumbs li { margin: 0; color: var(--ash); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--ash); }
.crumbs a { color: var(--ash); padding-block: 4px; display: inline-block; }
.crumbs a:hover { color: var(--starlight); }
.prose-wide { max-width: 68ch; }
.prose h2 a { color: inherit; text-decoration-color: var(--gold); }
.prose h2 a:hover { color: var(--gold); }
.app-words { margin: 0 0 24px; padding: 20px 0 20px 20px; border-left: 3px solid var(--gold); }
.app-words blockquote { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; line-height: 1.4; }
.app-words blockquote p { margin: 0; }
.app-words figcaption { margin-top: 8px; font-size: 0.875rem; color: var(--ash); }
.aspect-facts { color: var(--ash); font-size: 1rem; }
.library-list { list-style: none; padding: 0; margin: 0 0 1em; }
.library-list li { margin: 0; padding: 14px 0; border-top: 1px solid var(--graphite); }
.library-list a { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; text-decoration: none; }
.library-list a:hover { text-decoration: underline; }
.library-list span { display: block; color: var(--ash); font-size: 1rem; margin-top: 2px; }
.link-grid { list-style: none; padding: 0; margin: 0 0 1em; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr)); gap: 0 20px; }
.link-grid li { margin: 0; border-top: 1px solid var(--graphite); }
.link-grid a { display: block; padding: 11px 0; text-decoration: none; }
.link-grid a:hover { text-decoration: underline; }
.related { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.related li { margin: 0; }
.related a { display: inline-block; padding: 4px 0; }
.quiet-cta { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--graphite); }
.quiet-cta .fine { color: var(--ash); font-size: 0.9375rem; margin-bottom: 0; }

/* Landing page */
.home { --harmony: #4CAF7A; --tension: #E07070; --fusion: #A8A0E8; }
.hero { overflow: hidden; border-bottom: 1px solid var(--graphite); }
.hero-grid { display: grid; gap: 24px; padding-block: 40px 32px; }
.home .hero h1 { font-size: clamp(2.375rem, 10.2vw, 5.75rem); line-height: 1.04; letter-spacing: -0.028em; max-width: none; }
.home .hero h1 span { display: block; }
.home .lead { max-width: 30em; }
.hero-note { color: var(--ash); font-size: 1rem; margin: 16px 0 0; max-width: 30em; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.store { display: inline-flex; flex-direction: column; justify-content: center; min-height: 56px; min-width: 148px; padding: 8px 22px; border-radius: 14px; font-family: var(--font-display); line-height: 1.2; text-decoration: none; background: var(--gold); color: var(--obsidian); }
a.store:hover { background: var(--starlight); color: var(--obsidian); }
.store-name { font-weight: 700; font-size: 1.0625rem; }
.store-note { font-size: 0.8125rem; font-weight: 500; }
.store.is-soon { background: transparent; color: var(--starlight); border: 1px solid var(--ash); }
.store.is-soon .store-note { color: var(--ash); }

.hero-chart { margin: 0; }
.bi-wheel { display: block; width: 100%; height: auto; max-width: 560px; margin-inline: auto; }
.wheel-frame { fill: none; stroke: var(--gold); stroke-width: 1; stroke-opacity: 0.55; }
.wheel-frame .fine-ticks { stroke-opacity: 0.6; }
.tick { fill: none; stroke-width: 1; stroke-opacity: 0.5; }
.chart-a { color: var(--gold); stroke: var(--gold); }
.chart-b { color: var(--starlight); stroke: var(--starlight); }
.aspect { stroke-width: 1.6; fill: none; }
.aspect.harmonious { stroke: var(--harmony); }
.aspect.challenging { stroke: var(--tension); stroke-dasharray: 7 5; }
.aspect.neither { stroke: var(--fusion); stroke-dasharray: 1.5 5; stroke-linecap: round; stroke-width: 2.2; }
.hero-chart figcaption { font-size: 0.9375rem; color: var(--ash); max-width: 560px; margin: 16px auto 0; }
.hero-chart figcaption p { margin: 8px 0 0; }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--starlight); }
.legend li { margin: 0; display: inline-flex; align-items: center; gap: 8px; }

/* The page's one moment: the aspects appear in turn, as the chart settles */
@media (prefers-reduced-motion: no-preference) {
  .bi-wheel .wheel-frame { transform-origin: 320px 320px; animation: wheel-settle 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .bi-wheel .wheel-lines .aspect { animation: aspect-in 0.5s ease-out both; animation-delay: calc(0.5s + var(--i) * 0.16s); }
  @keyframes wheel-settle { from { transform: rotate(-18deg); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes aspect-in { from { opacity: 0; } to { opacity: 1; } }
}

.band { padding-block: 56px; border-bottom: 1px solid var(--graphite); }
.band h2 { margin: 0 0 24px; font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.1; letter-spacing: -0.025em; max-width: 20ch; }
.steps-row { margin: 0; }
.steps-row h3 { margin: 0 0 4px; }
.steps-row p { margin: 0; color: var(--ash); }
.split { display: grid; gap: 32px; }
.split-text p { max-width: 34em; }
.split-text p:last-child { color: var(--ash); margin-bottom: 0; }

.sample-report { margin: 0; background: var(--anthracite); border: 1px solid var(--graphite); border-radius: 18px; padding: 24px 20px 18px; }
.sample-score { display: flex; align-items: baseline; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--graphite); }
.sample-number { font-family: var(--font-display); font-weight: 700; font-size: 3.25rem; line-height: 1; color: var(--gold); letter-spacing: -0.03em; }
.sample-tier { font-family: var(--font-display); font-weight: 600; font-size: 1.1875rem; }
.sample-rows { margin: 0; }
.sample-rows > div { padding: 14px 0; border-bottom: 1px solid var(--graphite); }
.sample-rows dt { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-display); font-weight: 600; }
.sample-rows dd { margin: 4px 0 0; font-size: 1rem; color: var(--ash); }
.sample-rows dd strong { color: var(--starlight); }
.pill { font-size: 0.8125rem; font-weight: 500; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill-harmonious { color: var(--harmony); }
.pill-dynamic { color: var(--fusion); }
.pill-challenging { color: var(--tension); }
.sample-report figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--ash); }

.features { margin: 0; display: grid; gap: 22px; }
.features dt { font-family: var(--font-display); font-weight: 600; font-size: 1.1875rem; }
.features dd { margin: 2px 0 0; color: var(--ash); max-width: 32em; }
.plans { margin-bottom: 0; }

.statement { background: var(--anthracite); }
.statement-line { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 8vw, 3.5rem); line-height: 1.05; letter-spacing: -0.03em; color: var(--gold); margin: 0; max-width: 16ch; }
.statement-sub { margin: 16px 0 0; max-width: 32em; }

.faq h3:first-child { margin-top: 0; }
.faq p { max-width: 34em; color: var(--ash); }
.faq p:last-child { margin-bottom: 0; }
.get-the-app { border-bottom: 0; }
.get-the-app h2 { margin-bottom: 8px; }
.get-the-app p { margin: 0; color: var(--ash); }

@media (min-width: 760px) {
  .hero-grid { padding-block: 72px 64px; }
  .band { padding-block: 88px; }
  .steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .steps-row > li { margin: 0; }
  .features { grid-template-columns: repeat(2, 1fr); gap: 32px 56px; }
  .plans td:first-child { width: 22%; }
}

@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 40px 48px; }
  .hero-grid h1 { grid-column: 1 / -1; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: start; }
  .split-faq { grid-template-columns: 1fr 2fr; }
}

/* Free chart tool and invite pages */
.tool { --harmony: #4CAF7A; --tension: #E07070; --fusion: #9696A0; }
.tool-grid { display: grid; gap: 28px; }
.tool-card { background: var(--anthracite); border: 1px solid var(--graphite); border-radius: 16px; padding: 20px; }
.tool-note { color: var(--ash); font-size: 1rem; }
.tool-note h2 { margin-top: 0; font-size: 1.125rem; color: var(--starlight); }
.birth-form fieldset { border: 0; margin: 0; padding: 0; }
.birth-form legend { padding: 0; margin-bottom: 14px; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.field { margin-bottom: 18px; }
.field > label:first-child { display: block; margin-bottom: 6px; font-family: var(--font-display); font-weight: 500; }
.field input[type="date"], .field input[type="time"], .field input[type="text"] {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid #55555f;
  background: var(--graphite); color: var(--starlight); font: inherit;
}
.field input:disabled { opacity: 0.5; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 4px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; }
.hint { color: var(--ash); font-size: 0.9375rem; margin: 6px 0 0; }
.hint:empty { display: none; }
.place-results { list-style: none; padding: 0; margin: 8px 0 0; border: 1px solid var(--graphite); border-radius: 10px; overflow: hidden; }
.place-results li { margin: 0; }
.place-results li + li { border-top: 1px solid var(--graphite); }
.place-results button { display: block; width: 100%; min-height: 48px; padding: 10px 14px; background: var(--elevated); color: var(--starlight); border: 0; font: inherit; text-align: left; cursor: pointer; }
.place-results button:hover, .place-results button:focus-visible { background: var(--graphite); }
.form-error { color: #FF9C9F; font-weight: 700; margin: 0 0 14px; }
button.btn { width: 100%; min-height: 50px; border: 0; cursor: pointer; font-size: 1.0625rem; }
button.btn:disabled { opacity: 0.6; cursor: progress; }
.tool-section { margin-top: 36px; }
.tool-section > h2:first-child { margin-top: 0; }
.big-three { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.big-three > li { margin: 0; background: var(--anthracite); border: 1px solid var(--graphite); border-radius: 16px; padding: 18px; }
.big-three h3 { margin: 0; font-size: 0.9375rem; font-weight: 500; color: var(--ash); }
.big-three .sign { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--gold); margin-bottom: 6px; }
.big-three p { margin: 0; }
.big-three .aside { color: var(--ash); font-size: 0.9375rem; margin-top: 8px; }
.pair-score { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }
.pair-tier { font-family: var(--font-display); font-weight: 700; font-size: 1.625rem; line-height: 1.2; color: var(--gold); }
.pair-number { color: var(--ash); }
.pair-bar { height: 8px; border-radius: 4px; background: var(--graphite); overflow: hidden; margin-bottom: 20px; }
.pair-bar span { display: block; height: 100%; background: var(--gold); }
.pair-aspects { list-style: none; padding: 0; margin: 0; }
.pair-aspects li { margin: 0; padding: 14px 0; border-top: 1px solid var(--graphite); }
.pair-aspects strong { display: block; font-family: var(--font-display); font-weight: 600; text-transform: capitalize; }
.pair-aspects .tone { display: block; font-size: 0.875rem; margin-bottom: 4px; }
.tone-harmonious { color: var(--harmony); }
.tone-discordant { color: var(--tension); }
.tone-neutral { color: var(--fusion); }
.invite-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 4px; }
.invite-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(1.5rem, 7.4vw, 2.25rem); font-weight: 700; letter-spacing: 0.08em; color: var(--gold); background: var(--anthracite); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 14px; overflow-wrap: anywhere; user-select: all; }
button.btn-quiet, a.btn-quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--gold); background: transparent; color: var(--gold); font-family: var(--font-display); font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; }
button.btn-quiet:hover, a.btn-quiet:hover { background: var(--gold); color: var(--obsidian); }
.tool .stores { margin: 10px 0 0; }
.tool .steps { margin-top: 20px; }
.tool-section.tool-card { max-width: 640px; }

@media (min-width: 860px) {
  .tool-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: 48px; }
  .big-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-card { padding: 28px; }
  button.btn { width: auto; min-width: 240px; }
}
