/* ===========================
   Global / Base
=========================== */

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

html { scroll-behavior: smooth; }

body {
  font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
  background: #000;
  color: #e0e0e0;
  overflow-x: hidden;
  padding-top: 70px; /* fixed header space */
}

/* Background ASCII canvas */
#ascii-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  background: #000;
  opacity: .6;
  pointer-events: none;
  display: block;
}

/* ===========================
   Header
=========================== */

header {
  position: fixed; top: 0; left: 0; width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 3vw;
  height: 70px;
  background: rgba(10,10,10,.8);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid #333;
  z-index: 10;
}

.logo a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(1.2em, 2vw, 1.5em);
}
.logo {
  display: flex;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px; /* space between logo and text */
}

.logo-img {
    height: 42px; /* bigger size */
    margin-right: 10px;
    filter: brightness(0) invert(1); /* keep it white */
    vertical-align: middle; /* aligns nicely with text */
}



nav ul { list-style: none; display: flex; align-items: center; }
nav li { margin-left: clamp(15px, 2.5vw, 25px); }
nav a {
  color: #c0c0c0; text-decoration: none;
  font-size: clamp(.8em, 1.5vw, .95em);
  transition: color .25s ease;
}
nav a:hover { color: #fff; }

.launch-button {
  background: transparent; color: #fff; border: 1px solid #fff;
  padding: clamp(6px, 1vh, 8px) clamp(12px, 2vw, 18px);
  border-radius: 6px; font-weight: 700;
  transition: background-color .25s ease, color .25s ease;
  white-space: nowrap;
}
.launch-button:hover { background: #fff; color: #000; }

/* ===========================
   Sections / Layout
=========================== */

main { width: 100%; background: transparent; }

.content-section {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 8vh 0;
  position: relative; z-index: 1; width: 100%;
  background: transparent;
}

.content-wrapper {
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 0 5vw;
  display: flex; align-items: center; justify-content: space-between;
  gap: 3vw;
}

.text-content { flex: 1 1 48%; }
.visual-spacer { flex: 1 1 48%; }

/* Divider + fade-in utility */
.section-divider {
  height: 4px; width: 100%;
  background: linear-gradient(90deg, #ff00cc, #3333ff, #00ffff);
  background-size: 300% 100%;
  animation: slideGradient 4s ease infinite;
}
@keyframes slideGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.fade-in-section {
  opacity: 0; transform: translateY(20px);
  transition: opacity .8s ease-out, transform .8s ease-out;
  will-change: opacity, transform;
}
.fade-in-section.visible { opacity: 1; transform: translateY(0); }

/* ===========================
   Level 1 (transparent bg)
=========================== */

#level-1 { background: transparent; }
#level-1 .content-wrapper { justify-content: space-between; }
#level-1 h1 {
  font-size: clamp(2em, 5vw, 3.2em);
  margin-bottom: .35em; line-height: 1.25;
  color: #e0e0e0;
}
#level-1 p {
  font-size: clamp(1.1em, 2.2vw, 1.4em);
  color: #a0a0a0;
  max-width: 36ch;
}

/* ===========================
   Level 2 (transparent bg)
=========================== */

#level-2 { background: transparent; }
#level-2 .content-wrapper { flex-direction: row-reverse; }
#level-2 p {
  font-size: clamp(1.05em, 2vw, 1.25em);
  line-height: 1.65;
  color: #e0e0e0;
  max-width: 46ch;
}

/* ===========================
   Level 3 (frosted light panel)
=========================== */

#level-3 {
  background: rgba(240,240,240,.75);
  color: #111;
  box-shadow: inset 0 0 40px rgba(0,0,0,.05);
  position: relative; overflow: hidden;
  backdrop-filter: blur(8px);
}
#level-3::before {
  content: "";
  position: absolute; top: -80px; left: 0; width: 100%; height: 80px;
  background: linear-gradient(to bottom, rgba(0,0,0,.9), #808080 80%);
  z-index: 0;
}
#level-3 .content-wrapper {
  flex-direction: column;
  justify-content: center; align-items: center;
  max-width: 900px;
  gap: 5vh;
}
#level3-visual-container {
  width: 100%; max-width: clamp(300px, 45vw, 520px);
  aspect-ratio: 1 / 1; position: relative;
}
#level3-ascii-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; background: transparent;
  box-shadow: 0 0 60px rgba(255,255,255,.05);
  transition: opacity .6s ease;
}
#level-3 .text-content {
  width: 100%; max-width: 680px; text-align: center; color: #111; z-index: 2;
}
#level-3 p {
  font-size: clamp(1.2em, 3.2vw, 1.6em);
  line-height: 1.6;
  color: #0f1115;
  padding-inline: 16px; /* extra breathing room on mobile */
}
#level3-visual-container { position: relative; }

#level3-ascii-canvas.pinned {
  position: fixed;
  top: 12vh;                 /* where it sits while pinned */
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 520px);   /* keep same visual size as Level-3 container */
  height: auto;
  pointer-events: none;
  z-index: 20;               /* above Level-4 graph */
}
/* ===========================
   Level 4 (graph + copy)
=========================== */

#level-4 {
  background: rgba(240,240,240,.75);
  color: #111;
  box-shadow: inset 0 0 40px rgba(0,0,0,.05);
  position: relative; overflow: hidden;
  backdrop-filter: blur(8px);
}

/* Always stack graph over text */
#level-4 .content-wrapper {
  flex-direction: column; align-items: center; gap: 2rem;
}

#level-4 .graph-container {
  position: relative;
  width: 100%; max-width: 900px;
  aspect-ratio: 16 / 9;
  min-height: 220px; max-height: 50vh;
  border-radius: 16px;
  background: linear-gradient(180deg, #191B20 0%, #111218 100%);
  box-shadow: 0 20px 50px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.06);
  overflow: hidden; display: flex;
}
#level-4 .graph-container::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.08), rgba(0,0,0,0) 60%),
    radial-gradient(120% 120% at 50% 120%, rgba(0,0,0,.35), rgba(0,0,0,0) 40%);
  pointer-events: none;
}
#level-4 .graph-container svg { width: 100%; height: 100%; display: block; }

#level-4 .text-content {
  max-width: 700px; text-align: center; color: #111; margin: 0 auto;
}
#level-4 p {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: #0E0F14;
}

/* ===========================
   Responsive
=========================== */

@media (max-width: 768px) {
  body { padding-top: 60px; }

  header { height: 60px; padding: 10px 4vw; }
  nav ul { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

  /* default: stack columns */
  .content-wrapper {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 6vw;
    gap: 4vh;
  }

  /* Level 1 text sizing/padding */
  #level-1 h1 { font-size: clamp(1.6em, 7vw, 2.2em); }
  #level-1 p { font-size: clamp(1em, 4.5vw, 1.2em); max-width: 40ch; }

  /* Level 2 fix: remove spacer & widen text */
  #level-2 .visual-spacer { display: none; }
  #level-2 .text-content { max-width: 100%; }
  #level-2 p { padding-inline: 12px; max-width: 44ch; }

  /* Level 3 readability tweaks */
  #level3-visual-container { max-width: 90vw; aspect-ratio: 1 / 1; }
  #level-3 .text-content { max-width: 90vw; }
  #level-3 p { font-size: clamp(1.05em, 4.5vw, 1.35em); line-height: 1.65; }

  /* Level 4 graph sizing/padding */
  #level-4 .graph-container {
    max-height: 40vh; min-height: 160px; aspect-ratio: 4 / 3;
  }
  #level-4 .text-content { padding-inline: 14px; }
}
