/* ===========================================================
   Heirloom site foundation — shared by every getwishie.com
   marketing page (index, gives, premium, teacher-appreciation,
   privacy-policy, terms-of-service).

   Tokens, base type, nav, footer, buttons, links, section
   rhythm and the page frame live here. Page-specific layout
   (hero art, pickers, pricing tables, legal body copy, etc.)
   stays in that page's own stylesheet. See SITE-STYLE.md for
   the house rules and how to use these classes.
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
:target { scroll-margin-top: 5.5rem; }

:root {
  color-scheme: light;
  /* paper */
  --paper-0: #FFFDF8; --paper-1: #FAF4E9; --paper-2: #F3EAD8;
  --linen-1: #F0E6D2; --linen-2: #E5DCC9; --linen-3: #D5C9AF;
  /* spruce */
  --spruce-950: #0E231A; --spruce-900: #1B382B; --spruce-800: #234534;
  --spruce-700: #1E4D38; --spruce-600: #2E5743; --spruce-500: #3E6B52;
  --spruce-300: #7FA38C; --spruce-200: #A8BCAE; --spruce-100: #D9E4D6; --spruce-50: #E9F0E6;
  /* persimmon (the one action colour) */
  --persimmon-700: #B5482A; --persimmon-600: #CB4F2F; --persimmon-500: #E2603C;
  --persimmon-400: #E96F4B; --persimmon-100: #F6E3DC; --persimmon-50: #FBEFE9;
  /* brass (earned only: ratings, badges) */
  --brass-700: #8A6A1F; --brass-600: #A87A22; --brass-500: #D9A441; --brass-200: #E8CD8F; --brass-50: #FBF3DD;
  /* ink */
  --ink-1: #1C2B23; --ink-2: #54604F; --ink-3: #8A8062;

  --bg-canvas: var(--paper-1);
  --bg-card: var(--paper-0);
  --bg-sunken: var(--paper-2);
  --bg-inverse: var(--spruce-950);
  --surface-brand-soft: var(--spruce-50);
  --border-line: var(--linen-2);
  --border-soft: var(--linen-1);
  --border-strong: var(--linen-3);

  --text-primary: var(--ink-1);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-3);
  --text-brand: var(--spruce-700);
  --text-on-action: #FFF8EE;
  --text-on-inverse: #F3EEE1;
  --text-muted-on-inverse: #A8BCAE;

  --action-primary: var(--persimmon-500);
  --action-primary-press: var(--persimmon-600);
  --on-action-strong: var(--spruce-950);
  --action-secondary: var(--spruce-700);
  --link: var(--spruce-700);

  --success-bg: var(--spruce-50);
  --success-text: var(--spruce-700);

  /* type: five sizes, no more */
  --font-display: 'Young Serif', Georgia, serif;
  --font-body: 'Hanken Grotesk', -apple-system, 'Segoe UI', sans-serif;
  --step-display: clamp(2.5rem, 1.9rem + 3.2vw, 4.15rem);
  --step-title: clamp(1.7rem, 1.45rem + 1.1vw, 2.1rem);
  --step-lead: 1.1875rem;   /* 19px */
  --step-body: 1.0625rem;   /* 17px */
  --step-small: 0.875rem;   /* 14px */

  /* layout */
  --margin: clamp(1.1rem, 1.5vw + 0.6rem, 2.75rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(4.5rem, 7vw, 7.5rem);
  --radius-sm: 9px;   /* tags, small chips */
  --radius-md: 12px;  /* buttons, inputs */
  --radius-lg: 16px;  /* cards, sections */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms; --t-hover: 180ms; --t-ui: 240ms; --t-reveal: 800ms;
  --stagger-line: 90ms; --stagger-item: 70ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg-canvas: #081411;
    --bg-card: #0F2219;
    --bg-sunken: #040B08;
    --bg-inverse: var(--paper-1);
    --surface-brand-soft: #152C20;
    --border-line: #1D3A2A;
    --border-soft: #16301F;
    --border-strong: #2C523C;
    --text-primary: #F3EEE1;
    --text-secondary: #C9D8CC;
    --text-muted: #7FA38C;
    --text-brand: #A8BCAE;
    --text-on-inverse: var(--ink-1);
    --text-muted-on-inverse: var(--ink-3);
    --action-primary: var(--persimmon-400);
    --action-primary-press: var(--persimmon-500);
    --on-action-strong: #081411;
    --action-secondary: var(--spruce-200);
    --link: var(--spruce-300);
    --success-bg: #152C20;
    --success-text: var(--spruce-100);
  }
}

