/* ============================================================================
   ENTROPA — entropa.space
   8-bit green-screen CRT terminal theme. Press Start 2P for headings/accents,
   VT323 for readable body copy. Pure CSS, no framework.
   ============================================================================ */

:root {
  --bg:        #020806;
  --panel:     #04130c;
  --green:     #38ff9d;   /* phosphor */
  --green-dim: #1f9c63;
  --green-deep:#0c5a39;
  --amber:     #ffcf4a;
  --text:      #b9f6d6;
  --muted:     #5fb98c;
  --line:      #0e4a31;
  --glow:      0 0 6px rgba(56, 255, 157, 0.55);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 21px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  text-shadow: 0 0 1px rgba(56, 255, 157, 0.25);
}

/* CRT scanlines + vignette overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.22) 3px,
      rgba(0, 0, 0, 0.22) 4px
    ),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 60%, rgba(0,0,0,0.55) 100%);
}

/* ── Starfield: space / atomic parallax background ─────────────────────── */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.star-layer {
  position: absolute;
  inset: -12%;            /* oversized so the drift never reveals an edge */
  will-change: transform;
}
.star-layer.far  { animation: drift 95s ease-in-out infinite alternate; }
.star-layer.mid  { animation: drift 62s ease-in-out infinite alternate; }
.star-layer.near { animation: drift 41s ease-in-out infinite alternate; }
@keyframes drift {
  from { transform: translate3d(-1.5%, 1.5%, 0); }
  to   { transform: translate3d(1.5%, -3%, 0); }
}
.star {
  position: absolute;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px rgba(56, 255, 157, 0.8);
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 0.12; transform: scale(0.55); }
}
/* Respect users who prefer no motion. */
@media (prefers-reduced-motion: reduce) {
  .star-layer, .star,
  .d-edge, .d-space, .d-anchor, .d-singularity, .d-collapse { animation: none !important; }
  .continuum-field { display: none; }
}

/* ── Continuum field: the live, hover-reactive DAG canvas (Rust → web-sys) ── */
.continuum-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;            /* above the starfield (DOM order), below content */
  pointer-events: none;  /* never intercept clicks; it tracks the cursor via window */
  display: block;
}

/* Content sits above the starfield + continuum (which own z-index 0). */
main, footer { position: relative; z-index: 1; }

a { color: var(--green); text-decoration: none; }
a:hover { color: #eafff3; text-shadow: var(--glow); }

.pixel { font-family: 'Press Start 2P', monospace; }

/* ── Nav ───────────────────────────────────────────────────────────────── */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 2px solid var(--line);
  background: rgba(2, 8, 6, 0.92);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.brand {
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  color: var(--green);
  text-shadow: var(--glow);
  letter-spacing: 1px;
}
.brand .blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.navlinks { display: flex; gap: 22px; }
.navlinks a {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.navlinks a:hover, .navlinks a.active { color: var(--green); text-shadow: var(--glow); }

/* ── Layout ────────────────────────────────────────────────────────────── */
main { flex: 1; padding: 56px 24px 80px; }
.wrap { max-width: 860px; margin: 0 auto; }

section { margin-bottom: 56px; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  border: 2px solid var(--line);
  border-top: 4px solid var(--green-dim);
  background: linear-gradient(160deg, rgba(4,19,12,0.74) 0%, rgba(2,8,6,0.74) 100%);
  backdrop-filter: blur(3px) saturate(1.1);
  -webkit-backdrop-filter: blur(3px) saturate(1.1);
  padding: 44px 40px;
  box-shadow: inset 0 0 40px rgba(12, 90, 57, 0.25);
}
.eyebrow {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(18px, 3.6vw, 30px);
  line-height: 1.45;
  color: var(--green);
  text-shadow: var(--glow);
  margin-bottom: 22px;
}
.hero .lede { font-size: 24px; color: var(--text); margin-bottom: 14px; }
.hero .sub { font-size: 21px; color: var(--muted); }

/* ── Headings ──────────────────────────────────────────────────────────── */
h2.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--green);
  letter-spacing: 1px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}
h2.section-title::before { content: "> "; color: var(--green-dim); }

h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--amber);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

p { margin-bottom: 16px; color: var(--text); }
p strong { color: #eafff3; }

/* ── Cards grid ────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card {
  border: 2px solid var(--line);
  /* Translucent so the live Continuum shows through, with a backdrop blur so text stays crisp. */
  background: rgba(4, 16, 11, 0.58);
  backdrop-filter: blur(3px) saturate(1.1);
  -webkit-backdrop-filter: blur(3px) saturate(1.1);
  padding: 20px 22px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.card:hover {
  border-color: var(--green-dim);
  background: rgba(5, 20, 13, 0.66);
  box-shadow: inset 0 0 24px rgba(12,90,57,.3);
}
.card p { font-size: 19px; color: var(--muted); margin-bottom: 0; }
.card p:first-of-type { color: var(--text); }

/* ── Pills / badges ────────────────────────────────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--green);
  background: #04130c;
  border: 1px solid var(--green-deep);
  padding: 8px 10px;
  letter-spacing: 1px;
}

/* ── Status line ───────────────────────────────────────────────────────── */
.statusline {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--muted);
  border: 1px dashed var(--line);
  padding: 12px 14px;
  letter-spacing: 1px;
}
.statusline .ok { color: var(--green); }

