/* ============================================================
   Landing v2.3 — inside the brain: tissue medium, fibres,
   connectome mode, electrode cursor, EEG, wordless splash
   ============================================================ */
/* tissue medium: fog planes are pure compositor work (masked gradient, CSS drift) */
.net-fogplane {
  position: fixed; left: -25%; top: -25%; width: 150%; height: 150%; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--fc, #55EFE4) 26%, transparent), transparent 70%);
  -webkit-mask-image: var(--noise); mask-image: var(--noise);
  -webkit-mask-size: calc(420px * var(--scale, 1)) calc(420px * var(--scale, 1)); mask-size: calc(420px * var(--scale, 1)) calc(420px * var(--scale, 1));
  opacity: .55; mix-blend-mode: screen; filter: blur(2px);
  will-change: transform; contain: strict;
  /* transform-only drift: animating mask-position forced full-screen repaints */
  animation: fogdrift calc(var(--speed, 80) * 1s) ease-in-out infinite alternate;
  transition: background 1.2s ease;
}
@keyframes fogdrift { from { transform: translate3d(-2%, -1%, 0) scale(1) rotate(0.001deg); } to { transform: translate3d(2%, 1.5%, 0) scale(1.05) rotate(0.001deg); } }
#net-near { position: fixed; left: 0; top: 0; width: 160vw; height: 160vh; z-index: 3; pointer-events: none; opacity: .32; filter: blur(5px); will-change: transform; }
#net-shafts {
  position: fixed; inset: -20%; z-index: 1; pointer-events: none; opacity: .18; mix-blend-mode: screen;
  background: repeating-linear-gradient(112deg, transparent 0 140px, rgba(85,239,228,.05) 140px 190px, transparent 190px 420px, rgba(155,143,255,.04) 420px 470px);
  animation: shafts 90s linear infinite;
}
@keyframes shafts { from { transform: rotate(0deg) translateX(0); } to { transform: rotate(0.6deg) translateX(-160px); } }
/* subtraction: no film grain on the landing — the tissue is the texture */
body:has(.landing) #grain { display: none; }
body:has(.landing) #ambient { opacity: .35; }

/* HUD additions */
.hud #hud-eeg { display: block; width: 150px; height: 30px; border: 1px solid var(--line); border-radius: 6px; margin-top: 6px; background: rgba(5,5,8,.4); }
.hud .hud-tools { flex-wrap: wrap; }

/* electrode cursor state */
#lp-cursor.yield { opacity: 0; }
body.lp-cursor-on .landing a, body.lp-cursor-on .landing button, body.lp-cursor-on .landing .sig-graph, body.lp-cursor-on .landing .ins, body.lp-cursor-on .landing .hud { cursor: auto; }
body[data-net-mode="chapter"] #lp-cursor i { border-color: var(--cc, rgba(85,239,228,.8)); }

/* connectome mode: content recedes, tissue takes the stage */
.landing.connectome .lp-content, .landing.connectome #net-connect { opacity: 0; pointer-events: none; transition: opacity .6s; }
.landing.connectome #net-vignette { opacity: .5; }
#connectome-legend {
  position: fixed; right: var(--edge); top: 96px; z-index: 6; width: 300px; max-height: calc(100vh - 140px); overflow-y: auto;
  padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5,5,8,.62); backdrop-filter: blur(14px);
}
#connectome-legend .cl-title, #connectome-legend .cl-foot { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .2em; color: var(--ink-35); padding: 4px 6px 10px; }
#connectome-legend .cl-foot { padding-top: 10px; letter-spacing: .1em; }
#connectome-legend button { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: baseline; width: 100%; text-align: left; font: inherit; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 7px 8px; cursor: pointer; }
#connectome-legend button i { width: 9px; height: 9px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 10px var(--cc); align-self: center; }
#connectome-legend button b { font-family: var(--font-mono); font-size: .66rem; color: var(--cc); }
#connectome-legend button span { grid-column: 2 / -1; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .06em; color: var(--ink-35); }
#connectome-legend button:hover, #connectome-legend button.on { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 10%, transparent); }

/* wordless splash: small mark above, detailed tissue slide below, lapse into the network */
#boot { gap: 0; }
#boot #boot-tissue { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }
#boot .boot-mark { position: relative; z-index: 1; width: 72px; height: 72px; animation: markbreath 1.6s ease-in-out infinite; }
#boot .boot-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 0 18px rgba(85,239,228,.55)); }
#boot .boot-glass {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 34px 48px 30px; border-radius: 22px;
  background: rgba(9,16,24,.7); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 40px 90px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08), 0 0 80px -30px rgba(85,239,228,.55);
}
#boot .boot-ident { display: block; font-size: 1.35rem; font-weight: 700; letter-spacing: .34em; color: #FFFFFF; text-shadow: 0 0 24px rgba(85,239,228,.35), 0 2px 8px rgba(0,0,0,.6); }
#boot .boot-ident span { color: #55EFE4; }
#boot .boot-line { display: block; font-size: .66rem; letter-spacing: .28em; color: rgba(237,237,228,.78); }
#boot .boot-lines { display: none; }
#boot .boot-rail { margin-top: 6px; }
@keyframes markbreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
#boot { transition: opacity .9s ease, visibility .9s; }

@media (max-width: 900px) {
  .net-fogplane, #net-near, #net-shafts, #connectome-legend, .hud #hud-eeg { display: none; }
}
@media (prefers-reduced-motion: reduce) { .net-fogplane, #net-shafts, #boot .boot-mark { animation: none; } }

/* ---- performance: below-fold sections skip layout/paint until near the viewport ---- */
.lp-chapter, .lp-instrument, .lp-trust, .lp-final { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.lp-card, .lp-side, [data-parallax] { will-change: transform; }
#net-fx, #net-depth, #net-near { contain: strict; }
@media (max-width: 900px) {
  /* mobile: static, light, readable */
  .lp-card, .lp-side, [data-parallax] { will-change: auto; transform: none !important; }
  .lp-orb { display: none; }
  #ambient { display: none; }
  .lp-hero h1 { font-size: clamp(2.1rem, 9vw, 3rem); }
  .lp-chapter { contain-intrinsic-size: auto 700px; }
  .sig-graph { height: 230px; }
  .lp-instrument .ins { padding: 16px; }
  .ins-meta { display: none; }
}