/* ---------- base type ---------- */
body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font: 400 var(--step-body)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; max-width: 62ch; text-wrap: pretty; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--link); }
::selection { background: var(--action-primary); color: var(--text-on-action); }
:focus-visible { outline: 2px solid var(--action-primary); outline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- page frame ---------- */
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--margin); }
.only-wide { display: none; }
@media (min-width: 52em) { .only-wide { display: inline; } }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: var(--radius-md);
  font: 700 var(--step-body)/1 var(--font-body); white-space: nowrap; text-decoration: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--action-primary); color: var(--on-action-strong); font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { background: var(--action-primary-press); } }
.btn-ghost { background: transparent; color: var(--action-secondary); border: 1.5px solid var(--border-strong); }
@media (hover: hover) and (pointer: fine) { .btn-ghost:hover { background: var(--surface-brand-soft); } }
.link-row { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.link-row a { font: 600 var(--step-small)/1 var(--font-body); color: var(--text-secondary); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .link-row a:hover { text-decoration-color: currentColor; color: var(--text-primary); } }

/* ---------- section rhythm ---------- */
.section { padding-block: calc(var(--section) / 2); }
.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: var(--step-title); line-height: 1.12; letter-spacing: -0.01em; color: var(--text-primary); max-width: 16ch; }
.section-head p { font: 400 var(--step-lead)/1.5 var(--font-body); color: var(--text-secondary); margin-top: 10px; max-width: 46ch; }
.field-dark { background: var(--spruce-950); color: var(--text-on-inverse); }
.field-dark .section-head h2, .field-dark h3 { color: var(--paper-1); }
.field-dark .section-head p { color: var(--spruce-200); }

/* ===================== NAV ===================== */
.nav {
  position: sticky; top: 0; z-index: 20; background: var(--bg-canvas);
  border-bottom: 4px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px var(--margin);
}
.nav-mark { font: 400 26px/1 var(--font-display); color: var(--text-primary); text-decoration: none; display: inline-block; white-space: nowrap; }
/* both i's: the font's own "i" in persimmon sits under a dotless i (U+0131) in ink, so only the tittle shows (brand WishieLogo HLTittleI) */
.nav-mark .tittle { position: relative; display: inline-block; }
.nav-mark .tittle-dot { position: absolute; left: 0; top: 0; color: var(--action-primary); }
.nav-mark .tittle-stem { position: relative; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-back { font: 600 var(--step-small)/1 var(--font-body); color: var(--text-secondary); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .nav-back:hover { color: var(--text-primary); } }
@media (max-width: 560px) {
  .nav { padding: 14px var(--margin); }
  .nav-mark { font-size: 21px; }
  .nav-back { display: none; }
  .nav .btn-ghost { padding: 0 16px; min-height: 44px; font-size: var(--step-small); }
}

/* ===================== FOOTER ===================== */
.footer { background: var(--spruce-950); color: var(--spruce-200); padding: 48px var(--margin) 32px; }
.footer-inner { max-width: 1180px; margin-inline: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 24px; }
.footer-links a { color: var(--paper-1); font: 500 var(--step-small)/1 var(--font-body); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .footer-links a:hover { text-decoration: underline; } }
.footer-bottom { padding-top: 20px; border-top: 4px solid var(--spruce-800); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-bottom p, .credits { font: 400 var(--step-small)/1.5 var(--font-body); color: var(--spruce-300); max-width: 70ch; }
.credits a { color: var(--spruce-200); }
.footer-disclosure { font: 400 var(--step-small)/1.5 var(--font-body); color: var(--spruce-300); margin-top: 14px; max-width: 70ch; }

/* ===========================================================
   MOTION BASE. Shared reveal/line-up infrastructure. A page
   adds data-reveal / data-rise / data-line to its own markup
   and sets the IntersectionObserver wiring in its own script.
   Reduced motion keeps the finished state, drops all travel.
   =========================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .lines [data-line] { transform: translateY(105%); animation: line-up 900ms var(--ease-expo) forwards; animation-delay: calc(var(--i, 0) * 110ms + 150ms); }
  .lines .line { display: block; overflow: clip; padding-bottom: 0.1em; margin-bottom: -0.1em; }
  .js [data-rise] { opacity: 0; transform: translateY(16px); animation: rise var(--t-reveal) var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 420ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
@keyframes line-up { to { transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
.lines .line { display: block; }
.lines [data-line] { display: block; }
