@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Mono:wght@300;400;500&family=Inter:wght@300;400;500;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink:      #e8e3db;
  --ink-dim:  #7a746c;
  --ink-ghost:#38342f;
  --bg:       #080706;
  --surface:  #0d0c0a;
  --rule:     #1c1a17;
  --red:      #c0392b;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --mono:  'DM Mono', monospace;
  --sans:  'Inter', sans-serif;
  
  --site-max: 1400px;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  scrollbar-width: none;
}
::-webkit-scrollbar { display: none; }

/* ── BOOT OVERLAY ─────────────────────────────────────────────────── */
#bootOverlay {
  position: fixed;
  inset: 0;
  background: #040302;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#bootOverlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 340px;
}
.boot-wordmark {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-ghost);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.boot-log {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.boot-line {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-ghost);
  letter-spacing: 1px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}
.boot-line.active { opacity: 1; transform: translateX(0); color: var(--ink-dim); }
.boot-line.done   { opacity: 0.35; }
#bl4.active { color: var(--red); }
.boot-bar-wrap {
  height: 1px;
  background: var(--rule);
  overflow: hidden;
}
#bootFill {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.08s linear;
}

/* ── CUSTOM CURSOR ────────────────────────────────────────────────── */
#cursor {
  position: fixed; width: 6px; height: 6px;
  background: var(--ink); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, background 0.2s ease, width 0.2s ease, height 0.2s ease;
}
#cursor-ring {
  position: fixed; width: 32px; height: 32px;
  border: 1px solid rgba(232,227,219,0.3); border-radius: 50%;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, transform 0.05s ease;
}
body.cursor-active #cursor {
  background: var(--red);
  width: 8px; height: 8px;
}
body.cursor-active #cursor-ring {
  width: 44px; height: 44px;
  border-color: rgba(192, 57, 43, 0.5);
}

/* ── NAV ─────────────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; width: 100%; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 2rem 4vw; mix-blend-mode: difference; pointer-events: none;
}
.nav-logo { height: 18px; filter: brightness(0.85); pointer-events: auto; }
.nav-logo > img{
  height: 18px;
  width: auto;
}
.nav-meta {
  font-family: var(--mono); font-size: 10px; color: var(--ink-dim);
  text-transform: uppercase; letter-spacing: 2px;
}
.nav-links {
  display: flex;
  gap: 2.5rem;
  pointer-events: auto;
}
.nav-link {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-ghost);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.25s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }

/* typography */
.s { font-family: var(--serif); font-weight: 300; }
.m { font-family: var(--mono); font-weight: 400; }
.dim { color: var(--ink-dim); }
.ghost { color: var(--ink-ghost); }
.red { color: var(--red); }

/* ── SECTIONS ────────────────────────────────────────────────────── */
section {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 12vh 4vw; border-bottom: 1px solid var(--rule);
}
.container {
  width: 100%; max-width: var(--site-max); margin: 0 auto; position: relative; z-index: 2;
}

/* Glowing section divider */
section::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192,57,43,0.15) 30%, rgba(192,57,43,0.15) 70%, transparent);
  pointer-events: none;
}

/* Base Canvas Setup */
.canvas-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; opacity: 0.8;
}

/* Canvas Tags */
.cv-tag {
  position: absolute; right: 4vw; bottom: 4vh; 
  font-family: var(--mono); font-size: 9px; color: var(--ink-ghost);
  letter-spacing: 2px; text-transform: uppercase; text-align: right;
  z-index: 10;
}
.cv-tag::before {
  content: ''; display: inline-block; width: 40px; height: 1px;
  background: var(--ink-ghost); vertical-align: middle; margin-right: 8px;
}

/* ── HERO ────────────────────────────────────────────────────────── */
#hero { justify-content: flex-end; padding-bottom: 8vh; }
.hero-pre { font-family: var(--mono); font-size: 11px; color: var(--red); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 2rem; }
.hero-title { font-family: var(--serif); font-size: clamp(3.5rem, 8vw, 8rem); font-weight: 300; line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 2rem; max-width: 900px; }
.hero-title em { font-style: italic; color: var(--red); }
.hero-desc { font-family: var(--sans); font-size: 14px; color: var(--ink-dim); max-width: 500px; line-height: 1.8; font-weight: 300; }

