/* CLUB 411 — HQ. A vintage parallel-universe agency office.
   Mint institutional walls, manila memos, one dark CRT terminal. */

:root {
  --wall: #e4ede3;        /* severance mint wall */
  --paper: #f2ede0;       /* aged document */
  --manila: #ecdfc3;      /* memo card */
  --ink: #26302b;         /* institutional ink */
  --gray: #7c857e;
  --blue: #a9c6c9;        /* brand powder blue */
  --blue-deep: #6d979d;
  --red: #b5372a;         /* agency stamp red / the phone */
  --crt: #0c1a20;         /* terminal screen */
  --crt-glow: #8fd8cf;    /* terminal phosphor */
  --bezel: #d9d2bc;       /* monitor shell */
  --line: #c6d2c5;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--wall);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* faint paper grain over everything */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---------- the hallway gate ---------- */
body.gated { overflow: hidden; }
#gate {
  position: fixed; inset: 0; z-index: 100;
  background: #0d1110;
  cursor: pointer; outline: none;
  overflow: hidden;
}
#gate-bg {
  position: absolute; inset: 0;
  background: url("assets/hallway.jpg") center 40% / cover no-repeat;
  filter: brightness(.82) saturate(.85);
  will-change: transform;
}
#gate-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 40%, rgba(6,10,9,.75) 100%);
}
#gate-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* CRT pass: scanlines + jittering grain + slow flicker */
#gate .crt {
  position: absolute; inset: -60px; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.20) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  animation: crt-flicker 5s infinite;
}
#gate .crt::after {
  content: ""; position: absolute; inset: 0;
  opacity: .10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-jitter 0.9s steps(4) infinite;
}
@keyframes grain-jitter {
  0% { transform: translate(0,0); }
  25% { transform: translate(-40px,25px); }
  50% { transform: translate(30px,-35px); }
  75% { transform: translate(-25px,-20px); }
  100% { transform: translate(0,0); }
}
@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: .72; }
  94% { opacity: 1; }
  96.5% { opacity: .85; }
  97% { opacity: 1; }
}

/* boot readout */
#boot {
  position: absolute; bottom: 140px; left: 26px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 11px; line-height: 2;
  letter-spacing: .12em;
  color: #9fe8d8;
  text-shadow: 0 0 8px rgba(143,216,207,.6);
  pointer-events: none;
}
#boot div { animation: boot-in .12s steps(2) both; }
@keyframes boot-in { from { opacity: 0; } to { opacity: 1; } }

/* pixel transition canvas */
#pixelfx {
  position: fixed; inset: 0; z-index: 200;
  width: 100%; height: 100%;
  display: none; pointer-events: none;
}

