/* ─────────────────────────────────────────────────────────────────────
   Lumio site — engraved celestial cartography, for reading.
   Tokens mirror lib/theme/app_theme.dart (AppColors). Dark-first, always.
   Type: Cormorant Garamond is rationed to page titles + one ritual line;
   DM Sans does the reading; Courier Prime is the metadata voice.
   ───────────────────────────────────────────────────────────────────── */

:root {
  --ground: #06080f;      /* AppColors.black — every screen's ground */
  --navy: #0a0e1a;        /* AppColors.navy — pill fills only */
  --leather: #14100c;     /* AppColors.leatherCard — cards */
  --gold: #c9a96e;        /* the one accent: marks, labels, links */
  --gold-warm: #d4b888;   /* the warm light, highlights, focus */
  --pearl: #f0ede6;       /* headings */
  --rose-blue: #7a9ec9;   /* the one cool accent */

  /* Reading greys, pre-mixed on --ground (never opacity) so contrast is exact:
     on --ground: text 15.8:1 · text-2 10.1:1 · text-3 6.9:1 · gold 8.9:1; on cards ≥ 6.6:1. */
  --text: #e8e4db;
  --text-2: #bdb8ae;
  --text-3: #9c978d;

  --hairline: rgba(201, 169, 110, 0.24);
  --hairline-soft: rgba(201, 169, 110, 0.13);

  --serif: "Cormorant Garamond", "Cormorant", Garamond, Baskerville, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;

  --measure: 68ch;
  --gutter: 16px;
  --radius: 14px;
}

@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

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

html {
  background: var(--ground);
  color: var(--text);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  font-family: var(--sans);
  font-size: 1.0625rem;          /* 17px on phones */
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 768px) { body { font-size: 1.125rem; } } /* 18px */

main { flex: 1 0 auto; }
main:focus { outline: none; }

img, svg { max-width: 100%; }

::selection { background: rgba(201, 169, 110, 0.35); color: var(--pearl); }

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

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

.label {
  font-family: var(--mono);
  font-size: 0.75rem;            /* 12px — quiet by colour, never by size */
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--gold);
}

/* Engraved marks: true hairlines at any size. */
.glyph { display: block; overflow: visible; }
.glyph * { vector-effect: non-scaling-stroke; }

.rule {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 169, 110, 0), rgba(201, 169, 110, 0.55));
}
.rule::after { background: linear-gradient(90deg, rgba(201, 169, 110, 0.55), rgba(201, 169, 110, 0)); }
.rule svg { flex: none; opacity: 0.85; }

/* ── The night sky: sparse clumped stars + ONE governing light ───── */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: url(/assets/stars.76e1eaaf45.svg) center / cover no-repeat;
  opacity: 0.85;
}
.sky__light {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 62% 48% at 50% -4%, var(--l1), var(--l2) 46%, rgba(0, 0, 0, 0) 78%);
}
.sky__light--warm { --l1: rgba(212, 184, 136, 0.17); --l2: rgba(212, 184, 136, 0.05); }
.sky__light--ember { --l1: rgba(212, 184, 136, 0.24); --l2: rgba(212, 184, 136, 0.07); }
.sky__light--cold { --l1: rgba(122, 158, 201, 0.16); --l2: rgba(122, 158, 201, 0.045); }
@media (prefers-reduced-motion: no-preference) {
  .sky__light { animation: breathe 11s ease-in-out infinite; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

/* ── Skip link ─────────────────────────────────────────────────────── */
.skip {
  position: absolute;
  left: 12px;
  top: -120px;
  z-index: 10;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--gold-warm);
  color: var(--ground);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ── Header ───────────────────────────────────────────────────────── */
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 28px;
  padding-block: 18px 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  color: var(--gold);
  text-decoration: none;
}
.brand__mark { width: 22px; height: 22px; }
.brand__word {
  font-family: var(--mono);
  font-size: 0.9375rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--pearl);
  margin-right: -0.34em;
}
.brand:hover .brand__word { color: var(--gold-warm); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 10px 1px;
  color: var(--text-2);
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  line-height: 1.5;
}
.site-nav a:hover { color: var(--pearl); }
.site-nav a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: rgba(201, 169, 110, 0.55);
}
@media (max-width: 559px) {
  .site-nav { width: 100%; border-top: 1px solid var(--hairline-soft); }
  .site-nav ul { justify-content: space-between; gap: 0; }
}

