/*
 * NextChapter Separation — holding-site styles.
 *
 * Standalone static site. No app code, no build step. Colours are the
 * locked NextChapter palette (src/components/nstep/dsTokens.js); the cream
 * page surface (#F5F1EA) matches ComingSoon.jsx's --cs-cream. Every
 * foreground/background pair was contrast-checked (see README).
 *
 * --font-body is defined here so the inline `font-family: var(--font-body)`
 * emitted by the rendered legal components (privacy.html / terms.html)
 * resolves to Nunito Sans, exactly as it does in the app.
 */

:root {
  --charcoal: #262624;
  --cream: #F5F1EA;
  --forest: #2A3D28;
  --gold: #C8A97E;
  --gold-text: #8A6B3F;
  --ink: #2A2E2A;
  --ink-mid: #4F4C46;
  --ink-light: #62615C;
  --sage: #8FB5AC;
  --teal: #4A7266;
  --quote-text: #FDFBF8;
  --qe-grey: #C7C6C1;
  --abn: #9A9994;
  --crisis: #7F261C;
  --card: #FFFFFF;
  --card-warm: #FFFDF9;
  --card-border: #DDD6CB;
  --hairline: rgba(38, 38, 36, 0.10);

  --font-head: 'Lora', Georgia, serif;
  --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.62;
  overflow-x: hidden;
}

/* ── Top bar (charcoal) ────────────────────────────────────────────── */
.topbar {
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px clamp(14px, 4vw, 28px);
  position: relative;
  z-index: 20;
}
.wordmark {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
}
.wm-main {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.wm-next { color: var(--cream); }
.wm-chapter { color: var(--gold); }
.wm-sub {
  font-family: var(--font-head);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  /* Matches the app's Logo onDark: cream subtitle at 75% opacity (8.18:1 on
     charcoal), not gold. */
  color: var(--cream);
  opacity: 0.75;
  margin-top: 2px;
}

/* Quick Exit buttons — top bar + pinned share this look. */
.qe {
  color: var(--qe-grey);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid #55554F;
  border-radius: 6px;
  padding: 0 12px;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}
.qe:hover { color: var(--cream); border-color: var(--qe-grey); }
.qe:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Pinned Quick Exit — appears once the top bar scrolls away. */
.pinned-exit {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 10px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  background: var(--charcoal);
  color: var(--cream);
  border: 1px solid rgba(38, 38, 36, 0.25);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(38, 38, 36, 0.22);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.pinned-exit[hidden] { display: none; }
.pinned-exit:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Hero band (solid deep forest) ─────────────────────────────────── */
.hero {
  background: var(--forest);
  padding: clamp(44px, 7vw, 72px) clamp(20px, 5vw, 40px);
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.eyebrow {
  font-size: clamp(12px, 1.1vw, 13px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 18px;
}
.hero-h1 {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.6vw, 2.9rem);
  line-height: 1.2;
  font-weight: 400;
  color: var(--quote-text);
  margin: 0;
}

/* ── Intro / coming-soon (cream) ───────────────────────────────────── */
.intro {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 52px) clamp(20px, 5vw, 40px) 8px;
  text-align: center;
}
.lede {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.5;
  color: var(--ink);
  margin: 0 auto 20px;
  max-width: 560px;
}
.au-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 36px;
}
.au-badge svg { flex-shrink: 0; display: block; }
.coming {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 400;
  color: var(--forest);
  margin: 0 0 22px;
}

/* Three cards (not links) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(178px, 100%), 1fr));
  gap: 14px;
  text-align: left;
  margin: 0 0 8px;
}
.card {
  background: var(--card-warm);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 2px rgba(38, 38, 36, 0.14), 0 14px 30px rgba(38, 38, 36, 0.10);
  padding: 20px 20px 22px;
}
.card-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 6px;
}
.card-desc {
  font-size: 15px;
  color: var(--ink-mid);
  margin: 0;
  line-height: 1.55;
}

.divider {
  border: none;
  border-top: 1px solid var(--card-border);
  max-width: 720px;
  margin: 40px auto 34px;
}
.free-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px) 4px;
  text-align: center;
}
.free-h2 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
  font-weight: 400;
  color: var(--forest);
  margin: 0 0 14px;
  line-height: 1.3;
}
.free-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-mid);
  margin: 0;
}

/* ── Support band (cream, gold border) ─────────────────────────────── */
.support {
  background: var(--cream);
  border: 1px solid var(--gold);
  border-left: none;
  border-right: none;
  padding: 26px clamp(20px, 5vw, 40px) 28px;
  color: var(--charcoal);
  margin-top: 44px;
}
.support-inner { max-width: 720px; margin: 0 auto; }
.support-heading {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--charcoal);
}
.support-danger { margin: 0 0 14px; font-size: 15px; }
.support-danger a { color: var(--crisis); font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.support-danger a:hover { text-decoration: underline; }
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.support-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--charcoal);
  min-height: 56px;
}
.support-card:hover { border-color: var(--sage); }
.support-name { display: block; font-weight: 700; }
.support-num { display: block; color: var(--teal); font-size: 14px; margin-top: 2px; }
.support-disclaimer { margin: 0; font-size: 13.5px; color: var(--ink-mid); line-height: 1.6; }