/* ---------- the lair ---------- */
#lair-canvas {
  position: fixed; inset: 0; z-index: 50;
  width: 100%; height: 100%;
  display: none; cursor: grab;
  background: #090d0c;
}
body.in-lair #lair-canvas { background: transparent; }
#lair-css3d {
  position: fixed !important; inset: 0; z-index: 49;
  background: #090d0c;
  pointer-events: none;
}
body.in-lair.file-view #lair-css3d { visibility: hidden; }
#lair-hud { display: none; }
body.in-lair .wrap { display: none; }
body.in-lair.file-view .wrap { display: block; position: relative; z-index: 60; background: var(--wall); }
body.in-lair.file-view #lair-canvas, body.in-lair.file-view #lair-hud .hud-note { visibility: hidden; }
#lair-hud .hud-logo {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  width: min(150px, 34vw); z-index: 70; pointer-events: none;
}
#lair-hud .hud-bio {
  position: fixed; top: 118px; left: 0; right: 0; text-align: center;
  font-size: 9px; font-weight: 700; letter-spacing: .3em; color: #cfe3d6;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
  z-index: 70; pointer-events: none;
}
#lair-memo {
  position: fixed; bottom: 54px; left: 50%; transform: translateX(-50%);
  max-width: min(560px, 92vw);
  background: var(--manila); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 8px;
  padding: 12px 16px;
  font-size: 11px; letter-spacing: .06em; line-height: 1.7;
  z-index: 70;
}
#lair-memo b { color: var(--red); letter-spacing: .18em; }
#lair-memo a {
  color: var(--ink); font-weight: 700; letter-spacing: .14em;
  margin-left: 8px; white-space: nowrap;
}
#file-view {
  position: fixed; top: 20px; right: 22px; z-index: 70;
  background: none; border: 1px solid #cfe3d6; border-radius: 6px;
  color: #cfe3d6; font-family: var(--sans);
  font-size: 9px; font-weight: 700; letter-spacing: .24em;
  padding: 7px 12px; cursor: pointer;
}
#file-view:hover { background: #cfe3d6; color: #10241c; }
#lean-bar {
  display: none;
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%);
  gap: 10px; z-index: 75;
}
#lean-bar button, #lean-bar a {
  background: #10241c; color: #cfe3d6;
  border: 1px solid #cfe3d6; border-radius: 8px;
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; text-decoration: none;
  padding: 12px 18px; cursor: pointer;
}
#lean-bar button:hover, #lean-bar a:hover { background: #cfe3d6; color: #10241c; }
#follow-pop {
  display: none;
  position: fixed; inset: 0; z-index: 80;
  background: rgba(5, 9, 8, .55);
  align-items: center; justify-content: center;
}
#follow-pop .fp-card {
  background: var(--manila); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 10px;
  padding: 26px 30px 20px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 240px; text-align: center;
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
}
#follow-pop .fp-title { font-size: 20px; font-weight: 900; letter-spacing: .08em; }
#follow-pop .fp-sub { font-size: 11px; color: #6d6250; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
#follow-pop a {
  display: block; background: var(--ink); color: var(--wall);
  text-decoration: none; border-radius: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .22em;
  padding: 13px 0;
}
#follow-pop a:hover { background: var(--red); color: #fff; }
#follow-pop button {
  background: none; border: none; cursor: pointer;
  color: #6d6250; font-family: var(--sans);
  font-size: 9px; letter-spacing: .24em; text-transform: uppercase;
  margin-top: 4px;
}
/* laylo embed popup */
#laylo-pop {
  display: none;
  position: fixed; inset: 0; z-index: 85;
  background: rgba(5, 9, 8, .6);
  align-items: center; justify-content: center;
}
#laylo-pop .lp-card {
  background: var(--manila);
  border: 2px solid var(--ink); border-radius: 10px;
  width: min(420px, 92vw);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
}
#laylo-pop .lp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--ink);
  font-size: 10px; font-weight: 700; letter-spacing: .24em; color: var(--ink);
}
#laylo-pop .lp-head button { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--ink); }
#laylo-frame { width: 100%; height: min(420px, 55vh); border: 0; background: #0b0d0d; }
#laylo-pop .lp-done {
  display: block; text-align: center;
  background: var(--ink); color: var(--wall);
  text-decoration: none;
  font-size: 11px; font-weight: 700; letter-spacing: .24em;
  padding: 14px;
}
#laylo-pop .lp-done:hover { background: var(--red); color: #fff; }

