/* The Nest — site stylesheet. Terminal Volt (Ruling A, 2026-09-01): one
   palette across the whole site, not a separate Nest token set. */

:root {
  color-scheme: dark;
  --canvas: #0A0A0B;
  --volt: #CCFF00;
  --cyan: #7DF9FF;
  --red: #FF4D4D;
  --card: #1A1A1C;
  --border: #262627;
  --fg: #F5F5F0;
  --muted: #8A8A8A;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Scroll world (3D layer) ----------
   Canvas is injected by three-world.js only when JS + WebGL succeed. Body
   keeps its solid --canvas background as the no-JS fallback; .has-3d (set
   by the script once the scene is live) makes it transparent so the scene
   shows through. Cards keep an opaque background on purpose — text stays
   readable over the scene, the 3D shows in the whitespace around it. */

#scroll-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

html.has-3d body { background: transparent; }

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-nav .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--fg);
  white-space: nowrap;
}

.brand-mark .dot {
  width: 10px;
  height: 10px;
  background: var(--volt);
  flex: none;
}

.brand-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.88;
  filter: saturate(0.75) brightness(0.95);
  flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--fg);
}

.nav-cta {
  background: var(--volt);
  color: var(--canvas) !important;
  padding: 10px 18px;
  border-radius: 3px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.nav-cta:hover { opacity: 0.85; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 1rem;
  cursor: pointer;
  flex: none;
}

.nav-toggle:hover { border-color: var(--fg); }

/* ---------- Hero / sections ---------- */

main { position: relative; z-index: 1; }

section {
  padding: 88px 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type { border-bottom: none; }

.hero {
  padding: 120px 0 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72vh;
}

.eyebrow {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 20px;
}

h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}

h3 {
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  margin: 0 0 10px;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--fg);
  max-width: 62ch;
  margin: 0 0 36px;
}

.muted { color: var(--muted); }

/* Founder photo frame (about.html) — real photo only, no AI-generated face
   per Aym/Atlas ruling 2026-09-01. Falls back to a marked placeholder if
   the asset isn't in place yet. */
.founder-photo-frame {
  width: 220px;
  aspect-ratio: 4 / 5;
  margin: 0 0 32px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  position: relative;
}

.founder-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.05);
}

.founder-photo-frame.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.founder-photo-frame.is-placeholder img { display: none; }

.founder-photo-frame.is-placeholder::after {
  content: "PHOTO PENDING";
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.volt { color: var(--volt); }
.cyan { color: var(--cyan); }
.red { color: var(--red); }

.mono { font-family: var(--mono); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 28px;
  border-radius: 3px;
  border: 1px solid transparent;
  width: fit-content;
}

.btn-primary {
  background: var(--volt);
  color: var(--canvas);
}

.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.btn-ghost:hover { border-color: var(--fg); }

/* ---------- Grids / cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.card {
  background: var(--canvas);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.card p { margin: 0; color: var(--fg); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--border);
  width: fit-content;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.status-live::before { background: var(--volt); }
.status-shadow::before { background: var(--cyan); }
.status-build::before { background: var(--muted); }
.status-honest::before { background: var(--red); }

.status-live { color: var(--volt); border-color: rgba(204,255,0,0.35); }
.status-shadow { color: var(--cyan); border-color: rgba(125,249,255,0.35); }
.status-build { color: var(--muted); }
.status-honest { color: var(--red); border-color: rgba(255,77,77,0.35); }

/* ---------- Stats / mono figures ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin: 12px 0 0;
}

.stat {
  border-top: 2px solid var(--cyan);
  padding-top: 12px;
}

.stat .num {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--cyan);
  display: block;
  line-height: 1.1;
}

.stat .label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Verdict stamp ---------- */

.verdict-stamp {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  border: 1px solid rgba(255,77,77,0.4);
  padding: 6px 12px;
}

/* ---------- Tables (graveyard) ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
}

th {
  background: var(--card);
  color: var(--cyan);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:nth-child(even) td { background: var(--card); }

.table-wrap {
  overflow-x: auto;
}

/* ---------- Lists ---------- */

ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
ul.plain li { padding-left: 22px; position: relative; }
ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 2px;
  background: var(--volt);
}

/* ---------- Newsletter form ---------- */

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 28px;
  max-width: 640px;
}

.signup-form-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 480px;
}

.signup-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 15px 16px;
  border-radius: 3px;
}

.signup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--volt);
}

.signup-form button {
  border: none;
  cursor: pointer;
  font-family: var(--mono);
}

.form-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 12px;
}

/* ---------- Topic selector (signup) ---------- */

.topic-intro {
  margin: 0 0 20px;
  color: var(--muted);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.topic-card { display: block; cursor: pointer; }

.topic-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.topic-card-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--canvas);
  min-height: 100%;
  padding: 22px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.topic-card-inner::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 1px solid var(--border);
  border-radius: 3px;
  flex: none;
}

