/* ============================================================================
   Lore — shared design system
   Used by every page on golore.app (landing, support, docs, legal).
   Plain CSS, no build step. Tokens mirror the mobile app's parchment palette.
   ========================================================================== */

:root {
  --bg: #F2EEE6;
  --bg-deep: #EAE4D6;
  --card: #F8F5EE;
  --card-soft: #FBF8F1;
  --ink: #1D1A15;
  --ink-soft: #4A4338;
  --muted: #8A7F6C;
  --gold: #A8894A;
  --gold-soft: #C9B37A;
  --coral: #D26A4E;
  --coral-deep: #B4553B;
  /* CTA stays the confident saturated coral in both themes. */
  --coral-cta: #D26A4E;
  --coral-cta-deep: #B4553B;
  --rule: rgba(168, 137, 74, 0.4);
  --hair: rgba(29, 26, 21, 0.12);
  --hair-strong: rgba(29, 26, 21, 0.18);

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --maxw: 1080px;
  --maxw-prose: 720px;
  --nav-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140F;
    --bg-deep: #0F0E0A;
    --card: #1F1C16;
    --card-soft: #242017;
    --ink: #EDE6D4;
    --ink-soft: #B8AC93;
    --muted: #8A7F6C;
    --gold: #C9B37A;
    --gold-soft: #A8894A;
    --coral: #E89B82;
    --coral-deep: #D26A4E;
    --rule: rgba(201, 179, 122, 0.45);
    --hair: rgba(237, 230, 212, 0.12);
    --hair-strong: rgba(237, 230, 212, 0.2);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(168, 137, 74, 0.10), transparent 60%),
    radial-gradient(140% 100% at 50% 120%, var(--bg-deep), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100svh;
}

/* faint archival grain over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: var(--coral-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Typography ---------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(34px, 6.5vw, 56px); line-height: 1.12; }
h2 { font-size: clamp(26px, 4vw, 38px); line-height: 1.18; }
h3 { font-size: clamp(20px, 2.6vw, 25px); line-height: 1.25; }
h4 { font-size: 18px; line-height: 1.3; }
.it { font-style: italic; }
.gold { color: var(--gold); font-style: italic; }

p { margin: 0 0 1em; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  font-family: var(--sans);
  margin: 0 0 18px;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.6;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
}

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

/* asterism rule — the app's DiamondRule motif */
.rule {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 220px;
  margin: 34px auto;
}
.rule .line { flex: 1; height: 1px; background: var(--rule); opacity: 0.7; }
.rule .mark {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--gold);
  opacity: 0.85;
  line-height: 1;
}
.rule.left { margin-left: 0; }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--maxw-prose); margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }
@media (max-width: 640px) { section { padding: 52px 0; } }

/* ---------- Top navigation ------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hair);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-size: 19px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--hair); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14.5px;
  color: var(--ink-soft);
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links .cta-sm { color: #FBF6EF; }
@media (max-width: 720px) {
  .nav-links { gap: 16px; }
  .nav-links a.hide-sm { display: none; }
}

/* ---------- Buttons ------------------------------------------------------- */

.cta, .cta-sm, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--sans);
  font-weight: 600;
  text-decoration: none;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.cta:hover, .cta-sm:hover, .btn:hover { text-decoration: none; }

.cta {
  background: var(--coral-cta);
  color: #FBF6EF;
  font-size: 15.5px;
  letter-spacing: 0.2px;
  padding: 15px 28px;
  box-shadow: 0 10px 24px -12px rgba(210, 106, 78, 0.7);
}
.cta:hover {
  background: var(--coral-cta-deep);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -12px rgba(210, 106, 78, 0.8);
}
.cta:active { transform: translateY(0); }
.cta svg { width: 18px; height: 18px; }

.cta-sm {
  background: var(--coral-cta);
  color: #FBF6EF;
  font-size: 14px;
  padding: 9px 18px;
  box-shadow: 0 8px 18px -12px rgba(210, 106, 78, 0.7);
}
.cta-sm:hover { background: var(--coral-cta-deep); }

/* secondary / ghost */
.btn-ghost {
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  padding: 14px 22px;
  border: 1px solid var(--hair-strong);
}
.btn-ghost:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Cards / feature grid ------------------------------------------ */

.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 0 rgba(201, 179, 122, 0.18) inset;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); margin: 0; font-size: 15px; }
.card .ico {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  margin-bottom: 16px;
}
.card .ico svg { width: 28px; height: 28px; }

/* alternating section band */
.band { background: color-mix(in srgb, var(--bg-deep) 55%, transparent); border-block: 1px solid var(--hair); }

