
/* ============================================================
   1. Reset
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor links land below the fixed nav instead of under it */
  scroll-padding-top: calc(var(--nav-h) + var(--s-6));
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

/* ============================================================
   2. Base typography
   ============================================================ */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  font-weight: 500;
}

h2 {
  font-size: var(--t-h2);
  line-height: var(--lh-snug);
  letter-spacing: -0.028em;
  font-weight: 500;
}

h3 {
  font-size: var(--t-h3);
}
h4 {
  font-size: var(--t-h4);
}

p {
  text-wrap: pretty;
}

/* ============================================================
   3. Accessibility
   ============================================================ */

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

:focus:not(:focus-visible) {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 200;
  padding: var(--s-3) var(--s-5);
  background: var(--surface-invert);
  color: var(--text-invert);
  border-radius: var(--r-md);
  font-size: var(--t-base);
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform var(--d-base) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

::selection {
  background: var(--a-200);
  color: var(--n-900);
}

/* ============================================================
   4. Layout primitives
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section--sunken {
  background: var(--bg-sunken);
  border-block: 1px solid var(--border-subtle);
}

/* A hairline that fades at both ends — reads more considered than a
   full-width 1px line, and separates sections without shouting. */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(
    to right,
    transparent,
    var(--border) 18%,
    var(--border) 82%,
    transparent
  );
}

/* ============================================================
   5. Section headers
   ============================================================ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--detail);
}

.eyebrow::before {
  content: '';
  width: 1.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-width: 42rem;
  margin-bottom: var(--s-12);
}

.section-head--center {
  align-items: center;
  text-align: center;
  margin-inline: auto;
}

.section-head p {
  font-size: var(--t-lead);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

/* ============================================================
   6. Buttons
   ============================================================ */

/* Every button is built from the same four layers, which is what makes
   them read as one system:
     1. a near-flat vertical gradient  — light falls from above
     2. an inset 1px top highlight     — catches that light on the edge
     3. an inset 1px hairline ring     — defines the shape without a border
     4. three stacked outer shadows    — contact, ambient, and far glow,
                                         all tinted with the button's own
                                         hue rather than black
   Hover deepens the stack and lifts 1px; press collapses it inward. */

.btn {
  --btn-fg: var(--text);
  --btn-bd: transparent;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.8125rem var(--s-6);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: var(--t-base);
  font-weight: 600;
  letter-spacing: -0.008em;
  white-space: nowrap;
  transition:
    background var(--d-base) var(--ease),
    border-color var(--d-base) var(--ease),
    color var(--d-base) var(--ease),
    box-shadow var(--d-base) var(--ease),
    transform var(--d-fast) var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

/* Press reads as force applied to a physical object: it returns to rest
   and compresses very slightly, fast enough to feel like contact. */
.btn:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 70ms;
}

/* A trailing arrow's visual mass sits inside its box, so the right side
   looks over-padded next to the left. Pulling 4px back optically
   re-centres the label. */
.btn:has(.btn__arrow) {
  padding-right: calc(var(--s-6) - 0.25rem);
}

.btn:focus-visible {
  outline: 2px solid var(--detail);
  outline-offset: 3px;
}

/* ---------- Primary ---------- */

.btn--primary {
  --btn-fg: var(--text-on-accent);
  background:
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--n-0) 16%, var(--a-500)) 0%,
      var(--a-500) 48%,
      color-mix(in oklab, var(--a-700) 26%, var(--a-500)) 100%
    );
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--n-0) 30%, transparent),
    inset 0 0 0 1px color-mix(in oklab, var(--a-700) 42%, transparent),
    0 1px 2px color-mix(in oklab, var(--a-800) 26%, transparent),
    0 4px 10px color-mix(in oklab, var(--a-700) 22%, transparent),
    0 10px 28px color-mix(in oklab, var(--a-600) 20%, transparent);
}

.btn--primary:hover {
  background:
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--n-0) 20%, var(--a-500)) 0%,
      color-mix(in oklab, var(--a-400) 40%, var(--a-500)) 48%,
      var(--a-600) 100%
    );
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--n-0) 38%, transparent),
    inset 0 0 0 1px color-mix(in oklab, var(--a-700) 48%, transparent),
    0 1px 2px color-mix(in oklab, var(--a-800) 28%, transparent),
    0 6px 16px color-mix(in oklab, var(--a-700) 28%, transparent),
    0 16px 40px color-mix(in oklab, var(--a-600) 26%, transparent);
}

/* Outer shadows collapse and an inner one appears — the button sinks
   into the page rather than floating above it. */