/* ── CTA ───────────────────────────────────────────────────────────────── */
/* CTA buttons: a 2-column grid (2 left, 2 right) with equal spacing; collapses to 1 column when narrow. */
.cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 620px; margin: 0 auto; padding: 8px 0 0; }
.cta .btn { width: 100%; text-align: center; }
@media (max-width: 560px) { .cta { grid-template-columns: 1fr; } }

/* Contact-form inputs — black field, terminal-green text. */
.field {
  display: block; width: 100%; background: var(--bg); color: var(--green);
  border: 2px solid var(--line); font-family: 'VT323', 'Courier New', monospace;
  font-size: 20px; letter-spacing: 1px; padding: 11px 13px; margin-bottom: 10px; outline: none;
}
.field:focus { border-color: var(--green-dim); box-shadow: inset 0 0 14px rgba(12,90,57,.4), var(--glow); }
.field::placeholder { color: var(--muted); opacity: .8; }
.statusline.err { color: #ff7a7a; border-color: #5a1f1f; }
.btn {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--bg);
  background: var(--green);
  border: 2px solid var(--green);
  padding: 14px 22px;
  letter-spacing: 1px;
  box-shadow: var(--glow);
  transition: transform .1s;
}
.btn:hover { color: var(--bg); transform: translateY(-2px); }
.btn.ghost { color: var(--green); background: transparent; }
.btn.ghost:hover { color: #eafff3; }

/* ── Team page ─────────────────────────────────────────────────────────── */
.identity { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.avatar {
  width: 78px; height: 78px;
  display: grid; place-items: center;
  border: 2px solid var(--green-dim);
  background: #04130c;
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  color: var(--green);
  text-shadow: var(--glow);
  flex-shrink: 0;
}
.avatar-img {
  width: 86px;
  height: 104px;
  object-fit: cover;
  border: 2px solid var(--green-dim);
  background: #04130c;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(56, 255, 157, 0.35);
}
.role { font-size: 19px; color: var(--muted); }
.exp-item { border-left: 2px solid var(--line); padding-left: 18px; margin-bottom: 22px; }
.exp-item .when { font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--green-dim); letter-spacing: 1px; }
ul.bullets { list-style: none; margin: 8px 0 0; }
ul.bullets li { position: relative; padding-left: 20px; margin-bottom: 8px; color: var(--muted); }
ul.bullets li::before { content: "▮"; position: absolute; left: 0; color: var(--green-dim); font-size: 14px; }

/* ── Footer ────────────────────────────────────────────────────────────── */
footer {
  border-top: 2px solid var(--line);
  padding: 26px 24px;
  text-align: center;
}
footer .tag { font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--green-dim); letter-spacing: 1px; margin-bottom: 8px; }
footer .small { font-size: 17px; color: var(--muted); }

/* ── Continuum diagram (inline SVG) ────────────────────────────────────── */
.diagram {
  border: 2px solid var(--line);
  background: rgba(4, 16, 11, 0.55);
  backdrop-filter: blur(3px) saturate(1.1);
  -webkit-backdrop-filter: blur(3px) saturate(1.1);
  padding: 18px 16px 12px;
  margin: 22px 0 18px;
}
.diagram svg { width: 100%; height: auto; display: block; }

.d-title     { font-family: 'Press Start 2P', monospace; font-size: 11px; fill: var(--green); }
.d-title-dim { font-family: 'Press Start 2P', monospace; font-size: 11px; fill: var(--green-dim); }
.d-cap       { font-family: 'VT323', monospace; font-size: 16px; fill: var(--muted); }
.d-divider   { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }

