/* ==========================================================================
   TANDEM — Base / Reset / Typography (Purple-Black + Mint)
   ========================================================================== */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-height: 100vh;
  font-family: var(--body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--linen);
  background: var(--bg);
  overflow-x: hidden;
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  letter-spacing: -0.005em;
  cursor: auto; /* fallback — system cursor visible until JS adds .cursor-ready */
}

body.cursor-ready,
body.cursor-ready a,
body.cursor-ready button,
body.cursor-ready .field__select { cursor: none; }

@media (hover: none), (pointer: coarse) {
  body.cursor-ready,
  body.cursor-ready a,
  body.cursor-ready button,
  body.cursor-ready .field__select { cursor: auto; }
}

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

button { font: inherit; color: inherit; background: none; border: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--mint); color: var(--bg); }

/* — Typography — */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--linen);
}

h1 { font-size: var(--fs-4xl); font-weight: 400; }
h2 { font-size: var(--fs-3xl); font-weight: 400; }
h3 { font-size: var(--fs-2xl); font-weight: 500; }
h4 { font-size: var(--fs-xl); font-weight: 500; }

p { max-width: 65ch; color: var(--linen-mute); }

.eyebrow {
  font-family: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--mint);
  display: inline-block;
}

.text-mute { color: var(--linen-mute); }
.text-faint { color: var(--linen-faint); }
.text-mint { color: var(--mint); }
.text-linen { color: var(--linen); }
.text-orange { color: var(--mint); } /* legacy alias */
.text-cream { color: var(--linen); }

.serif-italic,
.italic-accent {
  font-family: var(--accent);
  font-style: normal;
  font-weight: 500;
  color: var(--mint);
  letter-spacing: -0.015em;
}

/* — Layout primitives — */
.shell {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; padding-block: var(--sp-10); }
.section--tight { padding-block: var(--sp-9); }

.section--dark {
  background: var(--plum);
  color: var(--linen);
  position: relative;
  overflow: hidden;
}

.section--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60vw 80vh at 20% 30%, rgba(94, 255, 161, 0.10), transparent 60%),
    radial-gradient(50vw 60vh at 80% 70%, rgba(180, 123, 230, 0.10), transparent 60%);
  pointer-events: none;
}

.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--linen); }
.section--dark .eyebrow { color: var(--mint); }
.section--dark .eyebrow::before { background: var(--mint); }
.section--dark p { color: var(--linen-mute); }

@media (max-width: 768px) {
  .section { padding-block: var(--sp-9); }
  .section--tight { padding-block: var(--sp-8); }
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--linen-line), transparent);
  margin-block: var(--sp-8);
}

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

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

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