/* =============================================================================
   rally.dating — the one stylesheet.

   THIS IS THE RESTYLE SURFACE. Everything visual is a custom property in the
   :root block below; the rest of the file only consumes them. The values are
   the app's own (frontend/rally/lib/shared/theme.dart — AppColors, AppRadius,
   its fonts), so the site and the app read as one brand: dark only, like the
   app, on its ink background.

   No build step and no framework. The fonts are the app's, served from
   /fonts/ by this site itself — never from Google Fonts or any CDN: the site
   makes zero third-party requests, which is what keeps it cookie-free and free
   of a consent banner. Do not add an off-origin URL here without reading
   web/README.md first.

   The frozen legal archives (/terms/v1/, /privacy/v1/) use this stylesheet
   too, so a class they use must keep working; their text never changes.
   ============================================================================= */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-700.ttf") format("truetype");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Dancing Script";
  src: url("/fonts/dancing-script-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* --- Brand (AppColors) ------------------------------------------------- */
  --brand: #d6577e;              /* primary — the brand pink */
  --brand-light: #e79cb2;        /* primaryLight — links and focus: readable on ink */
  --brand-fill: #c24d74;         /* a filled control; white on --brand is under AA */
  --brand-ink: #ffffff;          /* text on --brand-fill */
  --brand-wash: #43232d;         /* primaryContainer — a tinted chip */
  --accent: #ee9a4c;             /* the brand orange */
  --success: #21b575;

  /* The logo's three glows (logoPurple, logoPink, logoOrange): the login
     screen's orbs, and the hero's here. */
  --glow-1: 139 127 235;
  --glow-2: 224 102 143;
  --glow-3: 242 166 90;

  /* --- Neutrals ---------------------------------------------------------- */
  --bg: #241f33;                 /* logoInk — the app's background */
  --bg-rgb: 36 31 51;            /* --bg, for translucent fills */
  --surface: #3f3659;            /* cards */
  --surface-2: #312a46;          /* surfaceVariant — recessed fills, alternate bands */
  --ink: #f5f1f8;                /* textPrimary */
  --ink-muted: #b8afc9;          /* textSecondary */
  --ink-faint: #9791a8;          /* textTertiary — on --bg only; too faint on cards */
  --border: #4c426c;
  --border-rgb: 76 66 108;
  --white: #fff;                 /* the wordmark and tagline, as on the login screen */
  --white-rgb: 255 255 255;

  /* --- Notices (warningTint / warning / accentLight) --------------------- */
  --warn-bg: #453321;
  --warn-border: #c97b2e;
  --warn-ink: #f5c08b;

  /* --- Type -------------------------------------------------------------- */
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Open Sans", ui-serif, Georgia, "Times New Roman",
    serif;
  --font-script: "Dancing Script", cursive;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* --- Shape & rhythm (AppRadius) ---------------------------------------- */
  --radius: 22px;                /* lg — cards */
  --radius-lg: 28px;             /* xl — large cards */
  --radius-sm: 10px;             /* sm — notices, chips */
  --page: 1100px;                /* max width of a full-width section */
  --measure: 68ch;               /* max width of running text (legal pages) */
  --gap: 1.25rem;
  --header: 4.25rem;             /* the sticky header's height, for anchors */
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 14px 36px rgb(0 0 0 / 28%);
  --shadow-art: drop-shadow(0 24px 48px rgb(0 0 0 / 35%));
}

/* --- Base ----------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 1rem);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  /* 17px base: legal text has to be readable on a phone without zooming. */
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
  margin: 0 0 0.5em;
}

/* Display headings are the app's display face. Instrument Serif has one
   weight, so size carries the hierarchy, not boldness — as in the app. */
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.6rem, 1.7rem + 3.8vw, 4.5rem);
}

h2 {
  font-size: clamp(2rem, 1.55rem + 1.8vw, 2.9rem);
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

strong {
  font-weight: 700;
}

a {
  color: var(--brand-light);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--ink);
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

::selection {
  background: var(--brand);
  color: var(--white);
}

/* Keyboard users land here first; visible only once focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 20;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

/* --- Layout --------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: clamp(3rem, 1.75rem + 5vw, 5.5rem);
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* Alternate band, so a long page has some rhythm without needing artwork. */
.section-alt {
  background: var(--surface-2);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 60ch;
}

.muted {
  color: var(--ink-muted);
}

.small {
  font-size: 0.875rem;
}

/* The small uppercase label over a heading — "How it works", "Step 1". */
.kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-light);
  margin-bottom: 0.75rem;
}

/* --- Header / footer ------------------------------------------------------ */
/* These two blocks are duplicated verbatim in every page between the
   `header:start`/`header:end` and `footer:start`/`footer:end` comment markers.
   See web/README.md — a nav change is a scripted replace across those markers,
   not a hand edit of every page. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(var(--bg-rgb) / 82%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(var(--border-rgb) / 60%);
}

/* On a phone the nav wraps under the wordmark, and a two-row header pinned to
   the top would take a fifth of the screen. */
@media (max-width: 40rem) {
  html {
    scroll-padding-top: 1rem;
  }

  .site-header {
    position: static;
  }
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: var(--header);
  padding-block: 0.5rem;
}

