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

:root {
  /* Upgraded Modern Cyber Palette */
  --black: #0d0e12; 
  --green: #2ee59d; 
  --green-dim: #1a8f60;
  --teal: #00f0ff; 
  --purple: #d17cff; 
  --purple-dim: #8b40bd;
  --white: #e2e8f0; 
  
  /* Refined Glows */
  --green-glow: 0 0 15px rgba(46, 229, 157, 0.4), 0 0 40px rgba(46, 229, 157, 0.15);
  --teal-glow: 0 0 15px rgba(0, 240, 255, 0.4), 0 0 40px rgba(0, 240, 255, 0.15);
  --purple-glow: 0 0 15px rgba(209, 124, 255, 0.4), 0 0 40px rgba(209, 124, 255, 0.15);
  
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;
  --font-display: 'Outfit', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
}

/* ── SCANLINE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(46, 229, 157, 0.04) 2px,
    rgba(46, 229, 157, 0.04) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── NOISE TEXTURE ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
}

a { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════
   BOOT SEQUENCE OVERLAY
   ═══════════════════════════════════════ */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 3rem;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  color: var(--green);
  animation: bootFadeOut 0.6s ease 8.2s forwards;
  overflow: hidden;
}

.boot-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(46, 229, 157, 0.05) 2px,
    rgba(46, 229, 157, 0.05) 4px
  );
  pointer-events: none;
}

@keyframes bootFadeOut {
  0% { opacity: 1; pointer-events: all; }
  100% { opacity: 0; pointer-events: none; visibility: hidden; }
}

.boot-line {
  opacity: 0;
  white-space: pre;
  line-height: 1.7;
  position: relative;
  text-shadow: 0 0 6px rgba(46, 229, 157, 0.4);
}

.boot-line.teal { color: var(--teal); text-shadow: 0 0 6px rgba(0, 240, 255, 0.4); }
.boot-line.purple { color: var(--purple); text-shadow: 0 0 6px rgba(209, 124, 255, 0.4); }
.boot-line.white { color: var(--white); }
.boot-line.dim { color: var(--green-dim); text-shadow: none; }

.boot-line:nth-child(1)  { animation: bootType 0.05s steps(1) 0.4s forwards; }
.boot-line:nth-child(2)  { animation: bootType 0.05s steps(1) 0.8s forwards; }
.boot-line:nth-child(3)  { animation: bootType 0.05s steps(1) 1.3s forwards; }
.boot-line:nth-child(4)  { animation: bootType 0.05s steps(1) 1.6s forwards; }
.boot-line:nth-child(5)  { animation: bootType 0.05s steps(1) 1.9s forwards; }
.boot-line:nth-child(6)  { animation: bootType 0.05s steps(1) 2.2s forwards; }
.boot-line:nth-child(7)  { animation: bootType 0.05s steps(1) 2.7s forwards; }
.boot-line:nth-child(8)  { animation: bootType 0.05s steps(1) 3.2s forwards; }
.boot-line:nth-child(9)  { animation: bootType 0.05s steps(1) 3.5s forwards; }
.boot-line:nth-child(10) { animation: bootType 0.05s steps(1) 3.8s forwards; }
.boot-line:nth-child(11) { animation: bootType 0.05s steps(1) 4.1s forwards; }
.boot-line:nth-child(12) { animation: bootType 0.05s steps(1) 4.4s forwards; }
.boot-line:nth-child(13) { animation: bootType 0.05s steps(1) 4.9s forwards; }
.boot-line:nth-child(14) { animation: bootType 0.05s steps(1) 5.2s forwards; }
.boot-line:nth-child(15) { animation: bootType 0.05s steps(1) 5.5s forwards; }
.boot-line:nth-child(16) { animation: bootType 0.05s steps(1) 5.9s forwards; }
.boot-line:nth-child(17) { animation: bootType 0.05s steps(1) 6.3s forwards; }

.boot-progress {
  margin-top: 1.5rem;
  width: min(400px, 80vw);
  height: 3px;
  background: rgba(46, 229, 157, 0.15);
  border: 1px solid var(--green);
  opacity: 0;
  animation: bootType 0.05s steps(1) 6.5s forwards;
  overflow: hidden;
}

.boot-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(46, 229, 157, 0.6);
  animation: bootFill 1.4s ease-in-out 6.6s forwards;
}

@keyframes bootType {
  to { opacity: 1; }
}

@keyframes bootFill {
  0% { width: 0%; }
  20% { width: 30%; }
  50% { width: 65%; }
  75% { width: 88%; }
  100% { width: 100%; }
}

.boot-cursor-inline {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
  margin-left: 1px;
}

/* ═══════════════════════════════════════
   MAIN SITE
   ═══════════════════════════════════════ */
.site-wrap {
  opacity: 0;
  animation: siteReveal 0.6s ease 8.6s forwards;
}

@keyframes siteReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── TOP BAR ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(13, 14, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--green);
}

.topbar-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green);
  text-shadow: var(--green-glow);
}

