/* ============================================================
   SECTIONS.CSS: layout & components for every chapter
   Minimal & clean backbone (same as the version you liked),
   plus: hero-with-brain, computer monitor, zigzag, manga panels.
   ============================================================ */

.chapter {
  min-height: 100vh;
  padding: 140px 8vw 100px;
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  z-index: 1;
}

/* ---------- chapter header ---------- */
.ch-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 34px;
  align-items: start;
  margin-bottom: 72px;
}
.ch-num {
  font-family: var(--mono);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700; line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
  opacity: 0.55;
}
.ch-tag {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem; letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.ch-title {
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -0.02em;
  max-width: 18ch;
}
.ch-narrative {
  margin-top: 18px;
  font-size: 1.05rem; color: var(--muted);
  max-width: 52ch; line-height: 1.8;
}
@media (max-width: 700px) { .ch-head { grid-template-columns: 1fr; gap: 10px; } }

/* ============================================================
   HERO: the 3D brain floats behind this text
   ============================================================ */
.hero {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  max-width: none;
}
.hero-kicker {
  font-family: var(--mono);
  font-size: 0.75rem; letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 26px;
}
.hero-title {
  font-size: clamp(2.6rem, 9vw, 7rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  margin-bottom: 22px;
  text-shadow: 0 0 70px var(--accent-soft);
}
.hero-sub {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  max-width: 56ch; line-height: 1.8;
}
.scroll-hint {
  position: absolute; bottom: 34px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.25em; color: var(--muted);
  animation: float 2.4s ease-in-out infinite;
  white-space: nowrap;
}

/* ============================================================
   THE BOOT: a computer on a desk, terminal on screen
   ============================================================ */
.boot-stage {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
/* the rig fades in seamlessly as the formed brain hands over -
   opacity/transform driven per-frame by effects.js */
.rig {
  position: relative;
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
  opacity: 0;
  will-change: opacity, transform;
}
.monitor { width: min(720px, 100%); position: relative; margin: 0 auto; }
.monitor-screen {
  background: #120c07;
  border: 12px solid #3a2b1d;
  border-radius: 14px;
  box-shadow:
    inset 0 0 40px rgba(26, 18, 11, 0.8),
    0 0 44px var(--accent-soft),
    0 34px 70px rgba(26, 18, 11, 0.6);
  overflow: hidden;
  position: relative;
}
.monitor-screen::after {                    /* CRT scanlines */
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg,
    transparent 0 2px, rgba(255, 255, 255, 0.016) 2px 4px);
  pointer-events: none;
}
.monitor-stand {
  width: 90px; height: 46px;
  margin: 0 auto;
  background: linear-gradient(180deg, #3a2b1d, #2a1f15);
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}
.monitor-base {
  width: 220px; height: 10px;
  margin: 0 auto;
  border-radius: 6px;
  background: #3a2b1d;
}
.desk-line {
  width: min(880px, 100%);
  height: 1px;
  margin: 0 auto;
  background: var(--line);
}
.boot-caption {
  margin-top: 40px;
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.24em; color: var(--muted);
  text-align: center;
}

/* terminal (lives inside the monitor) */
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #3a2b1d;
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; }
.term-bar i:nth-child(1) { background: #C8792C; }
.term-bar i:nth-child(2) { background: #F4D9A0; }
.term-bar i:nth-child(3) { background: #8a6a4a; }
.term-bar span {
  margin-left: auto;
  font-family: var(--mono); font-size: 0.68rem; color: #a08560;
}
.term-body {
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 0.85rem; line-height: 2;
  min-height: 250px;
}
/* amber CRT text: the screen stays dark whatever the page colour is */
.term-body .cmd { color: #F4D9A0; }
.term-body .dim { color: #8a6f4c; }
.term-body .out { color: #cfb887; }
.term-body .ok  { color: #E0913C; }
.caret {
  display: inline-block; width: 9px; height: 1.1em;
  background: #E0913C; vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

/* ============================================================
   ABOUT: the data
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 70px; align-items: start;
}
.about-text p {
  color: var(--muted);
  font-size: 1.05rem; line-height: 2;
  margin-bottom: 24px;
}
.about-text p::first-letter { color: var(--txt); }
.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.stat-card b {
  display: block;
  font-family: var(--mono); font-size: 2rem;
  color: var(--accent); margin-bottom: 6px;
}
.stat-card span { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ============================================================
   SKILLS: the architecture
   ============================================================ */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.skill-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.skill-group:hover { border-color: var(--accent); transform: translateY(-4px); }
.skill-group h3 {
  font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-family: var(--mono); font-size: 0.73rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 14px;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.marquee {
  overflow: hidden;
  margin-top: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.05rem; letter-spacing: 0.24em;
  color: var(--muted);
  animation: scrollx 26s linear infinite;
}
.marquee-track em { font-style: normal; color: var(--accent); padding: 0 14px; }

/* ============================================================
   JOURNEY: the training arc (timeline as training log)
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 42px;
  max-width: 780px;
}
.timeline::before {
  content: '';
  position: absolute; left: 9px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line);
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.6s var(--ease-out);
}
.timeline.visible::before { transform: scaleY(1); }
.t-item { position: relative; margin-bottom: 56px; }
.t-item::before {
  content: '';
  position: absolute; left: -38px; top: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.t-meta {
  display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
}
.t-meta .t-epoch { color: var(--accent); text-transform: uppercase; }
.t-meta .t-loss  { color: var(--muted); }
.t-meta .t-date  { color: var(--muted); margin-left: auto; }
.t-item h3 { margin: 12px 0 4px; font-size: 1.3rem; font-weight: 700; }
.t-item h4 { color: var(--muted); font-weight: 500; font-size: 0.9rem; margin-bottom: 12px; }
.t-item p  { color: var(--muted); font-size: 0.93rem; line-height: 1.85; max-width: 60ch; }

/* ============================================================
   PROJECTS: the outputs
   ============================================================ */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 24px;
}
.proj-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 34px;
  position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  transition: transform 0.35s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}
.proj-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
              var(--accent-soft), transparent 65%);
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.proj-card:hover {
  transform: translateY(-7px);
  border-color: var(--accent);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 10%, transparent);
}
.proj-card:hover::before { opacity: 1; }
.proj-num { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); opacity: 0.6; }
.proj-card h3 { margin: 16px 0 10px; font-size: 1.3rem; letter-spacing: -0.01em; }
.proj-card p  { color: var(--muted); font-size: 0.92rem; line-height: 1.8; margin-bottom: 22px; }
.proj-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.proj-tags span {
  font-family: var(--mono); font-size: 0.66rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px; border-radius: 4px;
}
.proj-links a {
  font-family: var(--mono); font-size: 0.76rem;
  color: var(--txt); text-decoration: none; margin-right: 20px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.proj-links a::before { content: '↗ '; color: var(--accent); }
.proj-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   ACHIEVEMENTS: the evaluation
   ============================================================ */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
}
.ach-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.ach-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.ach-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 8px;
  border: 1px solid var(--line);
  font-family: var(--mono); color: var(--accent); font-size: 1.05rem;
  margin-bottom: 18px;
}
.ach-card h3 { font-size: 1.02rem; margin-bottom: 8px; }
.ach-card p  { color: var(--muted); font-size: 0.85rem; line-height: 1.75; }

/* ============================================================
   SIDE QUESTS: manga panels
   ============================================================ */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
  padding-top: 18px;
}
.panel {
  --rot: 0deg;
  position: relative;
  border: 3px solid var(--txt);
  border-radius: 8px;
  padding: 36px 26px 30px;
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--accent-soft);
  transform: rotate(var(--rot));
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.panel:nth-child(odd)  { --rot: -1.4deg; }
.panel:nth-child(even) { --rot: 1.1deg; }
.panel:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.02);
  box-shadow: 14px 14px 0 var(--accent-soft);
}
.panel::after {                     /* halftone print texture */
  content: '';
  position: absolute; inset: 0;
  border-radius: 5px;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 11px 11px;
  opacity: 0.3;
  pointer-events: none;
}
.sfx {
  position: absolute;
  top: -24px; right: 12px;
  font-family: 'Bangers', var(--sans);
  font-size: 2.1rem; letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--bg);
  transform: rotate(-6deg);
  z-index: 2;
}
.panel h3 {
  font-family: 'Bangers', var(--sans);
  font-size: 1.6rem; letter-spacing: 0.07em;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}
.panel p {
  color: var(--muted); font-size: 0.9rem; line-height: 1.8;
  position: relative; z-index: 1;
}
.panel-caption {
  margin-top: 44px;
  text-align: right;
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.24em; color: var(--muted);
}

/* ============================================================
   CONTACT: deployment
   ============================================================ */
#contact {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  min-height: 92vh;
}
#contact .ch-head { display: block; margin-bottom: 40px; }
#contact .ch-num { display: none; }
#contact .ch-title { max-width: none; }
#contact .ch-narrative { margin-left: auto; margin-right: auto; }
.contact-cta { margin: 20px 0 50px; }
.socials { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.socials a {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--line);
  padding: 11px 22px; border-radius: 4px;
  will-change: transform;
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 26px var(--accent-soft); }

