/* ─────────────────────────────────────────────────────────────────────────
   Heirloop — developer site & privacy policy
   Aesthetic: "heirloom instrument" — an antique family ledger / certificate.
   Self-contained: no external fonts, scripts, or assets (CSP-safe).
   Palette descends from the game (gold #b8843a, aged paper, sepia ink).
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --paper:      #ece2ce;
  --paper-deep: #e2d5ba;
  --vellum:     #f7f0e1;
  --vellum-2:   #fbf6ea;
  --edge:       #d9ccae;
  --edge-soft:  #e5dac0;

  --ink:    #2a241c;
  --ink-2:  #6b5f4c;
  --ink-3:  #a1927a;

  --gold:      #a8792d;
  --gold-lit:  #c79a45;
  --gold-deep: #8a621f;

  --font-display: 'Hoefler Text', 'Baskerville', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-body:    'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --font-label:   ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'SFMono-Regular', 'Cascadia Code', 'Courier New', monospace;

  --measure: 40rem;
  --shadow: 0 1px 2px rgba(42, 36, 28, .06), 0 18px 40px -24px rgba(42, 36, 28, .35);
}

* { box-sizing: border-box; }

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

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background-color: var(--paper);
  /* warm vignette so the page reads like a lit sheet of parchment */
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 250, 238, .8), transparent 60%),
    radial-gradient(140% 120% at 50% 120%, rgba(120, 96, 54, .14), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* fine paper grain overlaid on everything, dialled way down */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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");
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.1rem, 4vw, 2rem) 4.5rem;
}

/* ── Masthead ──────────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding-bottom: 1.4rem;
  margin-bottom: 1.6rem;
  /* certificate-style double rule */
  border-bottom: 2px solid var(--gold);
  position: relative;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent 78%);
  opacity: .55;
}

.seal {
  width: 3.6rem;
  height: 3.6rem;
  flex-shrink: 0;
  color: var(--gold);
  filter: drop-shadow(0 1px 0 rgba(255, 250, 238, .6));
}

/* legacy badge fallback, should any page still use it */
.badge {
  width: 3.4rem; height: 3.4rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.5rem;
  flex-shrink: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.7rem);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.05;
  margin: 0;
}

.tagline {
  margin: .35rem 0 0;
  font-family: var(--font-label);
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ── Language toggle ───────────────────────────────────────────────────── */

.lang-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
  font-family: var(--font-label);
  font-size: .78rem;
  letter-spacing: .04em;
}
.lang-toggle a {
  padding: .34rem .85rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
  background: var(--vellum);
  transition: border-color .2s, color .2s, background .2s;
}
.lang-toggle a:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
  background: var(--vellum-2);
}

/* ── Cards / sections ──────────────────────────────────────────────────── */

.card {
  position: relative;
  background: var(--vellum);
  border: 1px solid var(--edge);
  border-top: 2px solid var(--gold);
  border-radius: 3px;
  padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1.3rem, 4vw, 2.4rem) clamp(1.6rem, 4vw, 2.6rem);
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow);
  max-width: var(--measure);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

section.lang-block { margin-bottom: 2.2rem; }

h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
}
h2 {
  font-size: 1.16rem;
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: .045em;
  margin: 2.2rem 0 .85rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--edge-soft);
  /* gold accent that fades out to the right */
  background: linear-gradient(90deg, var(--gold) 0 2.2rem, transparent 2.2rem) bottom left / 100% 2px no-repeat;
}
h3 {
  font-size: 1.04rem;
  margin: 1.4rem 0 .5rem;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* drop cap for lead paragraphs (landing page) */
.lede::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.5rem;
  line-height: .82;
  padding: .18rem .55rem 0 0;
  color: var(--gold);
  font-weight: 600;
}

/* effective-date stamp on the policy */
.effective {
  font-family: var(--font-label);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding-bottom: 1rem;
  margin-bottom: .4rem;
  border-bottom: 1px dotted var(--edge);
}
.effective strong { color: var(--ink); font-weight: 600; }

