@font-face { font-family: 'Instrument'; src: url('assets/InstrumentSerif-Regular.ttf'); font-style: normal; }
@font-face { font-family: 'Instrument'; src: url('assets/InstrumentSerif-Italic.ttf'); font-style: italic; }
@font-face { font-family: 'Mono'; src: url('assets/SpaceMono-Regular.ttf'); font-weight: 400; }
@font-face { font-family: 'Mono'; src: url('assets/SpaceMono-Bold.ttf'); font-weight: 700; }

:root {
  --phos: #a9fbb2;
  --phos-dim: rgba(169, 251, 178, .55);
  --gold: #ffc87a;
  --ink: #0a0a0b;
  --paper: #f0f0ee;
  --grey: #8a8a8c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--ink); }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: 'Mono', monospace;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
::selection { background: var(--phos); color: var(--ink); }

#spacer { height: 1300vh; }

/* ---------- ICARUS ---------- */
#sky {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 1; display: block;
}
#narration {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.line {
  position: absolute; width: min(88vw, 900px); text-align: center;
  font-family: 'Instrument', serif; font-style: italic;
  font-size: clamp(26px, 4.6vw, 58px); line-height: 1.25;
  color: #efe6d6; opacity: 0;
  text-shadow: 0 2px 30px rgba(0,0,0,.8);
}
.line.his { color: var(--gold); }
#flash {
  position: fixed; inset: 0; background: #fff8ec; z-index: 40;
  opacity: 0; pointer-events: none;
}
#risecap {
  position: fixed; left: 50%; bottom: 12vh; transform: translateX(-50%);
  z-index: 3; font-family: 'Instrument', serif; font-style: italic;
  font-size: clamp(22px, 3.4vw, 40px); color: #e8ddc8; opacity: 0;
  text-shadow: 0 2px 24px rgba(0,0,0,.9);
}

/* ---------- LOADER ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50; background: var(--ink);
  display: none; align-items: center; justify-content: center;
}
#loader.on { display: flex; }
#loader::after { /* scanlines */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.28) 3px 4px);
}
.loader-inner { width: min(520px, 80vw); }
.loader-logo {
  font-family: 'Instrument', serif; font-size: clamp(28px, 4vw, 44px);
  letter-spacing: .35em; text-align: center; color: var(--phos);
  text-shadow: 0 0 18px var(--phos-dim), 0 0 60px rgba(169,251,178,.25);
  margin-bottom: 26px;
}
.loader-bar { height: 18px; margin-bottom: 12px; }
#loader-blocks { display: flex; gap: 2px; height: 100%; }
#loader-blocks i {
  flex: 1; background: var(--phos); opacity: .08;
  box-shadow: 0 0 8px transparent;
}
#loader-blocks i.on { opacity: 1; box-shadow: 0 0 10px var(--phos-dim); }
.loader-status {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--phos); letter-spacing: .08em;
}
.loader-foot {
  position: absolute; bottom: 26px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 34px; flex-wrap: wrap;
  font-size: 10px; letter-spacing: .12em; color: #555;
}
.loader-foot b { color: var(--phos); font-weight: 400; }

/* ---------- HOME ---------- */
#home { position: fixed; inset: 0; z-index: 10; display: none;
  background: radial-gradient(ellipse 70% 60% at 50% 46%, #101013 0%, #0a0a0b 65%); }
#home.on { display: block; }

#stage {
  position: absolute; inset: 0;
  perspective: 1300px; perspective-origin: 50% 46%;
  transform-style: preserve-3d;
}

