/* ============================================================
   Landing — "the biology of interconnected decisions"
   Layer stack (back → front):
     0  #net-layer     cosmos.gl alveolar network (always evolving)
     1  #net-grid      slow parallax measurement grid
     2  #net-vignette  depth vignette
     3  #net-connect   curved glowing connector card ⇄ sac
     4  .lp-content    hero, chapters (glass cards), trust, CTA
     5  .hud           fixed instrument rail
   Always dark: the network is the ground.
   ============================================================ */
.landing {
  --bg: #050508; --surface: #0b141c; --surface-2: #101d28;
  --text: #EDEDE4; --text-dim: rgba(237,237,228,.55); --line: rgba(237,237,228,.13);
  --ink: #EDEDE4; --ink-70: rgba(237,237,228,.7); --ink-50: rgba(237,237,228,.5);
  --ink-35: rgba(237,237,228,.35); --ink-15: rgba(237,237,228,.13);
  --glass: rgba(9,16,24,.46); --glass-border: rgba(255,255,255,.09);
  color-scheme: dark; color: var(--text); background: var(--bg);
  position: relative; min-height: 100vh; overflow-x: clip;
}

/* ---------- layer 0: network ---------- */
#net-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.8s ease; }
#net-layer.ready { opacity: 1; }
#net-layer canvas { width: 100% !important; height: 100% !important; display: block; }

/* ---------- layer 1: measurement grid ---------- */
#net-grid {
  position: fixed; inset: -10%; z-index: 1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(237,237,228,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237,237,228,.045) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 20%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 20%, transparent 100%);
  will-change: transform;
}

/* ---------- layer 2: vignette ---------- */
#net-vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 42%, rgba(5,5,8,.62) 100%),
    linear-gradient(180deg, rgba(5,5,8,.4), transparent 28%, transparent 72%, rgba(5,5,8,.65));
}

/* ---------- layer 3: curved connector ---------- */
#net-connect { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .6s; overflow: visible; }
#net-connect.on { opacity: 1; }
#net-connect .glow { fill: none; stroke: var(--cc, #55EFE4); stroke-width: 9; opacity: .28; filter: url(#cc-blur); }
#net-connect .wire { fill: none; stroke: url(#cc-grad); stroke-width: 1.4; stroke-dasharray: 6 7; animation: dashflow 1.3s linear infinite; }
#net-connect .ring { fill: none; stroke: var(--cc, #55EFE4); stroke-width: 1.2; animation: ringpulse 2.4s ease-out infinite; }
#net-connect .ring.r2 { animation-delay: 1.2s; }
#net-connect .core { fill: var(--cc, #55EFE4); filter: url(#cc-blur-s); }
#net-connect .spark { fill: #fff; filter: url(#cc-blur-s); }
#net-connect .anchor { fill: none; stroke: var(--cc, #55EFE4); stroke-width: 1; opacity: .8; }
@keyframes dashflow { to { stroke-dashoffset: -26; } }
@keyframes ringpulse { 0% { r: 6; opacity: .9; } 100% { r: 40; opacity: 0; } }

.landing .lp-content { position: relative; z-index: 4; }