/* ── Document pages ───────────────────────────────────────────────── */
.doc { padding-block: clamp(28px, 6vw, 72px) clamp(48px, 8vw, 88px); }
.doc-head, .prose, .toc { max-width: var(--measure); margin-inline: auto; }

.doc-head__glyph { color: var(--gold); width: 44px; height: 44px; margin-bottom: 22px; }
.doc-head__label { margin: 0; }
.title {
  margin: 0.3em 0 0.32em;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.625rem, 1.85rem + 3.3vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.005em;
  color: var(--pearl);
}
.lede {
  margin: 0 0 30px;
  max-width: 36em;
  font-size: clamp(1.1875rem, 1.1rem + 0.35vw, 1.3125rem);
  line-height: 1.55;
  color: var(--text-2);
}
.doc-head__rule { width: 152px; margin-bottom: 8px; }

/* Table of contents — a card on phones, a sticky chart legend on wide screens. */
.toc {
  margin-block: 28px 8px;
  padding: 18px 20px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: rgba(20, 16, 12, 0.6);
}
.toc__title { margin: 0 0 6px; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc a {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}
.toc a:hover { color: var(--pearl); }
.toc .num {
  flex: none;
  min-width: 1.7em;
  padding-top: 0.12em;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

@media (min-width: 600px) and (max-width: 1099px) {
  .toc ol { columns: 2; column-gap: 32px; }
  .toc li { break-inside: avoid; }
}

@media (min-width: 1100px) {
  .doc--toc {
    display: grid;
    grid-template-columns: 14.5rem minmax(0, var(--measure));
    column-gap: clamp(48px, 6vw, 96px);
    justify-content: center;
    align-items: start;
  }
  .doc--toc .doc-head { grid-column: 2; margin-inline: 0; }
  .doc--toc .toc {
    grid-column: 1;
    grid-row: 2;
    position: sticky;
    top: 28px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    margin: 30px 0 0;
    padding: 2px 0 0 18px;
    border: 0;
    border-left: 1px solid var(--hairline-soft);
    border-radius: 0;
    background: none;
  }
  .doc--toc .prose { grid-column: 2; grid-row: 2; margin-inline: 0; }
}

/* ── Prose ────────────────────────────────────────────────────────── */
.prose { padding-top: 12px; overflow-wrap: break-word; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  margin: 2.5em 0 0.65em;
  font-size: clamp(1.375rem, 1.24rem + 0.5vw, 1.625rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--pearl);
  scroll-margin-top: 24px;
}
.prose h2 .num {
  flex: none;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--gold);
  transform: translateY(-0.12em);
}
.prose > h2:first-child, .prose > .card + h2 { margin-top: 1.9em; }
.prose h3 {
  margin: 1.9em 0 0.45em;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--pearl);
  scroll-margin-top: 24px;
}
.prose h2 + h3 { margin-top: 0.9em; }
.prose strong { color: var(--pearl); font-weight: 600; }
.prose em { font-style: italic; }

a { color: var(--gold); }
.prose a, .site-footer__contact a, .inline-link {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(201, 169, 110, 0.5);
  text-underline-offset: 0.22em;
}
.prose a:hover, .site-footer__contact a:hover, .inline-link:hover {
  color: var(--gold-warm);
  text-decoration-color: var(--gold-warm);
}

/* Lists: the four-point star as the bullet. */
.prose ul { padding-left: 1.5em; list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before {
  content: "";
  position: absolute;
  left: -1.35em;
  top: 0.52em;
  width: 0.62em;
  height: 0.62em;
  background: url(/assets/star.305a85249b.svg) center / contain no-repeat;
}
.prose ol { padding-left: 1.6em; }
.prose ol > li { padding-left: 0.3em; }
.prose ol > li::marker { color: var(--gold); font-family: var(--mono); font-size: 0.9em; }
.prose li + li { margin-top: 0.5em; }
.prose li > ul, .prose li > ol { margin: 0.5em 0 0; }

/* The short-version card — leather, hairline gold, one soft shadow. */
.card {
  margin: 0 0 1.4em;
  padding: 20px 22px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: rgba(20, 16, 12, 0.72);
  box-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.9);
}
@media (min-width: 600px) { .card { padding: 24px 28px 8px; } }
.card__title { margin: 0 0 12px !important; }