ul, ol { margin: 0 0 1rem; padding-left: 1.3rem; }
li { margin-bottom: .45rem; padding-left: .2rem; }
li::marker { color: var(--gold); }

a {
  color: var(--gold-deep);
  text-decoration-color: color-mix(in srgb, var(--gold) 45%, transparent);
  text-underline-offset: 3px;
  transition: color .18s, text-decoration-color .18s;
}
a:hover { color: var(--ink); text-decoration-color: var(--gold); }

strong { color: var(--ink); }

code, .mono {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--paper-deep);
  color: var(--gold-deep);
  padding: .08rem .38rem;
  border-radius: 3px;
  border: 1px solid var(--edge-soft);
}

/* ── Landing-page bits ─────────────────────────────────────────────────── */

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  font-family: var(--font-label);
  font-size: .82rem;
  letter-spacing: .02em;
  color: var(--ink-2);
  margin: 1.2rem 0;
  padding: .8rem 0;
  border-top: 1px solid var(--edge-soft);
  border-bottom: 1px solid var(--edge-soft);
}
.meta-row strong { color: var(--gold-deep); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--gold);
  color: #fdf7ea;
  text-decoration: none;
  padding: .68rem 1.4rem;
  border-radius: 3px;
  font-family: var(--font-label);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 10px 20px -12px rgba(138, 98, 31, .8);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:hover {
  background: var(--gold-deep);
  color: #fdf7ea;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -12px rgba(138, 98, 31, .9);
}
.btn::after { content: "→"; font-size: 1em; }

/* ── Dividers & footer ─────────────────────────────────────────────────── */

hr.divider {
  border: none;
  height: 1.4rem;
  margin: 2.4rem auto;
  max-width: var(--measure);
  text-align: center;
  overflow: visible;
}
hr.divider::before {
  content: "⁂";
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: .3em;
}

footer.site-footer {
  margin-top: 3.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--edge);
  text-align: center;
  font-family: var(--font-label);
  font-size: .76rem;
  letter-spacing: .06em;
  color: var(--ink-3);
}
footer.site-footer::before {
  content: "❧";
  display: block;
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: .5rem;
}

/* ── Focus & motion ────────────────────────────────────────────────────── */

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wrap > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.wrap > *:nth-child(1) { animation-delay: .02s; }
.wrap > *:nth-child(2) { animation-delay: .09s; }
.wrap > *:nth-child(3) { animation-delay: .16s; }
.wrap > *:nth-child(4) { animation-delay: .23s; }
.wrap > *:nth-child(5) { animation-delay: .30s; }
.wrap > *:nth-child(6) { animation-delay: .37s; }

@media (prefers-reduced-motion: reduce) {
  .wrap > * { animation: none; }
  * { scroll-behavior: auto; }
  a, .btn { transition: none; }
}

/* ── Dark theme — deep espresso parchment ──────────────────────────────── */

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #211d18;
    --paper-deep: #2b2620;
    --vellum:     #2a2521;
    --vellum-2:   #322c26;
    --edge:       #423a2e;
    --edge-soft:  #38312a;

    --ink:    #efe6d3;
    --ink-2:  #c2b49a;
    --ink-3:  #8a7f6c;

    --gold:      #c99a49;
    --gold-lit:  #e0b567;
    --gold-deep: #d8ab5b;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 22px 48px -26px rgba(0, 0, 0, .8);
  }
  body {
    background-image:
      radial-gradient(120% 80% at 50% -10%, rgba(90, 72, 40, .35), transparent 60%),
      radial-gradient(140% 120% at 50% 120%, rgba(0, 0, 0, .5), transparent 55%);
  }
  body::before { mix-blend-mode: screen; opacity: .05; }
  .btn { color: #201c18; }
  .btn:hover { color: #201c18; }
}

/* ── Narrow screens ────────────────────────────────────────────────────── */

@media (max-width: 30rem) {
  body { font-size: 1.02rem; }
  .site-header { gap: .85rem; }
  .seal { width: 3rem; height: 3rem; }
  .lede::first-letter { font-size: 3rem; }
}