.topbar-status {
  font-size: 0.75rem;
  color: var(--green);
  letter-spacing: 0.1em;
  animation: blinkSettle 1.2s step-end 4 forwards;
}

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

@keyframes blink {
  50% { opacity: 0; }
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(46, 229, 157, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 229, 157, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 70%);
}

.hero-art-slot {
  width: clamp(120px, 20vw, 220px);
  height: clamp(120px, 20vw, 220px);
  border-radius: 50%;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: fadeInUp 0.8s ease-out;
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

.hero-art-slot::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(209, 124, 255, 0.3);
  animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.1; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.5rem, 10vw, 9rem);
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--white);
  position: relative;
  /* Entrance animation stays strictly on the wrapper */
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.hero-title .corps {
  display: block;
  color: var(--green);
  text-shadow: var(--green-glow);
}

.hero-tagline {
  margin-top: 1.5rem;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--white);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-tagline span.hl-teal { color: var(--teal); text-shadow: var(--teal-glow); }
.hero-tagline span.hl-green { color: var(--green); text-shadow: var(--green-glow); }
.hero-tagline span.hl-purple { color: var(--purple); text-shadow: var(--purple-glow); }

.hero-prompt {
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--green);
  animation: fadeInUp 0.8s ease-out 0.45s both;
}

.hero-prompt .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

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

/* ── DIVIDER ── */
.divider {
  width: 100%;
  padding: 0 2rem;
}

.divider-inner {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--green) 15%, var(--teal) 40%, var(--purple) 60%, var(--green) 85%, transparent 100%);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

/* ── NAV GRID ── */
.nav-section {
  padding: 4rem 2rem 5rem;
}

.nav-section-label {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--green);
  text-align: center;
  margin-bottom: 3rem;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-card {
  position: relative;
  padding: 2.5rem 2rem;
  border: 2px solid var(--green);
  background: rgba(46, 229, 157, 0.05);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  overflow: hidden;
}

.nav-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(209, 124, 255, 0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-card:hover {
  border-color: var(--purple);
  background: rgba(209, 124, 255, 0.08);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--purple);
}

.nav-card:hover::before { opacity: 1; }
.nav-card:hover .nav-card-idx { color: var(--teal); text-shadow: var(--teal-glow); }

.nav-card-idx {
  font-size: 0.7rem;
  color: var(--green);
  letter-spacing: 0.3em;
  text-shadow: var(--green-glow);
  transition: all 0.25s ease;
}

.nav-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
}

.nav-card-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--white);
  opacity: 0.85;
}

.nav-card-arrow {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 1.2rem;
  color: var(--green);
  transition: all 0.25s ease;
}

.nav-card:hover .nav-card-arrow {
  transform: translateX(8px);
  color: var(--purple);
}

/* ── MANIFEST STRIP (below nav) ── */
.manifest {
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  border-top: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  background:
    linear-gradient(135deg, rgba(209, 124, 255, 0.08) 0%, transparent 40%),
    linear-gradient(315deg, rgba(0, 240, 255, 0.06) 0%, transparent 40%);
}

.manifest-label {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--teal);
  text-shadow: var(--teal-glow);
  margin-bottom: 2rem;
}

.manifest-text {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.2rem, 3vw, 2rem);
  line-height: 1.6;
  color: var(--white);
  max-width: 800px;
  margin: 0 auto;
}

.manifest-text strong {
  font-weight: 800;
  color: var(--green);
  text-shadow: 0 0 12px rgba(46, 229, 157, 0.3);
}

.manifest-text em {
  font-style: normal;
  color: var(--purple);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(209, 124, 255, 0.3);
}

/* ── FOOTER ── */
footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 2px solid var(--green);
  background: rgba(13, 14, 18, 0.5);
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
  text-shadow: var(--green-glow);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--teal); }

.footer-copy {
  font-size: 0.65rem;
  color: var(--white);
  opacity: 0.6;
  letter-spacing: 0.1em;
}

/* ── GLITCH EFFECT ON HOVER ── */
.glitch-hover {
  position: relative;
  display: inline-block;
}

.glitch-hover:hover {
  /* Glitch strictly applied to inner span now */
  animation: glitch 0.3s ease;
}

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

/* ── MOBILE ── */
@media (max-width: 768px) {
  .topbar { padding: 0.75rem 1rem; }
  .nav-grid { grid-template-columns: 1fr; gap: 0; }
  .nav-card { border-width: 1px; }
  .hero { padding: 5rem 1.5rem 3rem; }
  .boot-overlay { padding: 1.5rem; font-size: 0.65rem; }
}

/* ── SKIP LINK (a11y) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--green);
  color: var(--black);
  font-weight: bold;
  z-index: 30000;
  font-family: var(--font-mono);
}
.skip-link:focus { top: 0.5rem; }
/* ── NO-BOOT (3+ visits) ── */
html.no-boot .boot-overlay {
  display: none;
}
html.no-boot .site-wrap {
  opacity: 1;
  animation: none;
}