/* A cool note — the pre-dawn light, for things that matter more than Lumio. */
.note {
  margin: 1.5em 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--rose-blue);
}
.note .label { color: var(--rose-blue); margin: 0 0 6px; }
.note p:last-child { margin-bottom: 0; }

.vow { margin: 1.6em 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Data table — stacks into labelled rows on phones. */
.table-wrap { margin: 1.4em 0 1.6em; }
.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.data caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 12px;
}
.data th {
  padding: 0 14px 10px 0;
  text-align: left;
  vertical-align: bottom;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--hairline);
}
.data td {
  padding: 14px 14px 14px 0;
  vertical-align: top;
  color: var(--text);
  border-bottom: 1px solid var(--hairline-soft);
}
.data td:first-child { color: var(--pearl); font-weight: 500; width: 24%; }
.data td:last-child { width: 28%; }
@media (max-width: 719px) {
  .data, .data caption, .data tbody, .data tr, .data td { display: block; width: auto !important; }
  .data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .data tr { padding: 16px 0 14px; border-bottom: 1px solid var(--hairline-soft); }
  .data td { padding: 0; border: 0; }
  .data td + td { margin-top: 10px; }
  .data td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
  }
  .data td:first-child::before { display: none; }
  .data td:first-child { font-size: 1rem; }
}

/* FAQ entries */
.qa h3 { margin-top: 1.7em; }
.contact-card { text-align: left; }
.contact-card .big {
  display: inline-block;
  margin: 2px 0 10px;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 500;
  word-break: break-all;
}

/* Contact form — stands in for an email address until one exists. */
.contact-form { display: grid; gap: 6px; margin: 6px 0 18px; }
.contact-form label {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.contact-form .optional { color: var(--text-3); letter-spacing: 0.08em; }
.contact-form select,
.contact-form textarea,
.contact-form input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--ground);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.contact-form textarea { resize: vertical; min-height: 9em; line-height: 1.55; }
.contact-form select:focus-visible,
.contact-form textarea:focus-visible,
.contact-form input:focus-visible {
  outline: 2px solid var(--gold-warm);
  outline-offset: 2px;
  border-color: var(--gold-warm);
}
.contact-form button {
  justify-self: start;
  margin-top: 16px;
  padding: 12px 30px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--navy);
  border: 1px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
}
.contact-form button:hover { color: var(--gold-warm); border-color: var(--gold-warm); }
.contact-form button:focus-visible { outline: 2px solid var(--gold-warm); outline-offset: 3px; }
/* Honeypot: off-screen for people, visible to naive bots. */
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Landing ──────────────────────────────────────────────────────── */
.hero {
  padding-block: clamp(36px, 9vw, 104px) clamp(40px, 7vw, 80px);
  text-align: center;
}
.hero__mark {
  width: clamp(64px, 12vw, 92px);
  height: auto;
  margin: 0 auto 30px;
  color: var(--gold-warm);
  stroke-width: 1.3;
}
.hero .label { margin: 0; }
.hero__title {
  margin: 0.22em auto 0.28em;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(3rem, 1.9rem + 5.2vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--pearl);
}
.hero__lede {
  max-width: 33em;
  margin: 0 auto 36px;
  font-size: clamp(1.1875rem, 1.08rem + 0.45vw, 1.375rem);
  line-height: 1.55;
  color: var(--text-2);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 11.5rem;
  padding: 9px 26px 11px;
  border: 1px solid rgba(201, 169, 110, 0.6);
  border-radius: 999px;
  background: rgba(10, 14, 26, 0.72);
  color: var(--pearl);
  text-decoration: none;
  line-height: 1.2;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.badge:hover { border-color: var(--gold-warm); background: var(--navy); }
.badge__small { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.badge__big { font-size: 1.1875rem; font-weight: 500; }
.hero__note { margin: 18px 0 0; font-size: 0.9375rem; color: var(--text-3); }

.section { padding-block: clamp(48px, 8vw, 96px); }
.section__head { max-width: 40rem; margin: 0 auto clamp(28px, 5vw, 48px); text-align: center; }
.section__head .rule { width: 140px; margin: 0 auto 26px; }
.section__head .label { margin: 0 0 10px; }
.section__title {
  margin: 0;
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--pearl);
}

.steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 620px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.step {
  padding: 20px 2px 4px;
  border-top: 1px solid var(--hairline);
}
.step__num { margin: 0 0 12px; }
.step h3 { margin: 0 0 8px; font-size: 1.1875rem; font-weight: 500; line-height: 1.35; color: var(--pearl); }
.step p { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--text-2); }

