/* StoYuri v6 — engineering gateway splash
   Aligns with v5: near-black ops console, cyan accent, Inter + Space Grotesk */

:root {
  --bg: #070b14;
  --bg-elev: #0b1220;
  --panel: #0e1626;
  --panel-2: #111a2c;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(56, 189, 248, 0.35);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.12);
  --accent-ink: #0b1220;
  --ok: #34d399;
  --warn: #fbbf24;
  --violet: #a78bfa;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --radius: 10px;
  --shell: min(1120px, calc(100% - 2.5rem));
  --grid: 32px;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(7, 11, 20, 0.92), rgba(7, 11, 20, 0.97)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent calc(var(--grid) - 1px),
      rgba(148, 163, 184, 0.045) calc(var(--grid) - 1px),
      rgba(148, 163, 184, 0.045) var(--grid)
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent calc(var(--grid) - 1px),
      rgba(148, 163, 184, 0.045) calc(var(--grid) - 1px),
      rgba(148, 163, 184, 0.045) var(--grid)
    ),
    var(--bg);
  background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7dd3fc; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.85rem;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

.shell {
  width: var(--shell);
  margin-inline: auto;
}

/* —— Top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(7, 11, 20, 0.82);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.15rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.wordmark:hover { color: #fff; }

.wordmark-mark {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 7px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.wordmark-mark.small {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.62rem;
}

.top-nav {
  display: flex;
  gap: 1.1rem;
  margin-left: 1rem;
  flex: 1;
}
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.top-nav a:hover,
.top-nav a:focus-visible { color: var(--text); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 14px;
  height: 1.5px;
  margin-inline: auto;
  background: var(--text);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1;
  padding: 0.7rem 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-sm { padding: 0.5rem 0.8rem; font-size: 0.82rem; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { background: #7dd3fc; color: var(--accent-ink); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--line-strong);
  background: var(--accent-dim);
  color: #fff;
}
.btn-enter { margin-top: 0.35rem; }

/* —— Hero —— */
.hero {
  padding: 1.75rem 0 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.85fr) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
  min-height: min(72vh, 640px);
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.panel-mark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 1;
}

.mark-img {
  width: min(78%, 280px);
  height: auto;
  object-fit: contain;
  /* White-paper marks → muted technical watermarks on dark panels */
  filter: invert(1) grayscale(1) brightness(1.15) contrast(1.05);
  opacity: 0.11;
  mix-blend-mode: screen;
}

.panel-body {
  position: relative;
  z-index: 1;
  padding: 1.35rem 1.25rem 1.4rem;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 11, 20, 0.55) 28%, rgba(7, 11, 20, 0.92) 100%);
  border-top: 1px solid transparent;
}

.panel-kicker {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.panel-role {
  margin: 0.2rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-bio {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 36ch;
}

.panel-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.panel-tags li {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.65);
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
}

.center-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.rail-line {
  flex: 1;
  width: 1px;
  min-height: 1.25rem;
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}

.rail-card {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(11, 18, 32, 0.92);
  padding: 1.35rem 1.15rem 1.4rem;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.04), 0 18px 40px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.rail-card h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #f8fafc;
}

.rail-one-liner {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.heritage {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

/* —— Sections —— */
.section {
  padding: 2.75rem 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.35rem;
  max-width: 62ch;
}
.section-head h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  letter-spacing: -0.02em;
}
.section-desc {
  margin: 0;
  color: var(--muted);
}

.label-sm {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* —— Domains —— */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.domain-tile {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 100%;
  padding: 1rem 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.domain-tile:hover,
.domain-tile:focus-visible,
.domain-tile.is-hot {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.06), var(--panel));
  transform: translateY(-1px);
  color: inherit;
}

.domain-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--faint);
}
.domain-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: #f1f5f9;
}
.domain-blurb {
  color: var(--muted);
  font-size: 0.82rem;
  flex: 1;
}
.domain-meta {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* —— Principles —— */
.principle-strip {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.principle-strip li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.chip-key {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
}
.chip-val {
  color: var(--muted);
  font-size: 0.84rem;
}

.brand-footnote {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 220px);
  gap: 1.25rem;
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: rgba(11, 18, 32, 0.55);
}
.footnote-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.footnote-map {
  margin: 0;
  text-align: center;
}
.footnote-map img {
  margin-inline: auto;
  max-height: 140px;
  width: auto;
  opacity: 0.45;
  filter: grayscale(0.35) contrast(1.05);
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}
.footnote-map figcaption {
  margin-top: 0.4rem;
  font-size: 0.68rem;
  color: var(--faint);
}

/* —— Proof —— */
.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.proof-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1.1rem 1rem;
  text-align: center;
}
.proof-cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  color: #f8fafc;
  line-height: 1.1;
}
.proof-cell span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.proof-note {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 78ch;
}
.proof-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 1.75rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
}
.footer-copy { margin: 0; }