/* ---------- layer 5: HUD ---------- */
.hud {
  position: fixed; left: var(--edge); bottom: 22px; z-index: 6;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .18em; color: var(--ink-35);
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(5,5,8,.5); backdrop-filter: blur(10px);
}
.hud .hud-row { display: flex; align-items: center; gap: 10px; }
.hud .hud-bars { display: flex; gap: 4px; }
.hud .hud-bars i { width: 14px; height: 3px; background: var(--ink-15); border-radius: 2px; transition: background .4s, transform .4s, box-shadow .4s; }
.hud .hud-bars i.on { background: var(--cc, #55EFE4); transform: scaleY(1.8); box-shadow: 0 0 10px var(--cc, #55EFE4); }
.hud .hud-label { color: var(--ink-70); transition: color .4s; }
.hud .hud-count { color: var(--marker); }
.hud .live { display: inline-flex; align-items: center; gap: 6px; }
.hud .live i { width: 6px; height: 6px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 8px #3ddc97; animation: pulse 1.6s infinite; }

/* ---------- hero ---------- */
.lp-hero { min-height: 100svh; display: grid; align-content: center; padding: 120px var(--edge) 80px; position: relative; }
.lp-hero .eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .22em; color: var(--ink-50); }
.lp-hero h1 { font-size: clamp(2.6rem, 7.2vw, 6rem); line-height: .96; letter-spacing: -.04em; font-weight: 650; max-width: 11ch; margin: 0 0 26px; text-shadow: 0 0 60px rgba(85,239,228,.12); }
.lp-hero h1 .thin { font-weight: 300; color: var(--ink-70); }
.lp-hero .lede { max-width: 58ch; font-size: clamp(1rem, 1.55vw, 1.2rem); color: var(--ink-70); line-height: 1.65; }
.lp-hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.lp-hero .meta-row { margin-top: 56px; display: flex; gap: 32px; flex-wrap: wrap; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; color: var(--ink-35); }
.lp-hero .meta-row b { display: block; font-size: 1.45rem; color: var(--marker); letter-spacing: 0; margin-bottom: 4px; font-weight: 600; text-shadow: 0 0 24px rgba(246,217,123,.35); }
.lp-hero .scroll-cue { position: absolute; bottom: 30px; right: var(--edge); font-family: var(--font-mono); font-size: .66rem; letter-spacing: .22em; color: var(--ink-35); animation: bob 2.4s ease infinite; }

/* ---------- chapters ---------- */
.lp-chapter { min-height: 92svh; display: grid; align-items: center; padding: 60px var(--edge); position: relative; }
.lp-chapter .frame { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; max-width: 1280px; margin: 0 auto; width: 100%; }
.lp-chapter.flip .frame > .lp-card { order: 2; }

/* glass card: 4 layers — ambient glow, gradient border, glass body, specular sheen */
.lp-card {
  position: relative; border-radius: 22px; padding: 36px 38px; isolation: isolate;
  background: linear-gradient(160deg, rgba(14,22,32,.62), rgba(8,13,20,.42));
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow:
    0 40px 90px rgba(0,0,0,.5),
    0 0 0 1px rgba(255,255,255,.05),
    0 0 80px -20px color-mix(in srgb, var(--cc, #55EFE4) 45%, transparent),
    inset 0 1px 0 rgba(255,255,255,.07);
  transform: translateY(34px) scale(.985); opacity: 0;
  transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity 1s ease, box-shadow .6s;
}
.lp-card::before { /* gradient border */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--cc, #55EFE4) 70%, transparent), rgba(255,255,255,.08) 40%, transparent 70%, color-mix(in srgb, var(--cc, #55EFE4) 35%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.lp-card::after { /* specular sheen */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background:
    radial-gradient(70% 55% at 0% 0%, color-mix(in srgb, var(--cc, #55EFE4) 16%, transparent), transparent 70%),
    radial-gradient(40% 40% at 100% 100%, rgba(255,255,255,.035), transparent 70%);
}
.lp-card.in { transform: none; opacity: 1; }
.lp-card .no { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .24em; color: var(--cc, #55EFE4); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.lp-card .no i { width: 8px; height: 8px; border-radius: 50%; background: var(--cc, #55EFE4); box-shadow: 0 0 16px var(--cc, #55EFE4), 0 0 32px color-mix(in srgb, var(--cc, #55EFE4) 50%, transparent); }
.lp-card h2 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); letter-spacing: -.025em; line-height: 1.12; margin: 0 0 14px; }
.lp-card p { color: var(--ink-70); margin: 0 0 14px; line-height: 1.65; }
.lp-card .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 20px; }
.lp-card .fact { border-top: 1px solid var(--line); padding-top: 10px; }
.lp-card .fact b { display: block; font-family: var(--font-mono); font-size: 1.25rem; color: var(--text); font-weight: 600; }
.lp-card .fact span { font-size: .72rem; color: var(--ink-50); letter-spacing: .06em; }
.lp-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.lp-card .tags span { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-50); background: rgba(255,255,255,.02); }
.lp-card .cluster-tag { position: absolute; top: 18px; right: 20px; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .2em; color: var(--ink-35); }
.lp-card .port { /* connector anchor on the card edge */
  position: absolute; top: 120px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--cc, #55EFE4); box-shadow: 0 0 14px var(--cc, #55EFE4);
}
.lp-chapter:not(.flip) .lp-card .port { right: -5px; }
.lp-chapter.flip .lp-card .port { left: -5px; }

/* side panel */
.lp-side { position: relative; }
.lp-side .eq { font-family: var(--font-mono); font-size: clamp(.9rem, 1.6vw, 1.15rem); color: var(--ink-70); border-left: 2px solid var(--cc, #55EFE4); padding: 6px 0 6px 18px; margin: 0 0 12px; line-height: 1.7; }
.lp-side .eq b { color: var(--text); font-weight: 600; }
.lp-side .eq-note { font-size: .78rem; color: var(--ink-35); font-family: var(--font-mono); letter-spacing: .08em; }
.lp-side blockquote { margin: 0; font-size: clamp(1.15rem, 2.2vw, 1.7rem); font-weight: 300; line-height: 1.35; letter-spacing: -.01em; color: var(--text); }
.lp-side blockquote em { font-style: normal; color: var(--cc, #55EFE4); text-shadow: 0 0 24px color-mix(in srgb, var(--cc, #55EFE4) 50%, transparent); }

/* sigma explorer cards */
.sig-wrap {
  position: relative; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, rgba(8,13,20,.72), rgba(5,5,8,.55));
  border: 1px solid var(--glass-border); box-shadow: 0 30px 70px rgba(0,0,0,.45), 0 0 60px -30px color-mix(in srgb, var(--cc, #55EFE4) 60%, transparent);
}
.sig-graph { height: 340px; width: 100%; }
.sig-hint { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .18em; color: var(--ink-35); padding: 10px 16px 0; display: flex; justify-content: space-between; }
.sig-hint .cnt { color: var(--cc, #55EFE4); }
.sig-info { padding: 12px 16px; border-top: 1px solid var(--line); min-height: 60px; font-size: .8rem; color: var(--ink-70); }
.sig-info b { color: var(--text); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; display: block; margin-bottom: 3px; }
.sig-tip { /* high-contrast hover tooltip */
  position: absolute; z-index: 5; pointer-events: none; max-width: 260px;
  background: #0b141c; color: #EDEDE4; border: 1px solid var(--tc, #55EFE4);
  border-radius: 10px; padding: 9px 12px; font-size: .76rem; line-height: 1.5;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 24px -8px var(--tc, #55EFE4);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.sig-tip.on { opacity: 1; transform: none; }
.sig-tip b { display: block; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; color: var(--tc, #55EFE4); margin-bottom: 3px; }
.sig-tip .more { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; color: var(--ink-35); }

/* parallax orbs */
.lp-orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; background: radial-gradient(circle, color-mix(in srgb, var(--cc, #55EFE4) 20%, transparent), transparent 68%); filter: blur(34px); width: 520px; height: 520px; }

/* trust / final / footer */
.lp-trust { padding: 40px var(--edge); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(5,5,8,.55); backdrop-filter: blur(8px); }
.lp-trust .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; max-width: 1180px; margin: 0 auto; }
.lp-trust .t { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; color: var(--ink-35); }
.lp-trust .t b { display: block; font-size: 1.05rem; color: var(--text); letter-spacing: 0; font-family: var(--font-display); margin-bottom: 4px; font-weight: 600; }
.lp-final { text-align: center; padding: clamp(90px, 16vh, 170px) var(--edge); position: relative; }
.lp-final h2 { font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.035em; max-width: 18ch; margin: 0 auto 28px; }
.lp-final .roles { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.lp-footer { padding: 34px var(--edge); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; color: var(--ink-35); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); }
.lp-footer a { color: var(--ink-50); }

/* splash */
#boot .boot-lines { display: flex; flex-direction: column; gap: 5px; align-items: center; min-height: 54px; }
#boot .boot-lines span { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .26em; color: var(--ink-35); opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
#boot .boot-lines span.on { opacity: 1; transform: none; color: var(--ink-70); }

/* motion prefs & responsive */
@media (prefers-reduced-motion: reduce) {
  .lp-card { transition: none; transform: none; opacity: 1; }
  #net-connect .wire, #net-connect .ring, .lp-hero .scroll-cue, .hud .live i { animation: none; }
}
@media (max-width: 900px) {
  .lp-chapter { min-height: auto; padding: 40px var(--edge); }
  .lp-chapter .frame { grid-template-columns: 1fr; gap: 20px; }
  .lp-chapter.flip .frame > .lp-card { order: 0; }
  .lp-card { padding: 24px 22px; }
  .lp-card .port, .hud, #net-connect, #net-grid { display: none; }
  .lp-hero { padding-top: 96px; }
  .sig-graph { height: 260px; }
}
