/*
 * Top Down — site styles. Coastal palette, light ground.
 *
 * Light is canonical, deliberately: the product's signature idea is that an alert inverts the
 * screen from sand to storm, and that only reads if the resting state is light. Hence
 * `color-scheme: light` rather than a dark-mode variant — a site that flips to dark on its own
 * would spend the inversion before the alert card gets to use it.
 *
 * Two teals. `--water` (#0E8C8B) is the brand fill and only carries decoration — rules, icons,
 * step numerals. `--water-ink` is the same hue darkened to clear 4.5:1 on sand, and is the only
 * one allowed under text or a button label. #0E8C8B measures 3.8:1 on sand, which is fine for a
 * 6px stroke and not fine for a 16px link.
 */

:root {
  color-scheme: light;

  --sand: #fbf7ef; /* dry sand — the ground */
  --shell: #ffffff;
  --sand-deep: #ede6d8;
  --slate: #17323a; /* wet slate — body text */
  --slate-soft: #5a6e75; /* 5.0:1 on sand */
  --border: #e2d9c8;
  --water: #0e8c8b; /* shallow water — decoration only */
  --water-ink: #0b6f6e; /* 5.6:1 on sand — text and buttons */
  --coral: #e9714f;
  --storm: #1b3a4b; /* the inversion ground */
  --storm-raised: #24485c;
  --storm-text: #f4efe6;

  --sans:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 12px;
  --gutter: 1.25rem;
}

*,
*::before,
*::after {
  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(--sand);
  color: var(--slate);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.prose {
  width: min(100% - (2 * var(--gutter)), 42rem);
  margin-inline: auto;
}

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

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.05rem;
  margin-top: 2rem;
}

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

ul,
ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

a {
  color: var(--water-ink);
  text-underline-offset: 0.15em;
}

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

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

strong {
  font-weight: 650;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--sand-deep);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--shell);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ---- header / footer ---- */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--slate);
  text-decoration: none;
  margin-right: auto;
}

.brand svg {
  width: 30px;
  height: 30px;
  color: var(--water);
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--slate-soft);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--water-ink);
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  font-size: 0.85rem;
  color: var(--slate-soft);
}

.site-footer p {
  margin: 0 0 0.6rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-bottom: 1rem;
}

/* ---- landing ---- */

.hero {
  padding: 2.5rem 0 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 8vw, 3.25rem);
  margin-bottom: 0.75rem;
}

.lede {
  font-size: 1.125rem;
  color: var(--slate-soft);
  max-width: 34rem;
  margin-bottom: 1.75rem;
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

/*
 * The alert card. Storm ground, coral accent, and it does not flip with anything — same surface
 * the app inverts to, so the site shows the actual moment the product exists for.
 */
.alert-card {
  background: var(--storm);
  color: var(--storm-text);
  border-radius: 20px;
  padding: 1.5rem;
  max-width: 22rem;
  box-shadow: 0 18px 40px -24px rgba(23, 50, 58, 0.7);
}

/*
 * Coral on storm measures 3.96:1 — AA for large text, short of it for this size. Kept anyway: it
 * is the app's own alertPrimary/alertBackground pairing (apps/mobile/src/constants/theme.ts), and
 * a mockup that quietly recolours the shipped surface is a mockup that lies. The label is a
 * decorative app name, fully redundant with the page it sits on, so nothing is lost by it.
 */
.alert-card .kicker {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: 0.6rem;
}

.alert-card .headline {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.alert-card .body {
  font-size: 0.95rem;
  color: #cfd9de;
  margin: 0;
}

.alert-card .divider {
  border-top: 1px solid var(--storm-raised);
  margin: 1.1rem 0 0.9rem;
}

.alert-card .meta {
  font-size: 0.8rem;
  color: #a9bcc4;
  margin: 0;
}

.scenario {
  background: var(--shell);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 3rem 0;
}

.scenario h2 {
  margin-top: 0;
}

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

.scenario .beat {
  font-size: 1.15rem;
  font-weight: 650;
}

.section {
  margin: 3.5rem 0;
}

.section > h2 {
  margin-top: 0;
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.card {
  background: var(--shell);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

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

.card .step {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--water-ink); /* it is an ordinal, not decoration — so it takes the text teal */
  margin-bottom: 0.5rem;
}

.fit-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fit-list li {
  margin: 0;
  background: var(--shell);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}

.limits {
  background: var(--sand-deep);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.limits h2 {
  margin-top: 0;
}

.limits dt {
  font-weight: 650;
  margin-top: 1rem;
}

/*
 * Full slate, not --slate-soft: this block sits on the deeper sand ground, where soft measures
 * 4.3:1 and misses AA. The bold <dt> is enough to separate term from definition without it.
 */
.limits dd {
  margin: 0.15rem 0 0;
  color: var(--slate);
}

.note {
  font-size: 0.9rem;
  color: var(--slate-soft);
}

/* A closing note under a card grid or a pill list needs air the grid gap does not provide. */
.cards + .note,
.fit-list + .note {
  margin-top: 1rem;
}

/* ---- documents ---- */

.doc-header {
  padding: 2.5rem 0 0;
}

.doc-meta {
  font-size: 0.85rem;
  color: var(--slate-soft);
  margin-bottom: 2rem;
}

.summary {
  background: var(--shell);
  border: 1px solid var(--border);
  border-left: 4px solid var(--water);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 2rem;
}

.summary h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

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

/*
 * Pre-launch banner. Delete the whole <aside class="placeholder-banner"> block on each page once
 * the bracketed values below it are filled in.
 */
.placeholder-banner {
  background: #fdeee9;
  border: 1px solid var(--coral);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.placeholder-banner p {
  margin: 0;
}

.tbd {
  font-family: var(--mono);
  font-size: 0.85em;
  background: #fdeee9;
  border: 1px dashed var(--coral);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  white-space: nowrap;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.925rem;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.9rem 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--slate-soft);
  border-bottom-color: var(--slate-soft);
}

.data-table td:first-child {
  font-weight: 600;
}

/*
 * Stack the tables on phones. Changing `display` on table elements strips their implicit
 * semantics, so every element carries an explicit role in the markup to put them back.
 */
@media (max-width: 34rem) {
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .data-table tr {
    background: var(--shell);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
  }

  .data-table td {
    border-bottom: 0;
    padding: 0.35rem 0;
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--slate-soft);
  }

  .data-table td:first-child::before {
    content: none;
  }

  .data-table td:first-child {
    font-size: 1rem;
  }
}

/* ---- FAQ ---- */

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

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

/* The closing <hr> after the list already draws this line; two of them read as a gap. */
.faq details:last-child {
  border-bottom: 0;
}

.faq summary {
  cursor: pointer;
  padding: 1rem 0;
  font-weight: 650;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

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

.faq summary::after {
  content: '+';
  color: var(--water-ink);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1;
  flex: none;
}

.faq details[open] summary::after {
  content: '–';
}

.faq .answer {
  padding-bottom: 0.75rem;
}

.faq .answer h3 {
  margin-top: 1.25rem;
}

.faq .answer > :last-child {
  margin-bottom: 0;
}

/* ---- wider screens ---- */

@media (min-width: 48rem) {
  body {
    font-size: 1.0625rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .hero {
    padding: 4rem 0 2rem;
  }

  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .scenario,
  .limits {
    padding: 2rem 2.25rem;
  }
}

@media print {
  body {
    background: #fff;
    font-size: 11pt;
  }

  .site-header,
  .site-nav,
  .placeholder-banner {
    display: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