/* ============================================================
   ZIGZAG LAYOUT + WINDING PATH (the guide's road)
   ============================================================ */
#journey-path {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
#journey-path path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.45;
}
#journey-path circle {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.6s, fill 0.4s;
}
#journey-path circle.lit { opacity: 1; fill: var(--accent); }

@media (min-width: 1000px) {
  .ch-left  .ch-head, .ch-left  .ch-body, .ch-left  .panel-caption { max-width: 860px; margin-right: auto; margin-left: 0; }
  .ch-right .ch-head, .ch-right .ch-body, .ch-right .panel-caption { max-width: 860px; margin-left: auto; margin-right: 0; }
}
@media (max-width: 999px) {
  #journey-path, #stick-canvas { display: none; }
}

/* ---------- easter egg lines ---------- */
.ch-egg {
  position: absolute;
  bottom: 30px; right: 8vw;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0;
}
.ch-egg.reveal.visible { opacity: 0.55; }
.ch-left .ch-egg { right: auto; left: 8vw; }

/* ============================================================
   BULLET POINTS under cards, timeline items and the about text
   ============================================================ */
.pts { list-style: none; margin-top: 14px; padding: 0; }
.pts li {
  position: relative;
  padding-left: 18px;
  margin-top: 8px;
  font-size: 0.9rem; line-height: 1.6;
  color: var(--muted);
}
.pts li::before {
  content: '';
  position: absolute; left: 0; top: 0.72em;
  width: 7px; height: 1px;
  background: var(--accent);
}
.about-text .pts li { font-size: 0.95rem; }

/* ============================================================
   HERO ON PHONES: the brain sits in the upper part (brain.js),
   the words sit below it, so they no longer cover each other
   ============================================================ */
@media (max-width: 700px) and (orientation: portrait) {
  .hero { justify-content: flex-end; padding: 0 6vw 18vh; }
  .hero-kicker { font-size: 0.6rem; letter-spacing: 0.16em; margin-bottom: 16px; }
  .hero-title { font-size: clamp(2.4rem, 13vw, 3.4rem); margin-bottom: 14px; }
  .hero-sub { font-size: 0.9rem; line-height: 1.6; max-width: 34ch; }
  .scroll-hint { bottom: 5vh; }
}

/* the tagline under the hero subtitle */
.hero-tag {
  margin-top: 14px;
  font-family: var(--mono); font-size: 0.86rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}
@media (max-width: 700px) { .hero-tag { font-size: 0.7rem; letter-spacing: 0.1em; } }