/* Word reveal spans */
.reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-word.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll Hint */
.scroll-hint {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 10;
  opacity: 0;
  animation: fadeInHint 1s ease 2.5s forwards;
}
@keyframes fadeInHint {
  to { opacity: 1; }
}
.scroll-hint-lbl {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink-ghost);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.scroll-arrow-wrap {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--ink-ghost), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-arrow {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--red), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%   { top: -100%; }
  100% { top: 200%; }
}

/* ── SECTION HEADER ──────────────────────────────────────────────── */
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 5rem; gap: 4rem; flex-wrap: wrap; }
.sec-mark { font-family: var(--mono); font-size: 10px; color: var(--red); letter-spacing: 2px; margin-bottom: 1rem; }
.sec-title { font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 300; line-height: 1.1; letter-spacing: -0.01em; }
.sec-title em { font-style: italic; color: var(--ink-dim); }
.sec-p { font-family: var(--sans); font-size: 14px; color: var(--ink-dim); line-height: 1.8; max-width: 460px; font-weight: 300; }

/* ── DISTILLATION MATRIX ─────────────────────────────────────────── */
.matrix-wrap { border: 1px solid var(--rule); background: var(--bg); display: flex; flex-direction: column; }
.matrix-row { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr 1.5fr; border-bottom: 1px solid var(--rule); padding: 2rem; align-items: start; gap: 2rem; transition: background 0.2s ease; }
.matrix-row:last-child { border-bottom: none; }
.matrix-row:hover { background: rgba(192,57,43,0.03); }

.mx-name { font-family: var(--mono); font-size: 13px; color: var(--ink); text-transform: uppercase; letter-spacing: 1px; }
.mx-tag { display: inline-block; padding: 2px 8px; background: var(--rule); color: var(--ink-dim); font-size: 9px; font-family: var(--mono); letter-spacing: 1px; margin-left: 10px; vertical-align: middle; }
.mx-desc { font-family: var(--sans); font-size: 13px; color: var(--ink-dim); line-height: 1.6; }

.mx-metrics { display: flex; flex-direction: column; gap: 0.8rem; }
.mx-stat { display: flex; align-items: center; gap: 1rem; }
.mx-stat-lbl { width: 90px; font-family: var(--mono); font-size: 9px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 1px; }
.mx-stat-bar { flex: 1; height: 3px; background: var(--rule); position: relative; }
.mx-stat-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--ink); width: 0%; transition: width 1s ease-out; }
.mx-stat-fill.crit { background: var(--red); }

/* ── INFERX ENGINE ───────────────────────────────────────────────── */
#inferx { background: var(--surface); }
.pipeline-container {
  width: 100%;
  height: 200px;
  margin-bottom: 4rem;
  position: relative;
}
#canvasPipeline {
  width: 100%;
  height: 100%;
  display: block;
}
.inferx-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: 3rem;
  gap: 2rem;
  flex-wrap: wrap;
}
.istat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 100px;
}
.istat-val {
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--ink);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}
.istat-lbl {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-ghost);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── MEMORY OS ───────────────────────────────────────────────────── */
#memorySec { background: var(--surface); justify-content: center; align-items: center; }
.memory-content { position: relative; z-index: 2; text-align: center; max-width: 800px; margin: 0 auto; pointer-events: none; }
.memory-headline { font-family: var(--serif); font-size: clamp(3rem, 6vw, 6rem); font-style: italic; font-weight: 300; line-height: 1.1; margin-bottom: 1.5rem; }
.memory-sub { font-family: var(--sans); font-size: 15px; color: var(--ink-dim); line-height: 1.8; max-width: 600px; margin: 0 auto; }