.btn--primary:active {
  box-shadow:
    inset 0 2px 5px color-mix(in oklab, var(--a-800) 42%, transparent),
    inset 0 0 0 1px color-mix(in oklab, var(--a-700) 52%, transparent),
    0 1px 2px color-mix(in oklab, var(--a-800) 20%, transparent);
}

/* ---------- Secondary ---------- */

.btn--secondary {
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  background: linear-gradient(180deg, var(--n-0) 0%, var(--n-50) 100%);
  box-shadow:
    inset 0 1px 0 var(--n-0),
    0 1px 2px color-mix(in oklab, var(--n-900) 6%, transparent),
    0 3px 8px color-mix(in oklab, var(--n-900) 5%, transparent);
}

.btn--secondary:hover {
  --btn-bd: var(--n-400);
  background: linear-gradient(180deg, var(--n-0) 0%, var(--n-0) 100%);
  box-shadow:
    inset 0 1px 0 var(--n-0),
    0 1px 2px color-mix(in oklab, var(--n-900) 7%, transparent),
    0 6px 16px color-mix(in oklab, var(--n-900) 9%, transparent);
}

.btn--secondary:active {
  background: linear-gradient(180deg, var(--n-50) 0%, var(--n-100) 100%);
  box-shadow:
    inset 0 2px 4px color-mix(in oklab, var(--n-900) 10%, transparent),
    0 1px 1px color-mix(in oklab, var(--n-900) 4%, transparent);
}

/* ---------- Invert (sits on the dark CTA card) ---------- */

.btn--invert {
  --btn-fg: var(--n-900);
  background: linear-gradient(180deg, var(--n-0) 0%, var(--n-100) 100%);
  box-shadow:
    inset 0 1px 0 var(--n-0),
    inset 0 0 0 1px color-mix(in oklab, var(--n-900) 10%, transparent),
    0 1px 2px rgb(0 0 0 / 0.2),
    0 6px 16px rgb(0 0 0 / 0.22),
    0 16px 40px rgb(0 0 0 / 0.2);
}

.btn--invert:hover {
  background: linear-gradient(180deg, var(--n-0) 0%, var(--n-0) 100%);
  box-shadow:
    inset 0 1px 0 var(--n-0),
    inset 0 0 0 1px color-mix(in oklab, var(--n-900) 12%, transparent),
    0 1px 2px rgb(0 0 0 / 0.22),
    0 10px 24px rgb(0 0 0 / 0.28),
    0 22px 56px rgb(0 0 0 / 0.24);
}

.btn--invert:active {
  background: linear-gradient(180deg, var(--n-100) 0%, var(--n-200) 100%);
  box-shadow:
    inset 0 2px 5px color-mix(in oklab, var(--n-900) 18%, transparent),
    0 1px 2px rgb(0 0 0 / 0.2);
}

/* ---------- Size ---------- */

.btn--lg {
  padding: 0.9375rem var(--s-8);
  font-size: 1rem;
}

.btn--lg:has(.btn__arrow) {
  padding-right: calc(var(--s-8) - 0.3125rem);
}

/* The arrow nudges on hover — a 3px translate, not a bounce. It also
   dims very slightly at rest so the label stays the primary read, then
   comes to full strength on hover. */
.btn__arrow {
  opacity: 0.75;
  transition:
    transform var(--d-base) var(--ease),
    opacity var(--d-base) var(--ease);
}

.btn:hover .btn__arrow {
  opacity: 1;
  transform: translateX(3px);
}

.btn:active .btn__arrow {
  transform: translateX(1px);
}

/* ============================================================
   7. Cards
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  transition:
    border-color var(--d-base) var(--ease),
    box-shadow var(--d-base) var(--ease),
    transform var(--d-base) var(--ease);
}

.card--hover:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-md);
  transform: translateY(-3px);
}

/* ============================================================
   8. Scroll reveal
   Driven by the useReveal hook, which adds [data-reveal] and flips
   data-visible via IntersectionObserver. Elements are visible by
   default if JS never runs — progressive enhancement, not a
   dependency.
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity var(--d-reveal) var(--ease),
      transform var(--d-reveal) var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
  }

  [data-reveal][data-visible='true'] {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   9. Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   10. Icons
   Every glyph is defined once as a <symbol> in the sprite at the
   top of index.html and pulled in with <use>. Size is set per
   instance via the --ico custom property so the same symbol can
   render at 11px in a checklist and 22px in a card header.
   ============================================================ */

.ico {
  --ico: 1.25rem;
  width: var(--ico);
  height: var(--ico);
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Solid glyphs — currently only the review stars. */
.ico--fill {
  fill: currentColor;
  stroke: none;
}

/* Small ticks need a heavier stroke to stay legible under 14px. */
.ico--bold {
  stroke-width: 2.2;
}
.ico--heavy {
  stroke-width: 2.8;
}