.cassette {
  position: absolute; left: 50%; top: 50%;
  width: 300px; height: 188px; margin: -94px 0 0 -150px;
  background: linear-gradient(160deg, #141414, #0b0b0c 70%);
  border: 1px solid #3f3f44; border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  transform-style: preserve-3d;
  cursor: none;
  transition: border-color .25s;
  will-change: transform, opacity;
}
.cassette:hover { border-color: var(--phos-dim); }
.cassette .window {
  position: absolute; left: 22px; right: 22px; top: 22px; height: 74px;
  background: #050505; border: 1px solid #262628; border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; overflow: hidden;
}
.reel {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid #d8d8d6; position: relative;
  animation: spin 5s linear infinite;
}
.reel::before, .reel::after {
  content: ''; position: absolute; left: 50%; top: 50%; background: #d8d8d6;
}
.reel::before { width: 2px; height: 38px; transform: translate(-50%,-50%); }
.reel::after { width: 38px; height: 2px; transform: translate(-50%,-50%); }
.reel i {
  position: absolute; left: 50%; top: 50%; width: 2px; height: 38px;
  background: #d8d8d6; transform: translate(-50%,-50%) rotate(60deg);
}
.reel i:last-child { transform: translate(-50%,-50%) rotate(-60deg); }
@keyframes spin { to { transform: rotate(360deg); } }
.window .tape {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: repeating-linear-gradient(90deg, #3a3a3c 0 6px, transparent 6px 12px);
}
.cassette .label {
  position: absolute; left: 22px; right: 22px; bottom: 16px;
  font-size: 11px; letter-spacing: .14em; color: #c9c9c7;
  display: flex; justify-content: space-between; align-items: baseline;
  text-transform: uppercase;
}
.cassette .label b { font-weight: 400; color: #fff; font-size: 14px; }
.cassette .strip {
  position: absolute; top: 8px; left: 22px; right: 22px;
  font-size: 8px; letter-spacing: .3em; color: #565658;
  display: flex; justify-content: space-between;
}
.cassette.hot { border-color: var(--phos); box-shadow: 0 0 40px rgba(169,251,178,.12); }

/* header */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 28px;
}
#brand { display: flex; align-items: center; height: 34px; }
#brand-logo { height: 26px; display: block; }
#brand-text { display: block; font-size: 15px; letter-spacing: .3em; color: var(--phos); }
#creative-link {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--paper); text-decoration: none;
  border: 1px solid #3a3a3c; padding: 10px 16px; border-radius: 999px;
  transition: border-color .25s, color .25s, background .25s;
  background: rgba(10,10,11,.4); backdrop-filter: blur(4px);
}
#creative-link:hover { border-color: var(--phos); color: var(--phos); }

/* HUD */
#hud-coords {
  position: absolute; z-index: 15; pointer-events: none;
  font-size: 10px; letter-spacing: .14em; color: var(--phos-dim);
  left: 0; top: 0; white-space: pre;
}
.hud-corner {
  position: absolute; bottom: 22px; z-index: 15;
  font-size: 10px; letter-spacing: .14em; color: #6a6a6c; line-height: 1.9;
}
#hud-left { left: 28px; }
#hud-right { right: 28px; text-align: right; }
#about-link { color: var(--phos); text-decoration: none; }
#about-link:hover { text-decoration: underline; }

/* rulers */
#home::before, #home::after {
  content: ''; position: absolute; z-index: 12; pointer-events: none; opacity: .5;
}
#home::before {
  top: 0; left: 0; right: 0; height: 14px;
  background: repeating-linear-gradient(90deg, #333 0 1px, transparent 1px 80px),
              repeating-linear-gradient(90deg, #222 0 1px, transparent 1px 16px);
}
#home::after {
  top: 0; left: 0; bottom: 0; width: 14px;
  background: repeating-linear-gradient(0deg, #333 0 1px, transparent 1px 80px),
              repeating-linear-gradient(0deg, #222 0 1px, transparent 1px 16px);
}

/* cursor */
#cursor, #cursor-ring { position: fixed; z-index: 60; pointer-events: none; }
#cursor {
  width: 6px; height: 6px; background: var(--phos); left: 0; top: 0;
  transform: translate(-50%, -50%);
}
#cursor::before, #cursor::after { content: ''; position: absolute; background: var(--phos); }
#cursor::before { left: 50%; top: -9px; width: 1px; height: 24px; transform: translateX(-.5px); }
#cursor::after { top: 50%; left: -9px; height: 1px; width: 24px; transform: translateY(-.5px); }
#cursor-ring {
  width: 34px; height: 34px; border: 1px dashed var(--phos-dim);
  left: 0; top: 0; transform: translate(-50%, -50%);
  transition: width .18s, height .18s;
}
body.has-cursor, body.has-cursor a, body.has-cursor .cassette { cursor: none; }

/* project panel */
#panel {
  position: absolute; z-index: 25; right: 28px; top: 50%;
  width: 320px; transform: translateY(-50%) translateX(24px);
  background: rgba(12,12,13,.92); border: 1px solid #2c2c2e;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
  backdrop-filter: blur(8px);
}
#panel.on { opacity: 1; pointer-events: auto; transform: translateY(-50%) translateX(0); }
#panel-num { font-size: 11px; color: var(--phos); letter-spacing: .3em; margin-bottom: 10px; }
#panel-name {
  font-family: 'Instrument', serif; font-weight: 400; font-size: 34px;
  color: var(--paper); margin-bottom: 10px; line-height: 1.05;
}
#panel-desc { font-size: 12px; color: #a9a9ab; line-height: 1.75; margin-bottom: 14px; }
#panel-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
#panel-stack span {
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid #333; color: #999; padding: 4px 8px; border-radius: 3px;
}
#panel-links { display: flex; gap: 16px; }
#panel-links a {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--phos); text-decoration: none;
}
#panel-links a:hover { text-decoration: underline; }
#panel-links a.off { color: #555; pointer-events: none; }

@media (max-width: 700px) {
  #cursor, #cursor-ring, #hud-coords, #home::before, #home::after { display: none; }
  .cassette { width: 240px; height: 150px; margin: -75px 0 0 -120px; }
  #panel { left: 16px; right: 16px; width: auto; top: auto; bottom: 90px; transform: none; }
  #panel.on { transform: none; }
  .hud-corner { font-size: 9px; }
}