/* lockbox pin pad */
#pin-pop {
  display: none;
  position: fixed; inset: 0; z-index: 85;
  background: rgba(5, 9, 8, .6);
  align-items: center; justify-content: center;
}
#pin-pop .pp-card {
  background: #5c6165; color: #e8ecef;
  border: 2px solid #23272b; border-radius: 12px;
  padding: 22px 26px 16px;
  width: 230px; text-align: center;
  box-shadow: 0 5px 0 rgba(0,0,0,.5);
}
.pp-title { font-size: 15px; font-weight: 900; letter-spacing: .2em; }
.pp-sub { font-size: 9px; letter-spacing: .3em; color: #b7bfc6; margin-top: 4px; }
#pp-display {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 24px; letter-spacing: .2em;
  background: #23272b; color: #9fe8d8;
  border-radius: 6px; padding: 8px 0; margin: 12px 0;
}
.pp-shake { animation: ppshake .4s; }
@keyframes ppshake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
#pp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
#pp-pad button {
  background: #464b50; color: #e8ecef;
  border: 1px solid #23272b; border-radius: 6px;
  font-family: var(--sans); font-size: 15px; font-weight: 700;
  padding: 10px 0; cursor: pointer;
}
#pp-pad button:hover { background: #9fe8d8; color: #23272b; }
#pp-close, #pp-close2 {
  background: none; border: none; cursor: pointer;
  color: #b7bfc6; font-family: var(--sans);
  font-size: 9px; letter-spacing: .24em; text-transform: uppercase;
  margin-top: 12px;
}
.pp-prize { font-size: 16px; font-weight: 900; letter-spacing: .06em; line-height: 1.5; margin-top: 12px; }
.pp-note { font-size: 11px; line-height: 1.7; color: #d7dde2; margin-top: 10px; }
.pp-ref { font-size: 8px; letter-spacing: .22em; color: #b7bfc6; margin-top: 12px; }

#lair-hud .hud-note {
  position: fixed; bottom: 22px; left: 0; right: 0; text-align: center;
  font-size: 9px; letter-spacing: .26em; color: #7e948a;
  z-index: 70; pointer-events: none;
}
.gate-logo {
  position: absolute; top: 34px; left: 50%; transform: translateX(-50%);
  width: min(190px, 44vw); pointer-events: none;
}
#gate-hint {
  position: absolute; bottom: 92px; left: 0; right: 0;
  text-align: center;
  color: var(--blue);
  font-size: 12px; font-weight: 700; letter-spacing: .34em;
  text-transform: uppercase;
  opacity: 0; transition: opacity .6s;
  pointer-events: none;
  animation: hintpulse 2.4s infinite;
}
#gate-hint.show { opacity: 1; }
@keyframes hintpulse { 50% { opacity: .35; } }
#gate-skip {
  position: absolute; top: 20px; right: 22px;
  background: none; border: none; cursor: pointer;
  color: #55605c; font-family: var(--sans);
  font-size: 10px; letter-spacing: .25em; text-transform: uppercase;
}
#gate-skip:hover { color: var(--blue); }
.ticker {
  position: absolute; bottom: 0; left: 0; right: 0;
  border-top: 1px solid #1d2422;
  background: #0d1211;
  overflow: hidden; white-space: nowrap;
  padding: 12px 0;
  pointer-events: none;
}
.ticker-inner {
  display: inline-block;
  color: var(--blue); font-size: 11px; font-weight: 700;
  letter-spacing: .28em; text-transform: uppercase;
  animation: tick 28s linear infinite;
}
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-33.333%); } }

/* ---------- HQ header plaque ---------- */
header { padding: 44px 0 6px; }
.plaque {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 2px 0 rgba(38,48,43,.25);
  padding: 22px 24px 18px;
  text-align: center;
  position: relative;
}
.plaque::before {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid rgba(38,48,43,.35);
  border-radius: 6px; pointer-events: none;
}
.plaque img.logo { width: min(230px, 56vw); display: block; margin: 0 auto; }
.plaque .tag {
  margin-top: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .3em;
  text-transform: uppercase;
}
.plaque .sub {
  margin-top: 7px; font-size: 9px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--gray);
}
.status {
  margin-top: 12px; text-align: center;
  font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gray);
}
.status .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue-deep); margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- section labels: file tabs ---------- */
.sec { padding: 34px 0 0; }
.sec > h2 {
  display: inline-block;
  background: var(--ink); color: var(--wall);
  font-size: 10px; font-weight: 700; letter-spacing: .3em;
  text-transform: uppercase;
  padding: 7px 14px 6px;
  border-radius: 6px 6px 0 0;
  margin: 0 0 0 10px;
}