.rules {
  max-width: 40rem;
  margin: 0 auto;
  padding: 6px 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: rgba(20, 16, 12, 0.66);
  list-style: none;
  box-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.9);
}
.rules li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}
.rules li + li { border-top: 1px solid var(--hairline-soft); }
.rules .glyph { flex: none; width: 14px; height: 14px; margin-top: 0.35em; color: var(--gold); }
.vow-line { margin: 26px 0 0; text-align: center; }

.ritual-line {
  max-width: 22em;
  margin: 0 auto;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem);
  line-height: 1.3;
  text-align: center;
  color: var(--pearl);
}
.ritual-sub { max-width: 34em; margin: 18px auto 0; text-align: center; color: var(--text-2); }

.index {
  display: grid;
  gap: 12px;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .index li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.index a {
  display: block;
  height: 100%;
  padding: 18px 20px 17px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: rgba(20, 16, 12, 0.5);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.index a:hover { border-color: rgba(201, 169, 110, 0.5); background: rgba(20, 16, 12, 0.8); }
.index__t { display: flex; justify-content: space-between; gap: 12px; color: var(--pearl); font-weight: 500; }
.index__t span[aria-hidden] { color: var(--gold); }
.index__d { display: block; margin-top: 4px; font-size: 0.9375rem; line-height: 1.5; color: var(--text-2); }

/* ── 404 ──────────────────────────────────────────────────────────── */
.lost { padding-block: clamp(56px, 12vw, 136px); text-align: center; }
.lost .glyph { width: 56px; height: 56px; margin: 0 auto 26px; color: var(--rose-blue); }
.lost .label { color: var(--rose-blue); margin: 0; }
.lost p { max-width: 30em; margin: 0 auto 1em; color: var(--text-2); }
.lost .home { display: inline-block; margin-top: 10px; padding: 8px 2px; font-size: 1.0625rem; }
.lost__more { margin-top: 36px !important; font-size: 0.9375rem; }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  padding-block: 40px 44px;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-3);
}
.site-footer__rule { width: 170px; margin: 0 auto 22px; }
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 22px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.site-footer__links a {
  display: inline-block;
  padding: 10px 1px;
  color: var(--text-2);
  text-decoration: none;
}
.site-footer__links a:hover { color: var(--pearl); }
.site-footer__links a[aria-current="page"] { color: var(--gold); }
.site-footer__contact { margin: 0 0 14px; overflow-wrap: anywhere; }
.site-footer__meta { margin: 0; color: var(--text-3); }
.br-narrow { display: none; }
@media (max-width: 480px) {
  .br-narrow { display: inline; }
  .site-footer__meta .sep { display: none; }
}

/* ── Motion & print ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  html { background: #fff; color: #000; }
  body { font-size: 11pt; }
  .sky, .skip, .site-nav, .toc, .rule, .glyph, .badges { display: none !important; }
  .title, .prose h2, .prose h3, .prose strong, .data td, .data td:first-child, p, li { color: #000 !important; }
  .label, .data th, .prose h2 .num { color: #555 !important; }
  .card, .rules { background: none; border: 1px solid #999; box-shadow: none; }
  a, .prose a { color: #000 !important; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