/* The login screen's wordmark: the glyph, then the name in Dancing Script. */
.wordmark {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

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

/* The glyph is a background image, not markup, so the header the frozen
   archives carry (an empty span) shows it too. */
.wordmark .mark {
  width: 2.1rem;
  height: 1.45rem;
  background: url("/img/mark.svg") center / contain no-repeat;
  display: inline-block;
  flex: none;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 0.35rem 1.4rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding-block: 2.75rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}

.site-footer a {
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer p {
  color: var(--ink-muted);
  max-width: var(--measure);
}

/* --- Hero ----------------------------------------------------------------- */

/* The login screen: an ink field with the logo's three glows drifting over
   it, the app icon and the tagline. (The name, in the login screen's Dancing
   Script, is the header's wordmark.) */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
  padding-block: clamp(3.5rem, 2rem + 7vw, 7.5rem);
  border-bottom: 1px solid var(--border);
}

.orbs {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Each glow is placed by its centre, as a share of the hero, and sized off the
   viewport — so a phone sees them too, not only a wide screen. */
.orbs span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgb(var(--glow) / 52%),
    rgb(var(--glow) / 0%)
  );
  animation: drift var(--period) ease-in-out infinite alternate;
}

.orbs span:nth-child(1) {
  --glow: var(--glow-1);
  --x: 12%;
  --y: 8%;
  --size: min(62rem, 150vw);
  --period: 17s;
  --dx: 9%;
  --dy: 7%;
}

.orbs span:nth-child(2) {
  --glow: var(--glow-2);
  --x: 92%;
  --y: 42%;
  --size: min(62rem, 150vw);
  --period: 21s;
  --dx: -8%;
  --dy: 9%;
}

.orbs span:nth-child(3) {
  --glow: var(--glow-3);
  --x: 45%;
  --y: 120%;
  --size: min(54rem, 130vw);
  --period: 25s;
  --dx: 7%;
  --dy: -6%;
}

@keyframes drift {
  to {
    transform: translate(var(--dx), var(--dy));
  }
}

@media (prefers-reduced-motion: reduce) {
  .orbs span {
    animation: none;
  }
}

.hero .wrap {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: 4rem;
  }
}

.hero h1 {
  max-width: 14ch;
}

.hero .lede {
  color: var(--ink);
  opacity: 0.88;
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  max-width: 50ch;
}

/* The app icon, as it sits on the login screen. Above the copy on a phone,
   beside it on a wide screen. */
.hero-art {
  order: -1;
  width: clamp(7rem, 30vw, 21rem);
  justify-self: start;
  filter: var(--shadow-art);
}

.hero-art img {
  display: block;
  width: 100%;
}

@media (min-width: 60rem) {
  .hero-art {
    order: 0;
    justify-self: end;
  }
}

/* "Discover. Rally. Date." — the login screen's tagline. */
.tagline {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: rgb(var(--white-rgb) / 90%);
  margin-bottom: 1rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-light);
  background: var(--brand-wash);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  margin-bottom: 1.25rem;
}

/* --- Buttons & store badges ----------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand-fill);
  color: var(--brand-ink);
}

.btn:hover {
  background: var(--brand);
  color: var(--brand-ink);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 2rem 1rem;
}

/* A store badge that is not a link yet — the listings do not exist. Rendered
   as visibly inert rather than as a link to nowhere. */
.badge-soon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 150px;
  margin: 0;
  padding: 0.6rem 1.15rem;
  border: 1px dashed rgb(var(--white-rgb) / 28%);
  border-radius: 14px;
  background: rgb(var(--bg-rgb) / 45%);
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.3;
}

.badge-soon strong {
  color: var(--ink);
  font-weight: 700;
}

.badge-soon span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Cards & grids -------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--gap);
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: var(--ink-muted);
}

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

/* --- FAQ (native <details>, no JS) ---------------------------------------- */

.faq {
  max-width: var(--measure);
  margin-top: 1.5rem;
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style-position: outside;
}

.faq summary::marker {
  color: var(--brand);
}

.faq details p {
  margin: 0.6rem 0 0;
  color: var(--ink-muted);
}

/* --- Long-form documents (terms, privacy, deletion, support) -------------- */

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

.prose h2 {
  font-size: clamp(1.75rem, 1.45rem + 1.2vw, 2.2rem);
  margin-top: 2.75rem;
  padding-top: 0.25rem;
}

.prose h3 {
  margin-top: 1.75rem;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose li:last-child {
  margin-bottom: 0;
}

.prose li::marker {
  color: var(--ink-faint);
}

.doc-meta {
  color: var(--ink-muted);
  font-size: 0.9rem;
  border-left: 3px solid var(--brand);
  padding-left: 1rem;
  margin-bottom: 2rem;
}

.doc-meta p {
  margin: 0.2em 0;
}

/* Table of contents on the long documents. */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.toc h2 {
  font-family: var(--font);
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.95rem;
}

@media (max-width: 40rem) {
  .toc ol {
    columns: 1;
  }
}

.toc li {
  margin-bottom: 0.25em;
  break-inside: avoid;
}

/* The TOC sits on a card, where --ink-faint is too faint. */
.toc li::marker {
  color: var(--ink-muted);
}

/* --- Notices -------------------------------------------------------------- */

/* The DRAFT banner on the unreviewed legal documents. Removing it is a manual
   launch step (website_todo W6/W7) — do not delete it because it looks untidy. */
.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left-width: 5px;
  border-radius: var(--radius-sm);
  color: var(--warn-ink);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.notice :is(h2, h3) {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: inherit;
}

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

.notice a {
  color: inherit;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

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

/* --- Print (someone will print the terms) --------------------------------- */

@media print {
  :root {
    --ink: #000;
    --ink-muted: #333;
    --ink-faint: #555;
    --brand-light: #000;
    --white: #000;
    --white-rgb: 0 0 0;
    --warn-ink: #000;
  }

  .hero .lede {
    opacity: 1;
  }

  .orbs {
    display: none;
  }

  .site-header,
  .site-footer,
  .toc,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  a {
    color: #000;
  }

  .notice,
  .callout,
  .doc-meta {
    background: none;
    color: #000;
  }

  .prose {
    max-width: none;
  }
}