/* ── RESEARCH TOPOLOGY ───────────────────────────────────────────── */
.topology-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.topo-points { display: flex; flex-direction: column; gap: 3rem; }
.p-row { position: relative; padding-left: 2rem; }
.p-row::before {
  content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border: 1px solid var(--red);
}
.p-title { font-family: var(--mono); font-size: 12px; color: var(--ink); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.5rem; }
.p-desc { font-family: var(--sans); font-size: 14px; color: var(--ink-dim); line-height: 1.7; }
.topo-stage {
  height: 500px; background: transparent; position: relative;
  display: flex; align-items: center; justify-content: center;
}

/* ── RESEARCH FOCUS ──────────────────────────────────────────────── */
#research { background: var(--bg); }
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.r-card {
  background: var(--bg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background 0.2s ease;
  position: relative;
}
.r-card:hover { background: rgba(192,57,43,0.025); }
.r-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 0;
  background: var(--red);
  transition: height 0.4s ease;
}
.r-card:hover::before { height: 100%; }
.r-card-id {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-ghost);
  letter-spacing: 3px;
}
.r-card-area {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.r-card-body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.7;
  flex: 1;
}
.r-card-status {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-ghost);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0.5rem;
}
.r-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-ghost);
  animation: blink 2.5s ease-in-out infinite;
}
.r-dot.crit {
  background: var(--red);
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── CONTACT / CTA ───────────────────────────────────────────────── */
#contact {
  min-height: 80vh;
  background: #040302;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.contact-title {
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.contact-title em {
  font-style: italic;
  color: var(--red);
}
.contact-sub {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.8;
  max-width: 480px;
}
.contact-actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}
.cta-primary {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--red);
  text-decoration: none;
  padding: 14px 32px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cta-primary:hover {
  background: #e04030;
  transform: translateY(-1px);
}
.cta-ghost {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.2s ease;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.cta-ghost:hover { color: var(--ink); border-color: var(--ink-dim); }
.contact-note {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-ghost);
  letter-spacing: 1px;
}

/* ── QUOTE & ECHO ────────────────────────────────────────────────── */
.manifesto {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: none;
  background: #030201;
  position: relative;
  overflow: hidden;
  padding: 8vh 4vw;
  gap: 4rem;
}

/* EEG canvas layer */
#canvasEEG {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.manifesto-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

/* Sanskrit header */
.manifesto-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  animation: fadeUpItem 0.6s ease 0.4s forwards;
}
@keyframes fadeUpItem {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.manifesto-sanskriti {
  font-size: 1.3rem;
  color: rgba(192, 57, 43, 0.45);
  line-height: 1;
  font-family: serif;
}
.manifesto-label {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink-ghost);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* The main quote */
.manifesto-quote {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 7.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.025em;
  list-style: none;
}
.mq-line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.mq-line.visible {
  opacity: 1;
  transform: translateY(0);
}
.mq-accent { color: var(--red); }

/* Crimson rule */
.manifesto-rule {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192,57,43,0.7), transparent);
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  align-self: center;
}
.manifesto-rule.visible { width: 200px; }

/* Secondary philosophical line */
.manifesto-sub {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.2vw, 1.9rem);
  font-style: italic;
  color: var(--ink-dim);
  max-width: 640px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.manifesto-sub.visible { opacity: 1; transform: translateY(0); }

/* Attribution */
.manifesto-attr {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-ghost);
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 1s ease;
}
.manifesto-attr.visible { opacity: 1; }

.echo-banner {
  width: 100%; max-width: 1200px; display: block;
  opacity: 0.85; filter: grayscale(20%) contrast(120%);
  position: relative; z-index: 2;
}


/* ── FOOTER ──────────────────────────────────────────────────────── */
footer { padding: 3rem 4vw; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 10px; color: var(--ink-ghost); text-transform: uppercase; letter-spacing: 2px; }
footer a { color: var(--ink-ghost); text-decoration: none; transition: color 0.3s ease; }
footer a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 2rem; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media(max-width: 900px) {
  .sec-head { flex-direction: column; gap: 2rem; margin-bottom: 3rem; }
  .matrix-row { grid-template-columns: 1fr; gap: 1rem; }
  .topology-grid { grid-template-columns: 1fr; }
  .topo-stage { height: 350px; }
  .research-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  footer { flex-direction: column; gap: 1rem; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}
