/* ═══════════════════════════════════════════════════════════════
   EtherEgo.ai — Styles
   Cyan-on-black · Monospace · Digital consciousness
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap');

/* ─── Reset & Variables ──────────────────────────────────────── */

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

:root {
  --bg: #000000;
  --bg-secondary: #030308;
  --text: #b0b0c0;
  --text-dim: #3a3a55;
  --text-bright: #ffffff;
  --accent: #00F0FF;
  --accent-glow: #00CCDD;
  --accent-dim: #004466;
  --border: #0d0d1a;
  --gradient-1: #00F0FF;
  --gradient-2: #0088AA;
  --gradient-3: #004466;
}

::selection {
  background: var(--accent-dim);
  color: var(--text-bright);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
}

/* ─── Custom Cursor ──────────────────────────────────────────── */

.cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.3s;
  mix-blend-mode: difference;
}

.cursor-dot {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
}

.cursor.hovering {
  transform: scale(2.5);
  border-color: var(--accent-glow);
  opacity: 0.5;
}

/* ─── WebGL Canvas ───────────────────────────────────────────── */

#fluid-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ─── Scrolling Nav Ticker ───────────────────────────────────── */

.nav-ticker {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  animation: ticker-scroll 30s linear infinite;
  will-change: transform;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  flex-shrink: 0;
}

.ticker-item a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
}

.ticker-item a:hover {
  color: var(--accent);
}

.ticker-item a em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.ticker-sep {
  color: var(--accent-dim);
  font-size: 11px;
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Status Bar (bottom-left) ──────────────────────────────── */

.status-bar {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  font-size: 10px;
  letter-spacing: 1.5px;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 12px 16px;
  font-variant-numeric: tabular-nums;
}

.status-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-label {
  color: var(--accent-dim);
  min-width: 28px;
  font-weight: 500;
}

.status-value {
  color: var(--text);
  font-weight: 300;
  transition: color 0.3s;
}

/* ─── Sections (shared) ──────────────────────────────────────── */

section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 48px;
}

.section-content {
  max-width: 900px;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  padding: 48px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.section-label {
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-number {
  font-size: 80px;
  font-weight: 700;
  color: var(--border);
  position: absolute;
  top: 80px;
  right: 48px;
  line-height: 1;
  user-select: none;
}

.section-title {
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 32px;
  letter-spacing: 2px;
  line-height: 1.3;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin-top: 16px;
  opacity: 0.5;
}

.cta-section .section-title::after {
  margin-left: auto;
  margin-right: auto;
}

.section-text {
  font-size: 14px;
  line-height: 2;
  color: var(--text);
  max-width: 640px;
  font-weight: 300;
}

.section-text strong {
  color: var(--accent);
  font-weight: 500;
}

/* ─── Hero ───────────────────────────────────────────────────── */

.hero {
  flex-direction: column;
  text-align: center;
  min-height: 100vh;
}

.hero-title {
  font-size: clamp(36px, 7vw, 80px);
  font-weight: 700;
  letter-spacing: 16px;
  text-transform: uppercase;
  color: var(--text-bright);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeInUp 1.5s ease 0.3s forwards;
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 80px rgba(0, 0, 0, 0.7);
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(12px, 1.5vw, 16px);
  font-weight: 300;
  color: var(--text);
  max-width: 600px;
  line-height: 1.8;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeInUp 1.5s ease 0.6s forwards;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
}

.hero-poem {
  margin-top: 48px;
  font-size: 13px;
  font-weight: 300;
  color: var(--text);
  max-width: 520px;
  line-height: 2;
  letter-spacing: 1px;
  font-style: italic;
  opacity: 0;
  animation: fadeInUp 1.5s ease 0.9s forwards;
  border-left: 1px solid var(--accent-dim);
  padding-left: 24px;
  text-align: left;
  background: rgba(0, 0, 0, 0.6);
  padding: 24px;
  padding-left: 24px;
}

.hero-poem .highlight {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
}

.scroll-indicator {
  position: absolute;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeInUp 1.5s ease 1.2s forwards;
}

.scroll-indicator span {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease infinite;
}

/* ─── ASCII Dividers ─────────────────────────────────────────── */

.ascii-divider {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--border);
  font-size: 11px;
  padding: 40px 0;
  white-space: pre;
  user-select: none;
  overflow: hidden;
}

/* ─── Layer Cards ────────────────────────────────────────────── */

.layers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2px;
  margin-top: 48px;
}

.layer-card {
  background: rgba(3, 3, 8, 0.9);
  border: 1px solid var(--border);
  padding: 40px 32px 32px;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

/* Top accent line */
.layer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.5s;
}