/* ---------- Steps (how it works) ------------------------------------------ */

.steps { counter-reset: step; display: grid; gap: 26px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 12px;
}
.step h3 { font-size: 20px; margin-bottom: 6px; }
.step p { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* ---------- FAQ (details/summary) ----------------------------------------- */

.faq { max-width: var(--maxw-prose); margin: 0 auto; }
.faq details {
  border-bottom: 1px solid var(--hair);
  padding: 4px 0;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 36px 18px 2px;
  position: relative;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 22px;
  color: var(--gold);
  transition: transform 160ms ease;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details p {
  margin: 0 2px 18px;
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 62ch;
}

/* ---------- Forms --------------------------------------------------------- */

.form { display: grid; gap: 18px; max-width: 560px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.field input,
.field select,
.field textarea {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--card-soft);
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
}
/* honeypot — visually and AT-hidden, off-screen */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note {
  font-size: 13px;
  color: var(--muted);
}
.form-status {
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14.5px;
  display: none;
}
.form-status.ok { display: block; background: color-mix(in srgb, var(--gold) 14%, var(--card)); border: 1px solid var(--rule); color: var(--ink); }
.form-status.err { display: block; background: color-mix(in srgb, var(--coral) 14%, var(--card)); border: 1px solid var(--coral); color: var(--ink); }
button[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Docs layout (Linear-style sidebar) ---------------------------- */

.docs { display: grid; grid-template-columns: 248px 1fr; gap: 48px; max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 96px; align-items: start; }
.docs-side {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  font-size: 14.5px;
}
.docs-side .group { margin-bottom: 26px; }
.docs-side .group-title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 10px;
  padding-left: 12px;
}
.docs-side ul { list-style: none; margin: 0; padding: 0; }
.docs-side li { margin: 1px 0; }
.docs-side a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  border-left: 2px solid transparent;
}
.docs-side a:hover { background: color-mix(in srgb, var(--gold) 8%, transparent); color: var(--ink); text-decoration: none; }
.docs-side a.active {
  color: var(--ink);
  font-weight: 600;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border-left-color: var(--gold);
}

.docs-main { min-width: 0; }
.docs-main .doc-eyebrow {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin: 0 0 10px;
}
.docs-main h1 { font-size: clamp(30px, 4.5vw, 42px); margin-bottom: 14px; }
.docs-main h2 {
  font-size: 26px;
  margin: 44px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair);
}
.docs-main h3 { font-size: 20px; margin: 28px 0 8px; }
.docs-main p, .docs-main li { color: var(--ink-soft); font-size: 16px; }
.docs-main ul, .docs-main ol { padding-left: 22px; margin: 0 0 1em; }
.docs-main li { margin: 6px 0; }
.docs-main .lead { font-family: var(--serif); font-size: 20px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 8px; }

/* callout / note box inside docs */
.note-box {
  background: var(--card);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 22px 0;
  font-size: 15px;
}
.note-box p { margin: 0; color: var(--ink-soft); }
.note-box strong { color: var(--ink); }

/* steps inside docs */
.docs-main ol.steps-list { counter-reset: s; list-style: none; padding-left: 0; }
.docs-main ol.steps-list > li {
  counter-increment: s;
  position: relative;
  padding-left: 46px;
  margin: 18px 0;
}
.docs-main ol.steps-list > li::before {
  content: counter(s);
  position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-style: italic; font-size: 16px;
  color: var(--gold);
  border: 1px solid var(--rule); border-radius: 50%;
}

/* prev/next pager */
.doc-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hair); }
.doc-pager a { font-size: 15px; }
.doc-pager .nxt { margin-left: auto; text-align: right; }

@media (max-width: 820px) {
  .docs { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .docs-side {
    position: static;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--hair);
  }
  .docs-side .group { margin-bottom: 16px; }
}

/* ---------- Footer -------------------------------------------------------- */

.footer { border-top: 1px solid var(--hair); padding: 48px 0 56px; margin-top: 24px; }
.footer .container { display: flex; flex-wrap: wrap; gap: 32px 56px; justify-content: space-between; }
.footer .brand-col { max-width: 280px; }
.footer .brand-col .blurb { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.footer .cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer .col h4 { font-family: var(--sans); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 14px; }
.footer .col a { display: block; color: var(--ink-soft); font-size: 14.5px; margin: 8px 0; }
.footer .col a:hover { color: var(--ink); text-decoration: none; }
.footer .legal-line {
  width: 100%;
  margin-top: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 13px;
  font-family: var(--serif);
  font-style: italic;
}

/* utility */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.maxw-prose { max-width: var(--maxw-prose); }
