/* ==========================================================================
   CONTAINMENT PROTOCOL — Escape Room Theme
   Design: bio-lab quarantine terminal. Condensed industrial display type
   paired with a monospace "readout" face for that case-file / lab-log feel.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root{
  --bg: #0a0d0b;
  --bg-grid: #0e1310;
  --panel: #121713;
  --panel-border: #232f26;
  --toxic: #8cff3d;
  --toxic-dim: #3f7a1f;
  --amber: #ffb703;
  --alarm: #ff3b3b;
  --text: #e7f1e9;
  --muted: #7f8f83;
  --font-display: 'Big Shoulders Display', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  min-height: 100%;
}

body{
  background-color: var(--bg);
  background-image: url('assets/lab-bg.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-mono);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(16px, 5vw, 48px) 16px 40px;
}

/* Faint scanline flicker — decorative only, killed for reduced motion */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0, transparent 2px, rgba(0,0,0,0.12) 3px
  );
  opacity: .35;
  z-index: 0;
}

@media (prefers-reduced-motion: no-preference){
  body::before{ animation: flicker 6s infinite steps(1); }
}
@keyframes flicker{
  0%, 92%, 100% { opacity: .28; }
  93% { opacity: .5; }
  94% { opacity: .18; }
}

/* Slow-drifting spores/ash for atmosphere — purely decorative */
body::after{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 15% 25%, rgba(140,255,61,0.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 15%, rgba(140,255,61,0.4), transparent 60%),
    radial-gradient(2px 2px at 85% 60%, rgba(140,255,61,0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 35% 75%, rgba(140,255,61,0.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 55% 45%, rgba(140,255,61,0.4), transparent 60%);
  background-repeat: repeat;
  background-size: 100% 100%;
}
@media (prefers-reduced-motion: no-preference){
  body::after{ animation: drift 22s linear infinite; }
}
@keyframes drift{
  0%   { background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px; }
  100% { background-position: 40px -220px, -30px -260px, 20px -200px, -25px -240px, 35px -260px; }
}

.wrap{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  background: rgba(8,12,10,0.62);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
  border: 1px solid rgba(140,255,61,0.12);
  border-radius: 10px;
  padding: clamp(20px, 4vw, 34px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ---------- Header / case-file eyebrow ---------- */
.log-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--panel-border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.log-header .status-dot{
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--toxic);
  box-shadow: 0 0 6px var(--toxic);
  margin-right: 6px;
  vertical-align: middle;
}
.log-header.alarm .status-dot{ background: var(--alarm); box-shadow: 0 0 8px var(--alarm); }

@media (prefers-reduced-motion: no-preference){
  .log-header .status-dot{ animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes pulse{ 50% { opacity: .35; } }

/* ---------- Containment meter (signature element) ---------- */
.meter{
  display: flex;
  gap: 6px;
  margin: 0 0 28px;
}
.meter span{
  flex: 1;
  height: 8px;
  background: var(--panel-border);
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}
.meter span.filled{ background: var(--toxic-dim); }
.meter span.current{ background: var(--toxic); box-shadow: 0 0 8px var(--toxic); }
.meter.breach span.filled,
.meter.breach span.current{ background: var(--alarm); box-shadow: 0 0 8px var(--alarm); }

/* ---------- Hazard stripe divider ---------- */
.stripe{
  height: 6px;
  width: 100%;
  border-radius: 2px;
  margin-bottom: 26px;
  background: repeating-linear-gradient(
    45deg, var(--amber), var(--amber) 10px, #1a1a1a 10px, #1a1a1a 20px
  );
  opacity: .85;
}

/* ---------- Headline ---------- */
h1.title{
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1;
  margin: 0 0 4px;
  color: var(--text);
  text-align: left;
}
.title .accent{ color: var(--toxic); }

p.eyebrow{
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Question terminal box ---------- */
.terminal{
  background: rgba(18,23,19,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--toxic);
  border-radius: 4px;
  padding: 18px 20px;
  margin-bottom: 26px;
  font-size: 1.05rem;
  line-height: 1.55;
}
.terminal::before{
  content: "> ";
  color: var(--toxic);
}

/* ---------- Answer options ---------- */
.options{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
.opt{
  display: flex;
  width: 100%;
  text-decoration: none;
}
.opt button{
  all: unset;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: rgba(18,23,19,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.opt button .tag{
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--toxic);
  font-size: 1.1rem;
  opacity: .85;
}
.opt button:hover,
.opt button:focus-visible{
  border-color: var(--toxic);
  background: #16211a;
  transform: translateX(3px);
}
.opt button:focus-visible{ outline: 2px solid var(--toxic); outline-offset: 2px; }
.opt button:active{ transform: translateX(1px) scale(0.995); }

/* ---------- Back / nav link ---------- */
.nav-row{
  margin-top: 30px;
  display: flex;
  justify-content: flex-start;
}
.back{
  all: unset;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  padding: 9px 16px;
  border-radius: 4px;
  transition: color .15s ease, border-color .15s ease;
}
.back:hover, .back:focus-visible{ color: var(--toxic); border-color: var(--toxic); outline: none; }
.back::before{ content: "\2190  "; }

/* ---------- Story / text page ---------- */
.story{
  background: rgba(18,23,19,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--toxic);
  border-radius: 4px;
  padding: 26px clamp(18px, 5vw, 34px);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 28px;
}
.story p{ margin: 0 0 1.1em; }
.story p:last-child{ margin-bottom: 0; }

.cta-row{ display: flex; justify-content: center; margin-top: 8px; }
.cta{
  all: unset;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 1.05rem;
  color: #06140a;
  background: var(--toxic);
  padding: 14px 30px;
  border-radius: 4px;
  transition: filter .15s ease, transform .1s ease;
  box-shadow: 0 0 22px rgba(140,255,61,0.25);
}
.cta:hover, .cta:focus-visible{ filter: brightness(1.12); }
.cta:active{ transform: scale(0.98); }

/* ---------- FALSCH page ---------- */
.alarm-box{
  background: #1a0d0d;
  border: 1px solid #3a1414;
  border-left: 3px solid var(--alarm);
  border-radius: 4px;
  padding: 30px 22px;
  text-align: center;
  margin-bottom: 26px;
}
.alarm-box h1{
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--alarm);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  margin: 0 0 10px;
  letter-spacing: .02em;
}
@media (prefers-reduced-motion: no-preference){
  .alarm-box h1{ animation: glitch 2.4s infinite; }
}
@keyframes glitch{
  0%, 94%, 100% { transform: translate(0,0); text-shadow: none; }
  95% { transform: translate(-1px, 1px); text-shadow: 2px 0 var(--toxic); }
  97% { transform: translate(1px, -1px); text-shadow: -2px 0 var(--alarm); }
}
.alarm-box p{ color: var(--muted); margin: 0; font-size: .92rem; }

/* ---------- CODE (final) page ---------- */
.code-stage{
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  text-align: center;
}
.code-stage h1{
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  margin: 0;
  line-height: 1.15;
}
footer.foot{
  margin-top: 34px;
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .6;
}