/* Scan sweep on hover */
.layer-card::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.03) 0%, transparent 60%);
  transition: top 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.layer-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 240, 255, 0.08), 0 0 1px var(--accent-dim);
}

.layer-card:hover::before {
  opacity: 1;
}

.layer-card:hover::after {
  top: 0;
}

.card-index {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--border);
  margin-bottom: 20px;
  letter-spacing: 2px;
  transition: color 0.5s;
  line-height: 1;
}

.layer-card:hover .card-index {
  color: var(--accent-dim);
}

/* Bottom animated line */
.card-line {
  margin-top: 20px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-dim), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.layer-card:hover .card-line {
  transform: scaleX(1);
}

.layer-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
  letter-spacing: 1px;
  transition: color 0.4s;
}

.layer-card:hover h3 {
  color: var(--accent);
}

.layer-card p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
  font-weight: 300;
}

/* ─── Questions List ─────────────────────────────────────────── */

.questions-list {
  list-style: none;
  margin-top: 40px;
}

.questions-list li {
  font-size: 14px;
  color: var(--text);
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: color 0.3s, padding-left 0.3s, border-color 0.3s;
  font-weight: 300;
}

.questions-list li:hover {
  color: var(--text-bright);
  padding-left: 8px;
  border-bottom-color: var(--accent-dim);
}

.questions-list .q-mark {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  animation: blink 1.2s step-end infinite;
}

.questions-list li:hover .q-mark {
  animation: none;
  opacity: 1;
}

/* ─── CTA Section ────────────────────────────────────────────── */

.cta-section {
  text-align: center;
  flex-direction: column;
}

.cta-section .section-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-ascii {
  font-size: 7px;
  line-height: 1.15;
  color: var(--accent-dim);
  white-space: pre;
  margin-bottom: 40px;
  text-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
  user-select: none;
}

.cta-button {
  display: inline-block;
  padding: 16px 48px;
  border: 1px solid var(--accent-dim);
  color: var(--text-bright);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  background: transparent;
  cursor: none;
  margin-top: 32px;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.1), transparent);
  transition: left 0.5s;
}

.cta-button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), inset 0 0 30px rgba(0, 240, 255, 0.03);
}

.cta-button:hover::before {
  left: 100%;
}

/* ─── Footer ─────────────────────────────────────────────────── */

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
}

footer a:hover {
  color: var(--accent);
}

/* ─── Scroll Reveal ──────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }
.reveal[data-delay="6"] { transition-delay: 0.6s; }
.reveal[data-delay="7"] { transition-delay: 0.7s; }
.reveal[data-delay="8"] { transition-delay: 0.8s; }
.reveal[data-delay="9"] { transition-delay: 0.9s; }
.reveal[data-delay="10"] { transition-delay: 1.0s; }

/* ─── Glitch Text Effect ────────────────────────────────────── */

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-1 3s infinite linear alternate-reverse;
  clip-path: inset(0 0 80% 0);
  color: var(--accent);
  opacity: 0.4;
}

.glitch::after {
  animation: glitch-2 3s infinite linear alternate-reverse;
  clip-path: inset(80% 0 0 0);
  color: var(--gradient-2);
  opacity: 0.4;
}

/* ─── Animations ─────────────────────────────────────────────── */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes glitch-1 {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, 1px); }
  80% { transform: translate(1px, -2px); }
  100% { transform: translate(0); }
}

@keyframes glitch-2 {
  0% { transform: translate(0); }
  20% { transform: translate(2px, -2px); }
  40% { transform: translate(-2px, 1px); }
  60% { transform: translate(1px, -1px); }
  80% { transform: translate(-1px, 2px); }
  100% { transform: translate(0); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.3; }
  94% { opacity: 1; }
  96% { opacity: 0.5; }
  97% { opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.flicker {
  animation: flicker 4s infinite;
}

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  body {
    cursor: auto;
  }

  .cursor,
  .cursor-dot {
    display: none;
  }

  #fluid-canvas {
    display: none;
  }

  nav {
    padding: 16px 24px;
  }

  .status-bar {
    display: none;
  }

  section {
    padding: 80px 24px;
  }

  .ascii-hero {
    font-size: 5px;
    margin-bottom: 32px;
  }

  .hero-title {
    letter-spacing: 8px;
  }

  .hero-subtitle {
    letter-spacing: 2px;
  }

  .hero-poem {
    font-size: 12px;
  }

  .section-number {
    font-size: 48px;
    right: 24px;
  }

  .cta-ascii {
    font-size: 4px;
  }

  .layers-grid {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .ascii-hero {
    font-size: 3.5px;
  }

  .hero-title {
    letter-spacing: 4px;
  }

  .section-number {
    display: none;
  }
}