/* ---------- the terminal (map) ---------- */
.terminal {
  background: var(--bezel);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 3px 0 rgba(38,48,43,.3);
}
.screen {
  position: relative;
  background:
    radial-gradient(ellipse 120% 90% at 50% 10%, #12262c 0%, var(--crt) 70%);
  border-radius: 10px;
  padding: 10px 10px 6px;
  overflow: hidden;
}
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  border-radius: 10px;
}
.screen svg { width: 100%; display: block; }
.screen .readout {
  display: flex; justify-content: space-between;
  padding: 4px 6px 6px;
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--crt-glow);
}
.map-card {
  margin-top: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  padding: 16px 18px;
  min-height: 78px;
}
.map-card .where {
  font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.map-card ul { list-style: none; margin-top: 8px; }
.map-card li {
  font-size: 13px; padding: 4px 0; line-height: 1.5;
  display: flex; justify-content: space-between; gap: 12px;
  border-bottom: 1px dotted var(--line);
}
.map-card li:last-child { border-bottom: none; }
.map-card li .when { color: var(--gray); white-space: nowrap; }
.map-card .hint { font-size: 12px; color: var(--gray); line-height: 1.6; }

/* ---------- interoffice memo (next) ---------- */
.next {
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--manila);
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(38,48,43,.25);
}
.next .memo-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 16px;
  border-bottom: 1.5px solid var(--ink);
  font-size: 9px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase;
}
.next .memo-head .urgent { color: var(--red); }
.next .memo-body { padding: 20px 18px 22px; }
.next .big {
  font-size: clamp(24px, 5.6vw, 34px);
  font-weight: 700; letter-spacing: -.01em; line-height: 1.08;
  text-transform: uppercase;
}
.next .sub { margin-top: 9px; font-size: 13px; color: #6d6250; line-height: 1.6; }
.btn {
  display: block; width: 100%;
  margin-top: 18px; padding: 16px;
  background: var(--ink); color: var(--wall);
  text-align: center; text-decoration: none;
  font-size: 12px; font-weight: 700; letter-spacing: .26em;
  text-transform: uppercase;
  border: none; border-radius: 8px; cursor: pointer;
}
.btn:active { transform: translateY(1px); }

/* ---------- building directory (links) ---------- */
.links {
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}
.links a {
  display: flex; align-items: baseline; gap: 14px;
  padding: 18px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.links a:last-child { border-bottom: none; }
.links .ext {
  font-size: 10px; font-weight: 700; letter-spacing: .18em;
  color: var(--red); white-space: nowrap;
}
.links .name {
  font-size: clamp(17px, 4.2vw, 22px); font-weight: 700;
  text-transform: uppercase; letter-spacing: .01em;
}
.links .leader {
  flex: 1; border-bottom: 2px dotted var(--line);
  transform: translateY(-4px);
}
.links .detail { font-size: 11px; color: var(--gray); letter-spacing: .06em; white-space: nowrap; }
.links a:hover { background: var(--blue); }
.links a:hover .detail, .links a:hover .ext { color: var(--ink); }

/* ---------- case files (log) ---------- */
.logcard {
  border: 1.5px solid var(--ink); border-radius: 10px;
  background: var(--paper); padding: 6px 18px;
}
.log li {
  list-style: none;
  display: grid; grid-template-columns: 1fr 150px 130px;
  align-items: baseline; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 13.5px;
}
.log li:last-child { border-bottom: none; }
.log .what { font-weight: 700; text-transform: uppercase; }
.log .where { color: var(--gray); font-size: 12px; }
.log .when { color: var(--gray); font-size: 12px; white-space: nowrap; text-align: right; }
@media (max-width: 540px) {
  .log li { grid-template-columns: 1fr 92px; }
  .log .where { display: none; }
  .links .detail { display: none; }
}

/* ---------- footer ---------- */
footer {
  margin-top: 52px; padding: 22px 0 58px;
  border-top: 2px solid var(--ink);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: var(--gray);
}