.d-block       { fill: #04130c; stroke: var(--green-dim); stroke-width: 2; }
.d-edge        { stroke: var(--green-deep); stroke-width: 1.5; stroke-dasharray: 5 7;
                 animation: dFlow 2.4s linear infinite; }
.d-edge-dim    { stroke: var(--green-dim); stroke-width: 1.5; }
.d-space       { fill: #04130c; stroke: var(--green); stroke-width: 2;
                 transform-box: fill-box; transform-origin: center;
                 animation: dPulse 4.6s ease-in-out infinite; }
.d-anchor      { fill: var(--green); stroke: var(--green);
                 transform-box: fill-box; transform-origin: center;
                 animation: dAnchor 3.6s ease-in-out infinite; }
.d-singularity { fill: var(--amber); stroke: var(--amber);
                 transform-box: fill-box; transform-origin: center;
                 animation: dSing 5.2s ease-in-out infinite; }
/* the collapse-to-finality pulse — one bright dash sweeps S → the Frontier along the anchor path */
.d-collapse    { fill: none; stroke: var(--green); stroke-width: 2.5; opacity: .9;
                 stroke-dasharray: 14 320; filter: drop-shadow(0 0 4px rgba(56,255,157,.7));
                 animation: dCollapse 5s linear infinite; }

@keyframes dFlow   { to { stroke-dashoffset: -24; } }
@keyframes dPulse  {
  0%, 100% { transform: scale(1);    stroke-opacity: .75; }
  50%      { transform: scale(1.18); stroke-opacity: 1; }
}
@keyframes dAnchor {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 3px rgba(56,255,157,.7)); }
  50%      { transform: scale(1.22); filter: drop-shadow(0 0 9px rgba(56,255,157,1)); }
}
@keyframes dSing   {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 5px rgba(255,207,74,.7)); }
  50%      { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(255,207,74,1)); }
}
@keyframes dCollapse { from { stroke-dashoffset: 334; } to { stroke-dashoffset: 0; } }

.diagram-legend {
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;
  margin-top: 6px; font-size: 17px; color: var(--muted);
}
.diagram-legend span { display: inline-flex; align-items: center; gap: 8px; }
.diagram-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lg-anchor { background: var(--green); box-shadow: 0 0 5px var(--green); }
.lg-space  { background: #04130c; border: 2px solid var(--green); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 19px; }
  .grid { grid-template-columns: 1fr; }
  .topnav { padding: 14px 16px; flex-direction: column; gap: 12px; }
  .hero { padding: 30px 22px; }
  main { padding: 36px 16px 60px; }
}

/* ── Crucia ticker — CRT news-crawl, light blue 8-bit ──────────────────────── */
.ticker {
  display: block; overflow: hidden; white-space: nowrap; text-decoration: none;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(3, 12, 20, 0.55); padding: 9px 0; margin: 0 0 56px;
}
.ticker-track { display: inline-block; animation: ticker 32s linear infinite; will-change: transform; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
  font-family: 'Press Start 2P', monospace; font-size: 11px; letter-spacing: 1px;
  color: #6fd3ff; text-shadow: 0 0 6px rgba(111, 211, 255, 0.65);
}
.ticker:hover .ticker-item { color: #aee9ff; }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none !important; } }

/* ── Crucia docs viewer ────────────────────────────────────────────────────── */
.docs-layout { display: flex; gap: 22px; align-items: flex-start; }
.docs-side { flex: 0 0 210px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 80px; }
.docs-link {
  font-family: inherit; font-size: 16px; text-align: left; cursor: pointer;
  color: var(--muted); background: transparent; border: none; border-left: 2px solid var(--line); padding: 7px 12px;
}
.docs-link:hover { color: var(--green); border-left-color: var(--green-dim); }
.docs-link.on { color: var(--green); border-left-color: var(--green); text-shadow: var(--glow); }
.docs-content { flex: 1; min-width: 0; }
.markdown h1 { font-family: 'Press Start 2P', monospace; font-size: 16px; line-height: 1.5; color: var(--green); text-shadow: var(--glow); margin-bottom: 18px; }
.markdown h2 { font-family: 'Press Start 2P', monospace; font-size: 12px; color: var(--amber); margin: 26px 0 12px; }
.markdown h3 { font-size: 18px; color: var(--green); margin: 18px 0 8px; }
.markdown p { color: var(--text); margin-bottom: 14px; }
.markdown a { color: var(--green); text-decoration: underline; }
.markdown ul, .markdown ol { margin: 0 0 14px 22px; color: var(--text); }
.markdown li { margin-bottom: 6px; }
.markdown strong, .markdown b { color: #eafff3; }
.markdown code { font-family: monospace; color: var(--amber); background: rgba(255,207,74,.08); padding: 1px 4px; }
.markdown table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; font-size: 17px; }
.markdown th { color: var(--green); background: rgba(12,90,57,.15); }
.markdown blockquote { border-left: 3px solid var(--green-dim); padding-left: 14px; color: var(--muted); margin: 0 0 14px; }
@media (max-width: 720px) { .docs-layout { flex-direction: column; } .docs-side { flex-direction: row; flex-wrap: wrap; position: static; } }

/* Follow the Continuum — signup row */
.subscribe-row { display: flex; gap: 10px; align-items: stretch; max-width: 520px; }
.subscribe-row .field { flex: 1; margin: 0; }
.subscribe-row .btn { flex: 0 0 auto; }