.topic-card.is-checked .topic-card-inner {
  border-color: var(--volt);
  background: var(--card);
}

.topic-card.is-checked .topic-card-inner::before {
  background: var(--volt);
  border-color: var(--volt);
}

.topic-checkbox:focus-visible ~ .topic-card-inner {
  outline: 2px solid var(--volt);
  outline-offset: 2px;
}

.topic-name {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg);
}

.topic-card.is-checked .topic-name { color: var(--volt); }

.topic-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.topic-hint {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--red);
  margin: 0;
}

/* ---------- Mural atmosphere ----------
   Low-opacity watermark murals behind section content, per brand-philosophy
   ruling 2026-08-31: volt .07, cyan .07, red .08 (red gets one notch more
   presence). Sit behind everything (z-index 0, same layer as the 3D canvas),
   never obscure text, pointer-events none, degrade to a static faint image
   with zero JS. */

.has-mural { position: relative; overflow: hidden; }
.has-mural > .wrap { position: relative; z-index: 1; }

.mural-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mural {
  position: absolute;
  display: block;
  max-width: none;
  width: 900px;
  height: auto;
  opacity: 0.07;
  filter: grayscale(1) brightness(0.9);
  will-change: transform;
  /* Source murals carry a faint wash texture across their full canvas, not
     just the linework — at low opacity that reads as a hard-edged gray
     rectangle ("blocked off") rather than atmosphere. Feather the edges so
     it fades into the section instead of showing its bounding box. */
  mask-image: radial-gradient(ellipse 60% 60% at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at center, #000 30%, transparent 75%);
}

/* verdict section carries the red tint per Aym (2026-09-01) -- muted, not a
   banner, so .verdict-stamp stays the dominant red moment in this section */
.mural--red {
  opacity: 0.1;
  filter: grayscale(1) brightness(0.9) sepia(1) hue-rotate(-50deg) saturate(4);
}

.mural-eye { width: 860px; top: -8%; right: -6%; }
.mural-pyramids { width: 1240px; bottom: -18%; left: -12%; }
/* Centered murals use left:50% + margin-left (not transform:translateX) on
   purpose: scroll-reveal.js drives the parallax via GSAP yPercent, which
   sets the element's transform as an inline style. An inline transform
   always wins over the CSS transform on .mural-anubis/.mural-obelisk, so a
   transform-based center gets silently wiped out the moment the scrub
   starts. Margin-based centering isn't touched by that. */
.mural-anubis { width: 620px; top: -6%; left: 50%; margin-left: -310px; }
.mural-apep { width: 1020px; bottom: -14%; right: -10%; }
.mural-ptah { width: 420px; top: -10%; right: 4%; }
.mural-hieroglyph { width: 760px; bottom: -12%; right: -6%; }
.mural-obelisk { width: 780px; top: -4%; left: 50%; margin-left: -390px; }
.mural-scarab { width: 700px; bottom: -16%; left: -9%; }

@media (max-width: 720px) {
  .mural { opacity: 0.05; }
  .mural--red { opacity: 0.07; }
  .mural-eye { width: 520px; }
  .mural-pyramids { width: 720px; }
  .mural-anubis { width: 420px; margin-left: -210px; }
  .mural-apep { width: 620px; }
  .mural-ptah { width: 260px; }
  .mural-hieroglyph { width: 480px; }
  .mural-obelisk { width: 480px; margin-left: -240px; }
  .mural-scarab { width: 440px; }
}

/* ---------- Footer / watermark ---------- */

footer {
  position: relative;
  z-index: 1;
  padding: 48px 0 40px;
}

.watermark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.watermark .mark-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.watermark .mark-lockup .dot {
  width: 10px;
  height: 10px;
  background: var(--volt);
  flex: none;
}

footer .foot-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

footer a { text-decoration: none; color: var(--muted); }
footer a:hover { color: var(--fg); }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .site-nav .wrap { flex-wrap: nowrap; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--canvas);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 10px 0; width: 100%; }
  section { padding: 56px 0; }
  .hero { padding: 72px 0 56px; min-height: unset; }
  .signup-form-controls { flex-direction: column; }
  .signup-form input[type="email"] { min-width: 0; }
}

/* Contact grid: logo card (fills the 4th quadrant) */
.card-logo {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  min-height: 100%;
}
.logo-breathe {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: nest-breathe 5s ease-in-out infinite;
}
#logo-3d-holder {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#logo-3d-holder canvas {
  display: block;
  border-radius: 50%;
}
.logo-fallback {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--border);
}
.logo-caption {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--border);
}
@keyframes nest-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes nest-turn {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-breathe, .logo-breathe img, .logo-3d { animation: none; }
}
