/* Base · reset, global tokens, body, type primitives, skip link, page shell */

:root {
  --paper: #f6f3ee;
  --ink: #000;
  --muted: #8a8a8a;
  --mark: #1f45d6;
  --mark-hl: rgba(31, 69, 214, .28);
  --card: #fff;
  --placeholder: #e8e4dc;

  --blue: #2A4294;          /* brand blue: splash, wipe, accents, CTA */
  --blue-ink: #1E3275;      /* hover/pressed state of blue */

  --font-sans: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Square Peg", cursive;

  --fs-hero: clamp(2.75rem, 8vw, 7.5rem);
  --fs-title: clamp(2rem, 4.5vw, 3.75rem);
  --fs-closing: clamp(2.5rem, 7vw, 6rem);
  --fs-body: 1.25rem;
  --fs-eyebrow: .75rem;
  --fs-brand: .875rem;
  --fs-note: 1.8rem;
  --fs-badge: 11px;
  --fs-button: .875rem;
  --fs-back: .75rem;

  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;
  --sp-64: 64px;
  --sp-96: 96px;
  --sp-128: 128px;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --chapter-gap: 36vh;
  --note-pull: -12vh;
  --grid-gap: 64px;
  --copy-gap: 12px;
  --hero-gap: 12px;

  --card-w: clamp(240px, 22vw, 440px);
  --copy-w: 27rem;
  --small-w: 52%;

  --card-pad: 24px 24px 28px;
  --note-w: 250px;
  --note-pad: 18px 22px 20px;
  --r-card: 2px;
  --r-pill: 999px;

  --dock-h: 64px;
  --dock-offset: 20px;      /* distance from viewport bottom */
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);

  --grain: none; /* set by paper.js to url(blob:…) */
}

@media (max-width: 760px) {
  :root {
    --dock-h: 56px;
    --dock-offset: 12px;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

p, h1, h2, figure { margin: 0; }

img { max-width: 100%; }

/* ---------- Lenis (spec §5.5) ---------- */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

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

.brand {
  font-weight: 500;
  font-size: var(--fs-brand);
  line-height: 1.4;
}

.eyebrow {
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .08em;
}

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

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus-visible {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 16px;
  overflow: visible;
  clip-path: none;
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
  font-size: var(--fs-brand);
  text-decoration: none;
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- Page container ---------- */

.page {
  min-height: 100svh;
  padding-bottom: calc(var(--dock-h) + var(--dock-offset) + 32px);
}

/* focus is moved here programmatically after navigation only */
#main:focus { outline: none; }

/* ---------- Pills (Home bar, Home spacer, Contact) ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: scale .1s var(--ease-out), background-color .4s var(--ease-out);
}

.pill:active { scale: .97; }

.pill:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.pill--dark { background: #0B0B0F; color: #fff; }
.pill--blue { background: var(--blue); color: #fff; }
.pill--blue:hover { background: var(--blue-ink); }

/* D16: inline arrow instead of a font glyph */
.pill__arrow {
  flex: none;
  width: .75em;
  height: .75em;
}

/* Text roll (D8), same as the dock: the label and its ::after copy slide up inside a 1-line mask. */
.pill__label {
  display: inline-block;
  overflow: hidden;
  height: 1.4em;
  line-height: 1.4em;
}

.pill__text {
  display: block;
  position: relative;
  transition: translate .4s var(--ease-out);
}

.pill__text::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  top: 100%;
  left: 0;
}

.pill:hover .pill__text,
.pill:focus-visible .pill__text { translate: 0 -100%; }

/* not interactive: an outlined label */
.pill--outline {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: 8px 16px;
  border: 1px solid #0B0B0F;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  text-transform: uppercase;
}

.pill--outline .dot { color: var(--blue); }

@media (prefers-reduced-motion: reduce) {
  .pill,
  .pill__text { transition: none; }

  .pill:hover .pill__text,
  .pill:focus-visible .pill__text { translate: none; }
}

/* shared page footer (same values as the Journey footer) */
.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-64) var(--gutter);
}
