/* ============================================================
   INTERVOIDISM — core stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --void: #08080a;
  --void-panel: #121110;
  --void-panel-2: #17150f;
  --line: #2a261c;
  --line-dim: #1c1a14;
  --bone: #e7e1d4;
  --bone-dim: #8b8478;
  --bone-faint: #56524a;
  --brass: #c9a961;
  --brass-dim: #7d6a3f;
  --ember: #7a2e2e;
  --ember-bright: #a8453f;

  --font-display: 'Spectral', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --max: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* subtle grain / vignette so the void isn't a flat rectangle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(201,169,97,0.06), transparent 55%),
    radial-gradient(ellipse at 50% 110%, rgba(122,46,46,0.05), transparent 60%);
}

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

p { margin: 0 0 1em; color: var(--bone-dim); }
p:last-child { margin-bottom: 0; }

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------- starfield ---------------- */

.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.star-layer {
  position: absolute;
  inset: -20% 0 -20% 0;
  will-change: transform;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: var(--bone);
}

.star.dim { background: var(--bone-faint); }
.star.brass { background: var(--brass); }

.star.twinkle {
  animation: twinkle var(--dur, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: var(--min-op, 0.15); }
  50% { opacity: var(--max-op, 0.85); }
}

@media (prefers-reduced-motion: reduce) {
  .star.twinkle { animation: none; opacity: 0.4; }
}

/* a few larger geometric motes that drift slowly, independent of scroll */
.mote {
  position: absolute;
  border: 1px solid var(--brass-dim);
  border-radius: 50%;
  opacity: 0.18;
  animation: drift 46s linear infinite;
}
@keyframes drift {
  0%   { transform: translate(0,0) rotate(0deg); }
  50%  { transform: translate(14px,-22px) rotate(180deg); }
  100% { transform: translate(0,0) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mote { animation: none; }
}

/* ---------------- nav ---------------- */

.site-nav {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line-dim);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.brand svg { width: 26px; height: 26px; display: block; }

.brand-mark { color: var(--brass); }

.nav-links {
  display: flex;
  gap: 36px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--bone-dim);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--brass); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--brass);
}

.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 15px 26px;
  border: 1px solid var(--brass-dim);
  color: var(--brass);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}
.btn:hover { border-color: var(--brass); background: rgba(201,169,97,0.06); }

.btn-solid {
  background: var(--brass);
  color: var(--void);
  border-color: var(--brass);
}
.btn-solid:hover { background: #d9bb7c; border-color: #d9bb7c; }

.btn-ghost {
  border-color: var(--line);
  color: var(--bone-dim);
}
.btn-ghost:hover { border-color: var(--bone-dim); color: var(--bone); background: transparent; }

/* ---------------- mobile nav ---------------- */

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 20px;
  height: 1px;
  background: var(--brass);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: flex;
    position: absolute;
    top: 84px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--void-panel);
    border-bottom: 1px solid var(--line-dim);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .nav-links.is-open { max-height: 320px; }
  .nav-links a {
    padding: 18px 32px;
    border-bottom: 1px solid var(--line-dim);
  }
}

/* ---------------- lattice (signature geometry) ---------------- */

.lattice-svg { width: 100%; height: auto; display: block; overflow: visible; }

.lattice-spoke {
  stroke: var(--line);
  stroke-width: 1;
}
.lattice-edge {
  stroke: var(--line-dim);
  stroke-width: 1;
}
.lattice-spoke.is-lit, .lattice-edge.is-lit {
  stroke: var(--brass);
}

.lattice-draw {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: lattice-draw-in 1.4s ease forwards;
}
@keyframes lattice-draw-in {
  to { stroke-dashoffset: 0; }
}

.lattice-center {
  fill: var(--void);
  stroke: var(--brass);
  stroke-width: 1;
}
.lattice-center-ring {
  fill: none;
  stroke: var(--brass-dim);
  stroke-width: 0.5;
  opacity: 0.5;
}

.lattice-point {
  fill: var(--void);
  stroke: var(--bone-faint);
  stroke-width: 1.2;
  transition: stroke 0.4s ease, fill 0.4s ease, r 0.4s ease;
}
.lattice-node.is-interactive .lattice-point:hover {
  stroke: var(--brass);
}
.lattice-node.is-lit .lattice-point {
  fill: var(--brass);
  stroke: var(--brass);
}

.lattice-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--bone-dim);
  transition: fill 0.4s ease;
}
.lattice-sublabel {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--bone-faint);
}
.lattice-node.is-lit .lattice-label { fill: var(--brass); }
.lattice-node.is-interactive:hover .lattice-label { fill: var(--bone); }

/* ---------------- footer ---------------- */

.site-footer {
  border-top: 1px solid var(--line-dim);
  margin-top: 140px;
  padding: 48px 0;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer .eyebrow { font-size: 0.66rem; }
.footer-links {
  display: flex;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--bone-faint);
}
.footer-links a:hover { color: var(--brass); }

/* ---------------- section rhythm ---------------- */

