/*
  base.css
  Reset, root typography, body layout.
  All pages inherit the dark theme from tokens.css.
*/

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--line);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Honeycomb backdrop (injected by topnav.js on segments; hub renders its own) */
.page-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  color: var(--accent);
  overflow: hidden;
}

.page-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.page-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 100% 100% at 50% 30%, transparent 35%, rgba(6, 7, 13, 0.55) 100%);
}

/* Headings */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-family: var(--font-sans); font-weight: 500; }

p { margin: 0 0 1.25rem; max-width: var(--content-max); color: var(--text); }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--easing);
}
a:hover, a:focus { border-bottom-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s var(--easing), border-color 0.2s var(--easing);
}
button:hover { background: var(--accent-soft); border-color: var(--accent); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Page-level layout */
main {
  position: relative;
  z-index: 2;
}

/* Content above the bg overlay */
.segment {
  position: relative;
  z-index: 2;
}

/* Mood-wash overlay */
.mood-wash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  pointer-events: none;
  clip-path: circle(0% at 50% 50%);
  transition: clip-path var(--wash-duration) var(--easing);
}
.mood-wash.is-washing { clip-path: circle(150% at 50% 50%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .mood-wash { transition: none; }
}

.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;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
  width: 100%;
  max-width: var(--content-max);
}

.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.01em;
  text-align: center;
}

.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Default surface for any segment box. Per-segment CSS can override. */
.segment__closing,
.s01-ab,
.s02-inspector,
.s02-card,
.s03-card,
.s03-modal__panel,
.s04-builder,
.s04-explainer,
.s04-compare__card,
.s04-symmetry,
.s04-quote,
.s09-frame,
.s10-canvas-wrap,
.s10-controls,
.fact {
  background-color: rgba(20, 21, 42, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
