/* ============ THEVA RAJAN — NEUROSURGERY ============ */
:root {
  --void: #05060f;
  --panel: #0a0d1f;
  --ice: #dfe6f5;
  --dim: #7683a5;
  --cyan: #4be1ff;
  --violet: #8b7bff;
  --edge: rgba(75, 225, 255, 0.16);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--ice);
  font-family: "Instrument Sans", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--cyan); color: var(--void); }

.mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
}
.accent { color: var(--cyan); }
em { font-style: italic; }

/* network canvas fixed behind everything */
#net {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* scanlines */
.scanlines {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 40;
  background: repeating-linear-gradient(
    0deg, transparent 0 3px, rgba(5, 6, 15, 0.14) 3px 4px);
  opacity: 0.5;
}

/* HUD frame */
.hud { position: fixed; inset: 14px; pointer-events: none; z-index: 45;
  border: 1px solid rgba(75, 225, 255, 0.09); }
.hud-corner {
  position: absolute; width: 18px; height: 18px;
  border: 1px solid var(--cyan);
  opacity: 0.7;
}
.hud-corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hud-corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.hud-corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.hud-corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* topbar */
.topbar {
  position: fixed; top: 14px; left: 14px; right: 14px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.6rem;
  z-index: 50;
  background: linear-gradient(rgba(5, 6, 15, 0.9), rgba(5, 6, 15, 0.65));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--edge);
}
.brand { color: var(--ice); text-decoration: none; font-weight: 500; font-size: 0.8rem; }
.brand span { color: var(--cyan); animation: blink 1.2s steps(1) infinite; }
.topnav { display: flex; gap: 1.8rem; }
.topnav a { color: var(--dim); text-decoration: none; transition: color 0.25s, text-shadow 0.25s; }
.topnav a:hover { color: var(--cyan); text-shadow: 0 0 12px rgba(75, 225, 255, 0.7); }
.sysread { color: var(--cyan); display: flex; align-items: center; gap: 0.5rem; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: 0.35; } }
@keyframes blink { 50% { opacity: 0; } }

/* content sits above canvas */
main { position: relative; z-index: 10; }
section { max-width: 1180px; margin: 0 auto; padding: 8rem 2.4rem; }

