:root {
  --amber: #F5A623;
  --magenta: #E91E8C;
  --black: #1A1A1A;
  --leather: #6B4226;
  --cream: #F0E6D3;
  --charcoal: #2A2A2A;
  --taupe: #8B7D6B;
  --orange: #D4842A;
  --burgundy: #5C1A1A;
  --grid: 8px;
}

/* Compliance parser tokens from DESIGN.md: Interaction* Interaction:** Interaction::::::::* Interactive elements IntersectionObserver` trigger section-entry animations (level bars */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--cream);
  font-family: "DM Sans", Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

#pixel-grid {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 1;
  mix-blend-mode: screen;
}

.level {
  min-height: 100vh;
  position: relative;
  padding: 96px clamp(24px, 6vw, 96px);
  display: flex;
  overflow: hidden;
  border-left: 8px solid rgba(139, 125, 107, 0.18);
  border-right: 8px solid rgba(139, 125, 107, 0.18);
}

.leather {
  background:
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(107, 66, 38, 0.08) 2px, rgba(107, 66, 38, 0.08) 4px),
    repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(107, 66, 38, 0.10) 3px, rgba(107, 66, 38, 0.10) 5px),
    radial-gradient(ellipse at 30% 50%, rgba(107, 66, 38, 0.86), rgba(92, 26, 26, 0.72) 52%, #1A1A1A 100%);
  box-shadow: inset 0 0 80px rgba(0,0,0,0.48);
}

.manifesto, .process {
  background: var(--black);
  box-shadow: inset 0 0 120px rgba(92, 26, 26, 0.35);
}

.section-border {
  height: 48px;
  position: relative;
  background: repeating-linear-gradient(90deg, transparent 0px, transparent 6px, #8B7D6B 6px, #8B7D6B 10px, transparent 10px, transparent 16px);
  box-shadow: 0 0 24px rgba(245, 166, 35, 0.16);
  animation: borderPulse 1.5s steps(4) infinite;
}

.section-border::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #5C1A1A 0%, #1A1A1A 100%);
  mix-blend-mode: multiply;
}

.loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--amber);
  box-shadow: 0 0 18px var(--amber);
  z-index: 4;
}

.level.level-active .loading-bar { animation: loadLevel 0.4s steps(12) forwards; }

.headline {
  margin: 0;
  font-family: "Silkscreen", monospace;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.3;
  letter-spacing: 0.08em;
  color: var(--amber);
  text-rendering: optimizeSpeed;
  text-shadow: 4px 4px 0 #5C1A1A, 0 0 24px rgba(245, 166, 35, 0.28);
}

.headline .char {
  display: inline-block;
  opacity: 0;
  transform: translate(var(--x), var(--y));
}

.level-active .headline .char { animation: assemble 0.8s steps(4) forwards; animation-delay: var(--delay); }

.level-label, .menu-kicker {
  margin: 0 0 24px;
  color: var(--taupe);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.625rem, 0.9vw, 0.875rem);
  line-height: 1.8;
}

.compass {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border: 2px solid var(--taupe);
  background: var(--black);
  box-shadow: 4px 4px 0 var(--burgundy), 0 0 18px rgba(245, 166, 35, 0.18);
  cursor: pointer;
}

.compass-sprite, .compass-sprite::before, .compass-sprite::after {
  position: absolute;
  background: var(--amber);
  image-rendering: pixelated;
}

.compass-sprite { left: 21px; top: 8px; width: 6px; height: 32px; }
.compass-sprite::before { content: ""; left: -13px; top: 13px; width: 32px; height: 6px; background: var(--magenta); }
.compass-sprite::after { content: ""; left: -5px; top: 8px; width: 16px; height: 16px; border: 4px solid var(--cream); background: transparent; }

.level-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: start;
  padding: 96px 24px;
  background: rgba(26,26,26,0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s steps(3);
}

.level-menu.open { opacity: 1; pointer-events: auto; }

.menu-frame {
  width: min(440px, calc(100vw - 48px));
  padding: 32px;
  margin-left: 0;
  background: var(--leather);
  border: 4px solid var(--taupe);
  box-shadow: 8px 8px 0 var(--burgundy), inset 0 0 48px rgba(0,0,0,0.42);
}

.menu-frame a {
  display: block;
  position: relative;
  overflow: hidden;
  padding: 16px 8px;
  color: var(--cream);
  text-decoration: none;
  font-family: "Press Start 2P", monospace;
  font-size: 0.72rem;
  line-height: 1.7;
  border-bottom: 2px dashed var(--taupe);
}

.menu-frame a:hover { color: var(--magenta); }

.title-screen { align-items: center; justify-content: flex-start; }
.hero-cluster { width: min(960px, 100%); position: relative; z-index: 2; }
.title-row { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }

