/* ==========================================================================
   Moodbound — editorial botanical
   Typography: Fraunces (display) + Newsreader (body), via fonts.bunny.net.
   Direction: quiet field-guide. Paper/ink dominant, lavender + sage as sharp
   accents. Hairline rules, asterism dividers, oversized marginal numerals.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
  /* Paper / ink palette */
  --paper:      #f2ede2;
  --paper-2:    #e9e1cf;
  --paper-3:    #ddd3bb;
  --ink:        #1a1830;
  --ink-2:      #4a3f6b;
  --muted:      #6e6280;
  --lavender:   #7a68a8;
  --lavender-2: #4f3e78;
  --sage:       #6e8367;
  --rule:       #c9bda2;

  /* Typography */
  --serif-display: "Fraunces", "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --serif-body:    "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;

  --fs-body:    1.0625rem;  /* 17px */
  --fs-small:   0.875rem;
  --fs-lede:    1.375rem;
  --fs-h1:      clamp(3rem, 7vw + 1rem, 5.75rem);
  --fs-h2:      clamp(2rem, 3vw + 1rem, 2.875rem);
  --fs-h3:      1.25rem;
  --fs-ord:     clamp(4rem, 10vw, 8rem);

  --lh-body:    1.6;
  --lh-tight:   1.05;
  --lh-prose:   1.65;

  /* Geometry */
  --wrap:  70rem;
  --prose: 36rem;

  /* Spacing */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;

  /* Paper grain — faint low-opacity SVG noise */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.09  0 0 0 0 0.18  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #17152a;
    --paper-2:    #1f1d3c;
    --paper-3:    #2a2750;
    --ink:        #f0e9dc;
    --ink-2:      #c6bbb0;
    --muted:      #9489a8;
    --lavender:   #b8a8e0;
    --lavender-2: #d5c6ff;
    --sage:       #a9bfa2;
    --rule:       #2d2851;

    --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.92  0 0 0 0 0.88  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  }
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  font-feature-settings: "liga", "kern", "onum";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  background-image: var(--grain);
  background-size: 220px 220px;
  background-repeat: repeat;
}

img { max-width: 100%; height: auto; display: block; }

/* ---------- Links ---------- */

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--lavender);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-thickness 120ms ease, color 120ms ease;
}
a:hover {
  color: var(--lavender-2);
  text-decoration-thickness: 2px;
}

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

/* ---------- Type ---------- */

h1, h2, h3, .display {
  font-family: var(--serif-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  margin: 0 0 var(--s-4);
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 400; letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); font-weight: 450; }
h3 {
  font-size: var(--fs-h3);
  font-family: var(--serif-body);
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-top: var(--s-6);
}

p { margin: 0 0 var(--s-4); max-width: var(--prose); }

em { font-family: var(--serif-body); font-style: italic; font-feature-settings: "liga", "kern"; }

strong { font-weight: 650; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.prose { max-width: var(--prose); }

/* Small-caps section label — "NO. 01 · WHAT IT IS" */
.eyebrow {
  font-family: var(--serif-display);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant: small-caps;
  font-variation-settings: "opsz" 14;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--lavender-2);
  margin: 0 0 var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.eyebrow::before, .eyebrow::after {
  content: "";
  height: 1px;
  background: var(--rule);
  flex: 0 0 var(--s-5);
}
.eyebrow::after { flex: 1 1 auto; }

/* Lists — restrained, not bullet-heavy */
ul.plain {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-5);
  max-width: var(--prose);
}
ul.plain li {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  padding-left: var(--s-5);
}
ul.plain li:first-child { border-top: 1px solid var(--rule); }
ul.plain li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--lavender);
  font-family: var(--serif-display);
}