/* ── Footer (charcoal) ─────────────────────────────────────────────── */
.footer {
  background: var(--charcoal);
  padding: 30px clamp(20px, 5vw, 40px) 24px;
  color: var(--qe-grey);
}
.footer-inner { max-width: 720px; margin: 0 auto; }
.ack-box {
  background: rgba(143, 181, 172, 0.08);
  border: 1px solid rgba(143, 181, 172, 0.30);
  border-radius: 10px;
  padding: 16px 18px;
  text-align: center;
}
.ack-text {
  font-family: var(--font-head);
  font-style: italic;
  font-size: 13px;
  color: rgba(245, 241, 234, 0.82);
  line-height: 1.75;
  margin: 0;
}
.ack-inclusion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  text-align: center;
}
.ack-inclusion p {
  font-size: 12.5px;
  color: rgba(245, 241, 234, 0.80);
  line-height: 1.7;
  margin: 0;
  max-width: 560px;
}
.foot-links {
  text-align: center;
  margin: 26px 0 8px;
}
.foot-links a {
  color: var(--qe-grey);
  font-size: 14px;
  text-decoration: none;
  padding: 10px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.foot-links a:hover { color: var(--cream); }
.foot-dot { color: #55554F; align-self: center; }
.foot-contact {
  text-align: center;
  font-size: 13.5px;
  color: var(--qe-grey);
  margin: 0 0 8px;
}
.foot-contact a { color: var(--qe-grey); overflow-wrap: anywhere; }
.foot-contact a:hover { color: var(--cream); }

.csiro-rule {
  max-width: 680px;
  margin: 24px auto 0;
  border-top: 1px solid rgba(143, 181, 172, 0.25);
}
.csiro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 24px auto 0;
  max-width: 680px;
}
.csiro-panel {
  background: var(--cream);
  border: 1px solid rgba(200, 169, 126, 0.55);
  border-radius: 14px;
  padding: 20px 30px;
  display: inline-flex;
  line-height: 0;
  max-width: 100%;
}
.csiro-mark { width: 398px; height: auto; max-width: 100%; display: block; }
.csiro-text {
  font-size: 13px;
  color: var(--qe-grey);
  line-height: 1.75;
  text-align: center;
  margin: 0;
  max-width: 560px;
}
.csiro-link { color: var(--gold); text-decoration: underline; }
.foot-abn {
  font-size: 12px;
  color: var(--abn);
  letter-spacing: 0.02em;
  text-align: center;
  margin: 20px auto 0;
  max-width: 680px;
}

@media (max-width: 420px) {
  .csiro-mark { width: 281px; }
  .csiro-panel { padding: 16px 20px; }
}

/* ── Legal pages (privacy / terms) ─────────────────────────────────── */
/* The legal body itself is inline-styled by the rendered component. These
 * rules only style the shared chrome and the "Back to home" link. */
.legal-main { background: var(--cream); }
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px clamp(20px, 5vw, 32px) 0;
  width: 100%;
  color: var(--forest);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.back-home:hover { text-decoration: underline; }

a:focus-visible,
.support-card:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