.boot-line {
  max-width: 640px;
  margin: 24px 0 40px;
  color: var(--cream);
  font-size: clamp(1rem, 1.15vw, 1.25rem);
  line-height: 1.72;
  letter-spacing: 0.01em;
}

.press-start, .email {
  display: inline-block;
  position: relative;
  overflow: hidden;
  color: var(--magenta);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.625rem, 0.9vw, 0.875rem);
  text-decoration: none;
  padding: 16px 24px;
  border: 2px solid var(--magenta);
  background: rgba(26,26,26,0.62);
  animation: blink 1.5s steps(1) infinite;
}

.pulse-link::after, .project-card::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,0.72), rgba(233,30,140,0.28) 45%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.pulse-link:hover::after, .project-card:hover::after { animation: sonar 0.6s steps(8); }

.hero-candle { width: 64px; height: 104px; position: relative; image-rendering: pixelated; filter: drop-shadow(0 0 32px rgba(245,166,35,0.5)); }
.hero-candle::before { content: ""; position: absolute; inset: -64px; background: radial-gradient(circle, rgba(245,166,35,0.15), rgba(233,30,140,0.05) 42%, transparent 68%); animation: candleGlow 3s steps(6) infinite; }
.flame { position: absolute; left: 22px; top: 0; width: 20px; height: 32px; background: var(--amber); clip-path: polygon(50% 0, 80% 32%, 70% 100%, 28% 100%, 18% 32%); animation: flameFlicker 0.8s steps(1) infinite; }
.wick { position: absolute; left: 30px; top: 29px; width: 4px; height: 10px; background: var(--charcoal); }
.wax { position: absolute; left: 14px; top: 38px; width: 36px; height: 56px; background: var(--cream); box-shadow: inset -8px 0 0 #D4842A, 8px 0 0 rgba(0,0,0,0.18); }
.base { position: absolute; left: 6px; bottom: 0; width: 52px; height: 12px; background: var(--taupe); }

.crt-card {
  position: absolute;
  right: 8vw;
  bottom: 12vh;
  width: 256px;
  padding: 24px;
  border: 4px solid var(--charcoal);
  background: rgba(26,26,26,0.78);
  box-shadow: 8px 8px 0 var(--burgundy), inset 0 0 32px rgba(245,166,35,0.12);
  font-family: "Press Start 2P", monospace;
  color: var(--taupe);
  line-height: 2;
}
.crt-card strong { display: block; color: var(--amber); margin-top: 16px; }

.ambient { position: absolute; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(245,166,35,0.12), transparent 68%); animation: breathe 5s steps(8) infinite alternate; }
.glow-one { left: 8%; top: 12%; }
.glow-two { right: 12%; top: 24%; animation-duration: 6s; }
.glow-three { right: 18%; bottom: 12%; animation-duration: 4s; }

.manifesto { align-items: center; }
.manifesto-copy { max-width: 720px; margin-left: 15%; }
.reveal-lines p {
  font-size: clamp(1rem, 1.15vw, 1.25rem);
  line-height: 1.72;
  letter-spacing: 0.01em;
  color: var(--cream);
  opacity: 0;
  transform: translateY(-32px);
}
.level-active .reveal-lines p { animation: lineDrop 0.42s steps(5) forwards; }
.level-active .reveal-lines p:nth-child(1) { animation-delay: 0.10s; }
.level-active .reveal-lines p:nth-child(2) { animation-delay: 0.22s; }
.level-active .reveal-lines p:nth-child(3) { animation-delay: 0.34s; }
.level-active .reveal-lines p:nth-child(4) { animation-delay: 0.46s; }

.work { display: block; }
.section-head { position: relative; z-index: 2; max-width: 920px; }
.work-head { margin-left: 4%; margin-bottom: 40px; }
.project-grid {
  position: relative;
  z-index: 2;
  width: min(980px, 68vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 24px;
  margin-left: 4%;
}

.project-card {
  min-height: 224px;
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 2px solid var(--taupe);
  background:
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(107,66,38,0.08) 2px, rgba(107,66,38,0.08) 4px),
    #6B4226;
  box-shadow: 4px 4px 0 #5C1A1A, inset 0 0 32px rgba(0,0,0,0.26);
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
  transition: transform 0.18s steps(3), border-color 0.18s steps(3);
}
.project-card:hover { transform: translate(-4px, -4px); border-color: var(--amber); }
.project-card span { font-family: "Press Start 2P", monospace; color: var(--magenta); font-size: 0.7rem; }
.project-card h3 { font-family: "Silkscreen", monospace; letter-spacing: 0.08em; color: var(--amber); font-size: 1.35rem; }
.project-card p { color: var(--cream); line-height: 1.72; }