/* Asterism divider — ⁂ */
.dinkus {
  text-align: center;
  color: var(--muted);
  font-family: var(--serif-display);
  font-size: 1.25rem;
  letter-spacing: 0.6em;
  margin: var(--s-8) auto;
  max-width: 10ch;
  user-select: none;
}
.dinkus::before { content: "⁂"; }

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-3) var(--s-4);
  z-index: 100;
  text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-5);
  padding-top: var(--s-5);
  padding-bottom: var(--s-5);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--fs-small);
  font-variant: small-caps;
  font-family: var(--serif-display);
  letter-spacing: 0.12em;
}
.site-header nav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  padding: var(--s-9) 0 var(--s-8);
  position: relative;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  align-items: end;
}
@media (min-width: 52rem) {
  .hero .wrap {
    grid-template-columns: auto 1fr;
    gap: var(--s-7);
  }
}
.hero-mark {
  width: 112px;
  height: 112px;
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 24px 48px -24px rgba(26,24,48,0.45);
}
@media (prefers-color-scheme: dark) {
  .hero-mark {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.06) inset,
      0 24px 48px -18px rgba(0,0,0,0.7);
  }
}
.hero-text h1 {
  margin: 0;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.hero-text h1 em {
  font-style: italic;
  color: var(--lavender-2);
  font-weight: 400;
}
.hero-sub {
  font-family: var(--serif-body);
  font-size: var(--fs-lede);
  line-height: 1.45;
  margin: var(--s-5) 0 var(--s-3);
  max-width: 28ch;
  color: var(--ink);
}
.hero-meta {
  font-family: var(--serif-display);
  font-size: 0.875rem;
  font-variant: small-caps;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 var(--s-5);
}
.hero-meta span + span::before {
  content: "·";
  margin: 0 var(--s-3);
  color: var(--rule);
}

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

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--lavender-2);
  border-color: var(--lavender-2);
  color: var(--paper);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-2);
}
@media (prefers-color-scheme: dark) {
  .btn-ghost { border-color: var(--ink-2); }
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Sections ---------- */

.section {
  padding: var(--s-8) 0;
}
.section .wrap.prose {
  max-width: 46rem;
}
.section h2 {
  margin: 0 0 var(--s-5);
}
.section h3 {
  margin-top: var(--s-7);
}

/* Drop cap on the first paragraph after a section h2 */
.dropcap::first-letter {
  font-family: var(--serif-display);
  float: left;
  font-size: 4.5rem;
  line-height: 0.85;
  padding: 0.35rem 0.6rem 0 0;
  margin: 0.15rem 0.15rem 0 0;
  font-weight: 500;
  color: var(--lavender-2);
  font-variation-settings: "opsz" 144;
}

/* ---------- How it works (editorial steps) ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}
.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.steps > li:first-child { border-top: 1px solid var(--rule); }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--serif-display);
  font-size: var(--fs-ord);
  font-weight: 300;
  line-height: 0.85;
  color: var(--lavender);
  font-variant-numeric: lining-nums;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  letter-spacing: -0.04em;
  opacity: 0.85;
}
@media (min-width: 44rem) {
  .steps > li {
    grid-template-columns: 7.5rem 1fr;
    gap: var(--s-6);
    align-items: start;
  }
}
.steps h3 {
  margin: 0 0 var(--s-2);
  font-family: var(--serif-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.steps p { margin: 0; color: var(--ink-2); }
@media (prefers-color-scheme: dark) {
  .steps p { color: var(--ink); opacity: 0.85; }
}

/* ---------- Features ---------- */

.feature {
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: var(--s-4);
}
.feature:first-of-type { border-top: 1px solid var(--rule); }
.feature:last-of-type { border-bottom: 1px solid var(--rule); }
.feature h3 {
  margin: 0;
  font-family: var(--serif-display);
  font-size: 1.625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
@media (min-width: 44rem) {
  .feature {
    grid-template-columns: 12rem 1fr;
    gap: var(--s-6);
    align-items: start;
  }
  .feature h3 { position: sticky; top: var(--s-5); }
}

/* Content warning */
.cw {
  background: transparent;
  border-left: 2px solid var(--lavender);
  padding: var(--s-2) var(--s-4);
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 var(--s-4);
}
.cw strong { font-style: normal; color: var(--ink); font-weight: 600; }

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

details {
  border-top: 1px solid var(--rule);
  padding: var(--s-4) 0;
}
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary {
  cursor: pointer;
  font-family: var(--serif-display);
  font-size: 1.25rem;
  font-weight: 450;
  letter-spacing: -0.005em;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  color: var(--ink);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-family: var(--serif-display);
  font-size: 1.375rem;
  color: var(--lavender);
  line-height: 1;
  flex-shrink: 0;
  transition: transform 160ms ease;
}
details[open] summary::after { content: "–"; color: var(--lavender-2); }
details p {
  margin-top: var(--s-3);
  color: var(--ink-2);
}
@media (prefers-color-scheme: dark) {
  details p { color: var(--ink); opacity: 0.85; }
}

/* ---------- CTA band ---------- */

.cta-band {
  padding: var(--s-8) 0;
  text-align: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.cta-band .wrap { max-width: 36rem; }
.cta-band h2 {
  font-style: italic;
  font-weight: 400;
  color: var(--lavender-2);
  margin-bottom: var(--s-4);
}
.cta-band p { margin-left: auto; margin-right: auto; }
.cta-band .cta-row { justify-content: center; margin-top: var(--s-5); }

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

.site-footer {
  padding: var(--s-7) 0 var(--s-8);
  color: var(--muted);
  font-size: var(--fs-small);
}
.site-footer .wrap {
  display: grid;
  gap: var(--s-4);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
}
.site-footer a {
  color: var(--muted);
  text-decoration-color: var(--rule);
}
.site-footer a:hover { color: var(--ink); text-decoration-color: var(--lavender); }
.site-footer p { margin: 0; max-width: 56ch; }
.site-footer .crisis {
  font-style: italic;
  font-family: var(--serif-body);
}

/* ---------- Motion (gated) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-mark, .hero-text > * {
    animation: riseIn 680ms cubic-bezier(0.2, 0.65, 0.2, 1) both;
  }
  .hero-text > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-text > *:nth-child(2) { animation-delay: 0.12s; }
  .hero-text > *:nth-child(3) { animation-delay: 0.18s; }
  .hero-text > *:nth-child(4) { animation-delay: 0.24s; }
  @keyframes riseIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 40rem) {
  :root { --fs-body: 1rem; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
  .hero { padding: var(--s-8) 0 var(--s-7); }
  .hero-mark { width: 88px; height: 88px; }
  .section { padding: var(--s-7) 0; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}

/* ---------- Print ---------- */

@media print {
  body { background: #fff; color: #000; }
  .site-header nav, .cta-row, .cta-band, .dinkus { display: none; }
  a { color: #000; text-decoration: underline; }
}
