/* synergeticsnow — structural field, 60° bias, bronze + steel */
:root {
  --void: #0c0e12;
  --void-2: #12161e;
  --panel: #171c26;
  --line: #2a3344;
  --line-soft: #1e2533;
  --text: #e6eaf0;
  --muted: #8b95a8;
  --faint: #5c6678;
  --bronze: #c4924a;
  --bronze-dim: #8a6835;
  --copper: #e0a86a;
  --steel: #7eb0c9;
  --steel-dim: #4a7a90;
  --ok: #8fbc8f;
  --warn: #d4a574;
  --font-display: "Syne", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Serif 4", "Georgia", "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --max: 72rem;
  --measure: 40rem;
  --radius: 2px;
  --header-h: 3.5rem;
}

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

html {
  scroll-behavior: smooth;
  background: var(--void);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(196, 146, 74, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(126, 176, 201, 0.06), transparent 50%),
    var(--void);
}

/* 60° hatch overlay (subtle) */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: repeating-linear-gradient(
    60deg,
    transparent,
    transparent 11px,
    var(--bronze) 11px,
    var(--bronze) 12px
  );
  z-index: 0;
}

a { color: var(--steel); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--copper); }

img, canvas { max-width: 100%; display: block; }

.wrap {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.88);
  backdrop-filter: blur(10px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand span { color: var(--bronze); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  justify-content: flex-end;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--bronze);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 1rem 1rem;
    background: var(--void-2);
    border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.55rem 0; border-bottom: 1px solid var(--line-soft); }
}

/* —— Typography —— */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); margin: 2.5rem 0 0.85rem; color: var(--text); }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; color: var(--copper); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38rem;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 0.9rem; }

p { margin: 0 0 1.1rem; max-width: var(--measure); }
li { max-width: var(--measure); }

/* —— Layout —— */
main { padding: 2.5rem 0 4rem; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0 3rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
}

.hero-canvas-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 280px;
  aspect-ratio: 5 / 4;
}

.hero-canvas-wrap canvas {
  width: 100%;
  height: 100%;
}

.hero-canvas-label {
  position: absolute;
  left: 0.75rem;
  bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Pillar grid */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 2rem 0;
}

@media (max-width: 900px) {
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .pillar-grid { grid-template-columns: 1fr; }
}

.pillar {
  display: block;
  padding: 1.1rem 1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.pillar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--bronze);
  opacity: 0.85;
}

.pillar:hover {
  border-color: var(--bronze-dim);
  transform: translateY(-2px);
}

.pillar .k {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--steel);
  text-transform: uppercase;
}

.pillar h3 {
  margin: 0.45rem 0 0.4rem;
  color: var(--text);
  font-size: 1.05rem;
}

.pillar p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  max-width: none;
}

/* Cards / panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 1.25rem 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Disclosure: § notes / technical */
details.depth {
  border: 1px solid var(--line);
  background: var(--void-2);
  border-radius: var(--radius);
  margin: 1rem 0 1.25rem;
  max-width: calc(var(--measure) + 4rem);
}

details.depth summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bronze);
  user-select: none;
}

details.depth summary::-webkit-details-marker { display: none; }
details.depth summary::before {
  content: "+ ";
  color: var(--faint);
}
details.depth[open] summary::before { content: "− "; }

details.depth .depth-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.95rem;
}

details.depth.tech summary { color: var(--steel); }

/* Crosswalk table */
.crosswalk {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.25rem 0 2rem;
  display: block;
  overflow-x: auto;
}

.crosswalk table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
}

.crosswalk th,
.crosswalk td {
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.crosswalk th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--panel);
  color: var(--bronze);
}

.crosswalk td { color: var(--muted); background: var(--void-2); }
.crosswalk td:first-child { color: var(--text); font-family: var(--font-display); font-weight: 600; }

/* Lab chrome */
.lab-shell {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 1rem;
  margin: 1.5rem 0;
  align-items: start;
}
@media (max-width: 800px) {
  .lab-shell { grid-template-columns: 1fr; }
}

.lab-stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 360px;
  position: relative;
  overflow: hidden;
}

.lab-stage canvas {
  width: 100%;
  height: auto;
  min-height: 360px;
}

.lab-controls {
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.lab-controls label {
  display: block;
  margin: 0.75rem 0 0.3rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.lab-controls input[type="range"] { width: 100%; accent-color: var(--bronze); }
.lab-controls button {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.55rem;
  background: transparent;
  border: 1px solid var(--bronze-dim);
  color: var(--copper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.lab-controls button:hover { background: rgba(196, 146, 74, 0.12); }

.lab-readout {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--steel);
  line-height: 1.5;
}

.lab-links {
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--muted);
}

/* CTA row */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid var(--bronze);
  color: var(--void);
  background: var(--bronze);
}

.btn:hover { background: var(--copper); color: var(--void); border-color: var(--copper); }

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  font-size: 0.85rem;
  color: var(--faint);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.site-footer a { color: var(--muted); }

/* Prose width on article pages */
.article > * { max-width: var(--measure); }
.article .full-bleed,
.article .lab-shell,
.article .crosswalk,
.article .pillar-grid,
.article .two-col,
.article .hero { max-width: none; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pillar { transition: none; }
}
