/* ============================================================
   jennywasthere.com — base.css
   Design tokens, reset, typography, and global primitives.
   Aligned with 03_Visual_Brand_System.md and 05_Website_Developer_Brief.md
   ============================================================ */

/* ---------- Tokens --------------------------------------- */
:root {
  /* Colors — exact brand values for Jenny Matthew */
  --anchor: #1E293B;        /* Deep Slate — dark backgrounds, headlines on light */
  --pulse:  #D4AF37;        /* Professional Gold — accents only */
  --bone:   #F8FAFC;        /* Slate 50 — primary background */
  --ink:    #0F172A;        /* Slate 900 — body text on light */
  --sage:   #0D9488;        /* Clinical Teal — secondary accent */
  --mist:   #E2E8F0;        /* Hairlines, dividers */
  --alert:  #B91C1C;        /* Critical states only */

  /* Derived neutrals */
  --bone-soft:    #F2EFE9;
  --ink-soft:     #4B4B4B;
  --ink-muted:    #767676;
  --hairline:     rgba(10, 37, 64, 0.10);
  --hairline-strong: rgba(10, 37, 64, 0.20);
  --hairline-on-anchor: rgba(250, 247, 242, 0.16);

  /* Typography */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body:    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;

  /* Type scale — desktop. Mobile multiplier handled via clamp(). */
  --t-display-hero: clamp(64px, 9.5vw, 120px);     /* 120 / 1.0 / -0.02em */
  --t-display-lg:   clamp(54px, 7.0vw, 88px);      /* 88 / 1.05 / -0.015em */
  --t-h1:           clamp(40px, 5.0vw, 64px);      /* 64 / 1.1 / -0.01em */
  --t-h2:           clamp(32px, 3.6vw, 44px);      /* 44 / 1.15 */
  --t-h3:           clamp(22px, 2.2vw, 28px);      /* 28 / 1.25 */
  --t-body-lg:      clamp(18px, 1.6vw, 22px);      /* 22 / 1.55 */
  --t-body:         clamp(17px, 1.25vw, 18px);     /* 18 / 1.6  — 17 mobile minimum */
  --t-small:        14px;                          /* 14 / 1.5 */
  --t-micro:        11px;                          /* 11 / 1.4 / 0.18em */

  /* Easing — Apple-style, brief §3 */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std:      cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-w:        1280px;
  --max-w-text:   65ch;
  --gutter-px:    clamp(20px, 4vw, 56px);
  --section-py:   clamp(88px, 12vw, 160px);

  /* Motion durations */
  --d-fast:   180ms;
  --d-base:   240ms;
  --d-slow:   400ms;
  --d-reveal: 600ms;
  --d-hero:   800ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, svg {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; padding: 0; margin: 0; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

p { margin: 0; }

blockquote { margin: 0; }

/* ---------- Type primitives ------------------------------ */
.t-display-hero {
  font-family: var(--font-display);
  font-size: var(--t-display-hero);
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.t-display-lg {
  font-family: var(--font-display);
  font-size: var(--t-display-lg);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.t-h1 { font-family: var(--font-display); font-size: var(--t-h1); line-height: 1.1; letter-spacing: -0.01em; }
.t-h2 { font-family: var(--font-display); font-size: var(--t-h2); line-height: 1.15; }
.t-h3 { font-family: var(--font-display); font-size: var(--t-h3); line-height: 1.25; }

.t-body-lg { font-size: var(--t-body-lg); line-height: 1.55; }
.t-body    { font-size: var(--t-body);    line-height: 1.6;  }
.t-small   { font-size: var(--t-small);   line-height: 1.5;  }

.t-micro {
  font-family: var(--font-body);
  font-size: var(--t-micro);
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.italic { font-style: italic; }
.serif  { font-family: var(--font-display); }
.pulse  { color: var(--pulse); }
.muted  { color: var(--ink-muted); }

/* ---------- Layout primitives ---------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter-px);
}
.wrap--narrow { max-width: 920px; }

.section {
  position: relative;
  padding-block: var(--section-py);
}

.section--anchor { background: var(--anchor); color: var(--bone); }
.section--bone   { background: var(--bone);   color: var(--ink);  }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--pulse);
}
.section-eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

/* ---------- Buttons -------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 999px;
  font-size: var(--t-body);
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform var(--d-base) var(--ease-out-expo),
              background-color var(--d-base) var(--ease-std),
              color var(--d-base) var(--ease-std),
              border-color var(--d-base) var(--ease-std);
  will-change: transform;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--ghost {
  border: 1px solid currentColor;
  color: inherit;
  background: transparent;
}
.btn--ghost:hover {
  background: currentColor;
}
.btn--ghost:hover .btn__label,
.btn--ghost:hover .btn__arrow { color: var(--anchor); }

.section--anchor .btn--ghost:hover .btn__label,
.section--anchor .btn--ghost:hover .btn__arrow { color: var(--anchor); }

.btn--solid {
  background: var(--anchor);
  color: var(--bone);
}
.btn--solid:hover { background: #0E2E50; }

.btn__arrow {
  transition: transform var(--d-base) var(--ease-out-expo);
}
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- Reveal primitive (used by IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--d-reveal) var(--ease-out-expo),
              transform var(--d-reveal) var(--ease-out-expo);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal--scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity var(--d-reveal) var(--ease-out-expo),
              transform var(--d-reveal) var(--ease-out-expo);
}
.reveal--scale.is-in {
  opacity: 1;
  transform: scale(1);
}

/* Hairline draw (used by Press section) */
.hairline-draw {
  position: relative;
}
.hairline-draw::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  width: 0%;
  background: var(--hairline);
  transition: width var(--d-slow) var(--ease-out-expo);
}
.hairline-draw.is-in::after { width: 100%; }

/* ---------- Focus ring (visible, never removed) ---------- */
:focus-visible {
  outline: 2px solid var(--pulse);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Skip link ------------------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 16px;
  background: var(--anchor);
  color: var(--bone);
  z-index: 1000;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---------- Selection ------------------------------------ */
::selection {
  background: var(--pulse);
  color: var(--bone);
}

/* ---------- Reduced motion ------------------------------- */
@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;
  }
  .reveal, .reveal--scale { opacity: 1 !important; transform: none !important; }
}