/* hero */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 10rem;
}
.kicker { color: var(--cyan); margin-bottom: 1.8rem; }
.hero .kicker {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
  border-right: 2px solid var(--cyan);
  animation: type-in 2.2s steps(46, end) 0.4s both,
             caret-fade 0.8s steps(1) 2.8s forwards;
}
@keyframes type-in { from { width: 0; } to { width: 46ch; } }
@keyframes caret-fade { to { border-right-color: transparent; } }
@media (max-width: 960px) {
  .hero .kicker { white-space: normal; border-right: 0; animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .kicker { white-space: normal; border-right: 0; animation: none; }
}
.hero-name {
  font-family: "Unbounded", sans-serif;
  font-weight: 300;
  font-size: clamp(3rem, 10.5vw, 9rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
}
.hero-name span { display: block; }
.hero-name .accent {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--cyan);
  text-shadow: 0 0 32px rgba(75, 225, 255, 0.25);
}
.hero-line {
  margin-top: 2.4rem;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  color: var(--dim);
  font-weight: 400;
}
.hero-readout {
  margin-top: 3.2rem;
  display: flex; gap: 2.8rem; flex-wrap: wrap;
  color: var(--dim);
}
.hero-readout b { color: var(--cyan); font-weight: 500; margin-left: 0.4rem; }

/* section bars */
.sec-bar {
  display: flex; align-items: center; gap: 1.2rem;
  color: var(--cyan);
  margin-bottom: 3.6rem;
}
.bar-line { flex: 1; height: 1px; background: var(--edge); }

/* regions */
.region-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.region {
  background: rgba(10, 13, 31, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid var(--edge);
  padding: 1.9rem 1.7rem 2.1rem;
  position: relative;
  transition: border-color 0.35s, transform 0.35s var(--ease), box-shadow 0.35s;
}
.region::before, .region::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border: 1px solid var(--cyan); opacity: 0;
  transition: opacity 0.3s;
}
.region::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.region::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.region:hover {
  border-color: rgba(75, 225, 255, 0.55);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(75, 225, 255, 0.08);
}
.region:hover::before, .region:hover::after { opacity: 1; }
.region-code { color: var(--violet); display: block; margin-bottom: 1rem; }
.region h3 {
  font-family: "Unbounded", sans-serif;
  font-weight: 400;
  font-size: 1.06rem;
  margin-bottom: 0.8rem;
  letter-spacing: 0.01em;
}
.region p { color: var(--dim); font-size: 0.92rem; }
.region em { color: var(--ice); font-style: normal; border-bottom: 1px dotted var(--cyan); }
.region-stat {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  background: linear-gradient(135deg, rgba(75, 225, 255, 0.08), rgba(139, 123, 255, 0.06));
}
.rs-num {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(75, 225, 255, 0.4);
  letter-spacing: 0;
}
.rs-label { color: var(--dim); margin-top: 0.6rem; }

/* protocol */
.proto-list { list-style: none; border-top: 1px solid var(--edge); }
.proto {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 2rem; align-items: center;
  padding: 1.9rem 0.8rem;
  border-bottom: 1px solid var(--edge);
  transition: background 0.3s, padding-left 0.4s var(--ease);
  background: rgba(5, 6, 15, 0.55);
  backdrop-filter: blur(4px);
}
.proto:hover { background: rgba(75, 225, 255, 0.05); padding-left: 1.6rem; }
.p-idx { color: var(--cyan); font-size: 1.1rem; }
.proto h4 {
  font-family: "Unbounded", sans-serif;
  font-weight: 400; font-size: 1.05rem;
  margin-bottom: 0.3rem;
}
.proto p { color: var(--dim); font-size: 0.9rem; max-width: 46rem; }
.p-tag { color: var(--violet); border: 1px solid rgba(139, 123, 255, 0.35);
  padding: 0.35rem 0.7rem; white-space: nowrap; }

/* signal */
.signal-quote {
  font-family: "Unbounded", sans-serif;
  font-weight: 200;
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  line-height: 1.45;
  max-width: 56rem;
}
.signal-attr { color: var(--dim); margin-top: 2.2rem; }

/* contact terminal */
.terminal {
  border: 1px solid var(--edge);
  background: rgba(5, 6, 15, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.term-head {
  padding: 0.8rem 1.4rem;
  border-bottom: 1px solid var(--edge);
  color: var(--cyan);
  background: rgba(75, 225, 255, 0.05);
}
.term-body { padding: 1.6rem 1.4rem 1.8rem; font-size: 0.82rem; text-transform: none; letter-spacing: 0.04em; }
.term-body p { margin: 0.55rem 0; color: var(--ice); }
.prompt { color: var(--cyan); margin-right: 0.6rem; }
.term-body a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(75,225,255,0.4); }
.term-body a:hover { text-shadow: 0 0 12px rgba(75, 225, 255, 0.8); }
.blink { animation: blink 1s steps(1) infinite; color: var(--cyan); }

/* footer */
.footer {
  position: relative; z-index: 10;
  border-top: 1px solid var(--edge);
  padding: 2rem 2.4rem 3rem;
  color: var(--dim);
  background: rgba(5, 6, 15, 0.8);
}
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.footer-row a { color: var(--cyan); text-decoration: none; }
.footer-row a:hover { text-shadow: 0 0 12px rgba(75, 225, 255, 0.7); }
.footer-note { font-size: 0.68rem; max-width: 46rem; opacity: 0.75; text-transform: none; letter-spacing: 0.05em; }
.footer-note a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(75,225,255,0.35); }
.footer-note a:hover { border-bottom-color: var(--cyan); }

/* reveals */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.22s; }
.reveal.d3 { transition-delay: 0.36s; }
.reveal.d4 { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .brand span, .blink, .live-dot { animation: none; }
}

/* responsive */
@media (max-width: 960px) {
  .topnav { display: none; }
  section { padding: 5.5rem 1.4rem; }
  .region-grid { grid-template-columns: 1fr; }
  .proto { grid-template-columns: 3rem 1fr; }
  .p-tag { display: none; }
  .hud { inset: 8px; }
  .topbar { top: 8px; left: 8px; right: 8px; padding: 0.8rem 1rem; }
  .sysread { display: none; }
}