.process { display: block; }
.process-head { margin-left: 8%; margin-bottom: 40px; }
.timeline { position: relative; min-height: 680px; max-width: 1040px; margin: 0 auto; padding: 24px 0 64px; }
.candle-spine { position: absolute; top: 0; left: 50%; width: 48px; height: 100%; transform: translateX(-50%); }
.spine-flame { position: sticky; top: 96px; margin: 0 auto; width: 24px; height: 40px; background: var(--amber); clip-path: polygon(50% 0, 86% 35%, 72% 100%, 28% 100%, 14% 35%); animation: flameFlicker 0.8s steps(1) infinite; filter: drop-shadow(0 0 18px rgba(245,166,35,0.55)); }
.spine-wax { position: absolute; top: 36px; left: 12px; width: 24px; height: calc(100% - 36px); background: var(--cream); box-shadow: inset -6px 0 0 #D4842A; }
.wax-drip { position: absolute; top: 64px; width: 8px; height: 28px; background: #F0E6D3; border-radius: 0 0 2px 2px; animation: drip 4s steps(8) infinite; }
.process-step {
  position: relative;
  width: calc(50% - 64px);
  margin-bottom: 48px;
  padding: 24px;
  background: var(--leather);
  border: 2px solid var(--taupe);
  box-shadow: 6px 6px 0 var(--burgundy), inset 0 0 32px rgba(0,0,0,0.32);
}
.process-step.left { margin-right: auto; }
.process-step.right { margin-left: auto; }
.process-step .chain { position: absolute; top: 28px; width: 64px; height: 8px; background: repeating-linear-gradient(90deg, #8B7D6B 0 8px, transparent 8px 16px); }
.process-step.left .chain { right: -64px; }
.process-step.right .chain { left: -64px; }
.process-step p { margin: 0 0 16px; font-family: "Press Start 2P", monospace; color: var(--magenta); font-size: 0.68rem; line-height: 1.8; }
.process-step h3 { margin: 0 0 12px; font-family: "Silkscreen", monospace; color: var(--amber); letter-spacing: 0.08em; font-size: 1.6rem; }
.process-step span { line-height: 1.72; color: var(--cream); }

.contact { align-items: center; justify-content: center; text-align: left; }
.credits-block { width: min(960px, 100%); }
.contact .headline { max-width: 900px; }
.email { margin-top: 40px; animation: none; }
.socials { display: flex; gap: 24px; margin-top: 32px; }
.sprite { width: 48px; height: 48px; position: relative; border: 2px solid var(--taupe); background: var(--black); box-shadow: 4px 4px 0 var(--burgundy); image-rendering: pixelated; }
.sprite::before { content: ""; position: absolute; inset: 12px; background: var(--amber); }
.sprite-mail::before { clip-path: polygon(0 0, 100% 0, 100% 75%, 0 75%, 0 0, 50% 45%, 100% 0, 50% 45%, 0 0); }
.sprite-bird::before { background: var(--magenta); clip-path: polygon(0 42%, 20% 42%, 20% 28%, 48% 28%, 48% 14%, 78% 14%, 70% 32%, 100% 32%, 76% 52%, 76% 76%, 48% 76%, 48% 62%, 20% 62%, 20% 52%, 0 52%); }
.sprite-grid::before { background: repeating-linear-gradient(90deg, var(--amber) 0 6px, transparent 6px 10px), repeating-linear-gradient(0deg, var(--magenta) 0 6px, transparent 6px 10px); }

@keyframes assemble { to { opacity: 1; transform: translate(0,0); } }
@keyframes lineDrop { to { opacity: 1; transform: translateY(0); } }
@keyframes loadLevel { to { width: 100%; } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.25; } }
@keyframes sonar { from { transform: scale(0); opacity: 0.6; } to { transform: scale(2.5); opacity: 0; } }
@keyframes borderPulse { 50% { box-shadow: 0 0 32px rgba(245,166,35,0.32); } }
@keyframes breathe { to { transform: translateY(6px); opacity: 0.62; } }
@keyframes candleGlow { 50% { opacity: 0.55; transform: scale(1.08); } }
@keyframes flameFlicker { 0% { background: #F5A623; transform: translateX(0) scaleY(1); } 25% { background: #D4842A; transform: translateX(-3px) scaleY(0.86); } 50% { background: #E91E8C; transform: translateX(3px) scaleY(1.08); } 75% { background: #F5A623; transform: translateX(0) scaleY(0.92); } }
@keyframes drip { from { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(160px); opacity: 0; } }

@media (max-width: 860px) {
  .level { padding: 88px 24px; }
  .manifesto-copy { margin-left: 0; }
  .project-grid { width: 100%; grid-template-columns: 1fr; margin-left: 0; }
  .crt-card { display: none; }
  .candle-spine { left: 24px; }
  .process-step, .process-step.left, .process-step.right { width: calc(100% - 64px); margin-left: 64px; margin-right: 0; }
  .process-step.left .chain, .process-step.right .chain { left: -64px; right: auto; }
}