/* —— Responsive —— */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .center-rail { order: -1; }
  .rail-line { display: none; }
  .domain-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .domain-grid .domain-tile:last-child {
    grid-column: 1 / -1;
  }
  .principle-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .proof-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root { --shell: calc(100% - 1.5rem); }

  .nav-toggle { display: inline-flex; }

  .top-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    flex-direction: column;
    gap: 0.15rem;
    background: rgba(7, 11, 20, 0.96);
    border-bottom: 1px solid var(--line);
  }
  .top-nav.is-open { display: flex; }
  .top-nav a {
    padding: 0.65rem 0.35rem;
    border-bottom: 1px solid var(--line);
  }

  .top-actions .btn-ghost .label,
  .top-actions .btn-sm { font-size: 0.78rem; }

  .brand-footnote {
    grid-template-columns: 1fr;
  }
  .principle-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .domain-grid { grid-template-columns: 1fr; }
  .domain-grid .domain-tile:last-child { grid-column: auto; }
  .proof-strip { grid-template-columns: 1fr 1fr; }
  .top-actions .btn-ghost { display: none; }
}

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



/* ===== v6.1 hero: anonymous + 3D systems graph ===== */
.hero-v61 {
  padding: 1.1rem 0 0.75rem;
  min-height: calc(100vh - 3.25rem);
  display: flex;
  align-items: stretch;
}
.hero-v61 > .shell.hero-split {
  width: min(1320px, calc(100% - 1.75rem));
  flex: 1;
}
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.35fr);
  gap: 1.25rem 1.75rem;
  align-items: stretch;
  min-height: calc(100vh - 4.5rem);
}
.hero-copy .eyebrow {
  margin-bottom: 0.85rem;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 0;
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.1vw, 2.45rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  max-width: 18ch;
}
.hero-lead {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 36ch;
  margin: 0 0 1.15rem;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}
.hero-signals {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  margin: 0;
}
.hero-signals li span {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(14, 22, 38, 0.6);
}

.hero-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.stage-frame {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(56, 189, 248, 0.12), transparent 65%),
    linear-gradient(160deg, rgba(14, 22, 38, 0.95), rgba(7, 11, 20, 0.98));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.06), 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  min-height: min(78vh, 720px);
}
#systems-canvas {
  display: block;
  width: 100%;
  flex: 1;
  height: 100%;
  min-height: min(72vh, 680px);
  cursor: crosshair;
}
/* Intentionally no .stage-caption band — removes leftover empty chrome under the graph */
.stage-hud {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(7, 11, 20, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  backdrop-filter: blur(8px);
}
.hud-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.hud-sep { opacity: 0.5; }
.stage-caption {
  margin: 0;
  padding: 0.55rem 0.85rem 0.75rem;
  font-size: 0.78rem;
  color: var(--faint);
  border-top: 1px solid var(--line);
}

@media (max-width: 920px) {
  .hero-v61 { min-height: 0; padding: 1rem 0 0.5rem; align-items: flex-start; }
  .hero-v61 > .shell.hero-split { width: min(1120px, calc(100% - 1.5rem)); }
  .hero-split {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 1rem;
  }
  .hero-copy h1 { max-width: none; }
  .hero-stage { order: -1; }
  .stage-frame { min-height: 0; }
  #systems-canvas { min-height: min(52vh, 420px); }
}

/* Graph HTML labels (clickable) */
.stage-frame { position: relative; }
.graph-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.graph-label {
  position: absolute;
  transform: translate(-50%, -120%);
  pointer-events: auto;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e2e8f0;
  background: rgba(7, 11, 20, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
  opacity: 0.92;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.graph-label:hover,
.graph-label:focus-visible {
  color: #0b1220;
  background: #38bdf8;
  border-color: #38bdf8;
  opacity: 1;
  z-index: 3;
}
.graph-label.is-brief {
  border-color: rgba(167, 139, 250, 0.45);
  font-weight: 500;
}
.graph-label.is-brief:hover,
.graph-label.is-brief:focus-visible {
  background: #a78bfa;
  border-color: #a78bfa;
  color: #0b1220;
}
.graph-label.is-core {
  border-color: rgba(52, 211, 153, 0.5);
}
.graph-label.is-occluded {
  opacity: 0.2;
  pointer-events: none;
}
.graph-label.is-behind {
  opacity: 0.35;
}
#systems-canvas { cursor: grab; touch-action: none; }
#systems-canvas.is-hot { cursor: pointer; }
#systems-canvas.is-dragging { cursor: grabbing; }