section { position: relative; z-index: 1; }
.section-pad { padding: 120px 0; }
.section-pad-sm { padding: 72px 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head .eyebrow { display: block; margin-bottom: 18px; }
.section-head h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--line-dim);
  margin: 0;
}

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  padding: 96px 0 60px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.15;
  margin: 20px 0 26px;
}
.hero .lede {
  max-width: 480px;
  font-size: 1.05rem;
  color: var(--bone-dim);
}
.hero-ctas {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hero-figure { max-width: 460px; margin: 0 auto; }

/* ---------------- manual grid ---------------- */

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-dim);
  border: 1px solid var(--line-dim);
}
@media (max-width: 720px) {
  .manual-grid { grid-template-columns: 1fr; }
}

.manual-card {
  background: var(--void);
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: background 0.4s ease;
}
.manual-card:hover { background: var(--void-panel); }

.manual-card .eyebrow { font-size: 0.66rem; }

.manual-card h3 {
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
}

.manual-card .desc { flex-grow: 1; }

.manual-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--line-dim);
}
.manual-price {
  font-family: var(--font-mono);
  color: var(--brass);
  font-size: 0.9rem;
}
.manual-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color 0.3s ease;
}
.manual-card:hover .manual-link { color: var(--brass); }

/* ---------------- manual detail page ---------------- */

.manual-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line-dim);
}
.manual-hero .eyebrow { margin-bottom: 22px; }
.manual-hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  font-style: italic;
  max-width: 760px;
}
.manual-hero .tagline {
  margin-top: 20px;
  max-width: 600px;
  font-size: 1.05rem;
}

.manual-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 80px;
  padding: 72px 0 0;
}
@media (max-width: 880px) {
  .manual-body { grid-template-columns: 1fr; gap: 56px; }
}

.manual-section { padding-bottom: 56px; }
.manual-section:not(:last-child) { border-bottom: 1px solid var(--line-dim); margin-bottom: 56px; }
.manual-section .eyebrow { display: block; margin-bottom: 16px; }
.manual-section h2 {
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 20px;
}
.manual-section ul {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 12px;
}
.manual-section ul li {
  padding-left: 24px;
  position: relative;
  color: var(--bone-dim);
}
.manual-section ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65em;
  width: 6px; height: 6px;
  border: 1px solid var(--brass);
  border-radius: 50%;
}

.buy-panel {
  align-self: start;
  position: sticky;
  top: 110px;
  border: 1px solid var(--line);
  padding: 32px;
  background: var(--void-panel);
}
.buy-panel .eyebrow { margin-bottom: 14px; }
.buy-panel .price {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
  color: var(--bone);
  margin-bottom: 6px;
}
.buy-panel .price-note {
  font-size: 0.82rem;
  color: var(--bone-faint);
  margin-bottom: 26px;
}
.buy-panel .btn { width: 100%; justify-content: center; margin-bottom: 12px; }
.buy-panel .format-note {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line-dim);
  font-size: 0.82rem;
  color: var(--bone-faint);
}

/* ---------------- quiz / instrument ---------------- */

.instrument-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 64px;
  align-items: center;
  padding: 72px 0 140px;
}
@media (max-width: 880px) {
  .instrument-layout { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
}

.q-step { display: none; }
.q-step.is-active { display: block; }

.q-progress {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--bone-faint);
  margin-bottom: 24px;
}

.q-prompt {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-style: italic;
  font-weight: 400;
  margin-bottom: 40px;
  max-width: 520px;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line-dim);
  border: 1px solid var(--line-dim);
}
.q-option {
  background: var(--void);
  padding: 22px 24px;
  text-align: left;
  border: none;
  color: var(--bone-dim);
  font-family: var(--font-body);
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
}
.q-option:hover {
  background: var(--void-panel);
  color: var(--bone);
  padding-left: 30px;
}

.q-result { display: none; }
.q-result.is-active { display: block; }
.q-result .eyebrow { margin-bottom: 18px; }
.q-result h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-style: italic;
  margin-bottom: 20px;
}
.q-result .desc { max-width: 520px; margin-bottom: 36px; font-size: 1.02rem; }
.q-result-ctas { display: flex; gap: 16px; flex-wrap: wrap; }
.q-restart {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.q-restart:hover { color: var(--brass); }

/* ---------------- architecture page ---------------- */

.arch-lede {
  max-width: 680px;
  font-size: 1.1rem;
}
.arch-figure { max-width: 640px; margin: 80px auto; }

.tenets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-dim);
  border: 1px solid var(--line-dim);
  margin-top: 64px;
}
@media (max-width: 780px) {
  .tenets { grid-template-columns: 1fr; }
}
.tenet {
  background: var(--void);
  padding: 36px 32px;
}
.tenet .eyebrow { display: block; margin-bottom: 14px; font-size: 0.64rem; }
.tenet h3 { font-size: 1.2rem; font-style: italic; margin-bottom: 12px; font-weight: 400; }
.tenet p { font-size: 0.92rem; }

/* ---------------- reveal-on-scroll ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
