/* Press Enter — design system: "Airmail Tower".
   The web is a building and every layer wraps the message in an envelope. So the materials are postal
   (paper, stamps, postmarks, airmail stripes) and the structure is architectural (floors, a lift, a
   stairwell number on every wall). Every layer of the stack owns a colour, and that colour always means
   that layer: a packet in an Ethernet frame is amber outside and green inside, everywhere. */
:root {
  /* paper & ink */
  --bg: #f0ebe1;       /* the desk: warm manila */
  --bg-2: #e8e2d6;
  --card: #fdfbf7;     /* letter paper */
  --ink: #15171d;
  --ink-2: #47464d;
  --ink-3: #8a857a;
  --line: #d6cfc2;
  /* one colour per floor — the colour always means that layer */
  --f0: #15171d;
  --f1: #d9772b; /* signals: copper */
  --f2: #e0a613; /* ethernet: amber */
  --f3: #23a064; /* ip: green */
  --f4: #2f6fe0; /* tcp: blue */
  --f5: #0f9fb2; /* dns: teal */
  --f6: #7a4dd8; /* tls: violet */
  --f7: #e4572e; /* http: vermilion */
  --f8: #d6408a; /* browser: magenta */
  --f9: #3b4061; /* server: indigo slate */
  --f10: #cc0033; /* rails: ruby */
  --f11: #15171d;
  /* status — never a layer colour. Always paired with a shape (✗ ✓, strike, wavy underline). */
  --danger: #b3261e;   /* brick: darker and browner than HTTP vermilion and Rails ruby */
  --ok: #3d7a36;       /* olive: yellower and darker than IP green */
  --accent: var(--ink);
  --display: 'Bricolage Grotesque', 'Helvetica Neue', sans-serif;
  --body: 'Newsreader', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --bar-h: 64px;
  --radius: 14px;
  --spectrum: linear-gradient(90deg, var(--f1) 0 10%, var(--f2) 0 20%, var(--f3) 0 30%, var(--f4) 0 40%, var(--f5) 0 50%, var(--f6) 0 60%, var(--f7) 0 70%, var(--f8) 0 80%, var(--f9) 0 90%, var(--f10) 0);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .22  0 0 0 0 .1  0 0 0 .16 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.floor-0, .f0 { --accent: var(--f0); }
.floor-1, .f1 { --accent: var(--f1); }
.floor-2, .f2 { --accent: var(--f2); }
.floor-3, .f3 { --accent: var(--f3); }
.floor-4, .f4 { --accent: var(--f4); }
.floor-5, .f5 { --accent: var(--f5); }
.floor-6, .f6 { --accent: var(--f6); }
.floor-7, .f7 { --accent: var(--f7); }
.floor-8, .f8 { --accent: var(--f8); }
.floor-9, .f9 { --accent: var(--f9); }
.floor-10, .f10 { --accent: var(--f10); }
.floor-11, .f11 { --accent: var(--f11); }
.floor-2, .f2 { --accent-dark: #9a6b00; } /* amber is too light for small text on paper */
.danger-text { color: var(--danger); } .ok-text { color: var(--ok); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  /* every floor's walls are painted a whisper of its colour */
  --wall: var(--bg);
  background: color-mix(in srgb, var(--bg) 93%, var(--wall));
  transition: background-color .7s ease;
  color: var(--ink);
  font-family: var(--body);
  font-size: 21px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before { /* paper grain + a faint drafting grid */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    var(--grain),
    linear-gradient(to right, rgba(60,45,20,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(60,45,20,.035) 1px, transparent 1px);
  background-size: 220px 220px, 32px 32px, 32px 32px;
  opacity: .9;
}
/* the stairwell number: every floor has its number painted huge on the wall */
#floor-mark {
  position: fixed; left: 16px; bottom: calc(var(--bar-h) - .13em); z-index: 0; pointer-events: none;
  font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: min(62vh, 560px); line-height: .8;
  letter-spacing: -0.06em; color: color-mix(in srgb, var(--accent) 7%, transparent); user-select: none;
}
#floor-mark.lift-up { animation: markUp .7s cubic-bezier(.2,.8,.2,1); }
#floor-mark.lift-down { animation: markDown .7s cubic-bezier(.2,.8,.2,1); }
@keyframes markUp { from { transform: translateY(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes markDown { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
button { font: inherit; color: inherit; }
kbd { font-family: var(--mono); font-size: .72em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--card); }

/* ---------- viewport & slides */
#viewport { position: fixed; inset: 0 0 var(--bar-h) 0; overflow: hidden; z-index: 1; }
.slide {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 56px;
  transition: opacity .3s ease, transform .38s cubic-bezier(.2,.75,.25,1);
}
.slide.entering { opacity: 0; }
/* within a deck: turn the page */
.slide.entering.from-right { transform: translateX(28px); }
.slide.entering.from-left { transform: translateX(-28px); }
.slide.leaving { opacity: 0; pointer-events: none; }
.slide.leaving.to-left { transform: translateX(-28px); }
.slide.leaving.to-right { transform: translateX(28px); }
/* between floors: the lift. Going up, the new floor arrives from above and the old one sinks away. */
.slide.entering.from-above { transform: translateY(-56px); }
.slide.entering.from-below { transform: translateY(56px); }
.slide.leaving.to-below { transform: translateY(56px); }
.slide.leaving.to-above { transform: translateY(-56px); }
/* same floor, another room: step through a door */
.slide.entering.through-door { transform: scale(.965); }
.slide.leaving.door-out { transform: scale(1.025); }
.slide-inner { width: 100%; max-width: 1180px; margin: auto; }

.layout-center .slide-inner { text-align: center; max-width: 900px; }
.layout-center .slide-inner p { margin-left: auto; margin-right: auto; }
.layout-text .slide-inner { max-width: 720px; }
.layout-wide .slide-inner { max-width: 1240px; }
.layout-split .slide-inner { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 56px; align-items: center; }
.layout-split.flip .slide-inner { grid-template-columns: 7fr minmax(300px, 5fr); }

/* ---------- type */
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 .45em; }
h1 { font-size: clamp(44px, 6vw, 84px); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(32px, 3.6vw, 50px); }
h3 { font-size: 26px; }
p { margin: 0 0 .8em; max-width: 36em; }
.lede { font-size: 1.22em; line-height: 1.42; }
.small { font-size: .82em; color: var(--ink-2); }
.muted { color: var(--ink-3); }
/* kickers read like the label on a parcel: condensed, tracked, in the floor's ink */
.kicker {
  font-family: var(--display); font-stretch: 75%; font-size: 14.5px; line-height: 1.3; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-dark, color-mix(in oklab, var(--accent) 80%, #000)); margin-bottom: 12px; font-weight: 700;
}
em.hl, .hl { font-style: normal; background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 28%, transparent) 58%); padding: 0 .1em; }
b, strong { font-weight: 650; }
code, .mono { font-family: var(--mono); font-size: .82em; }
p code, li code { background: var(--bg-2); padding: .08em .35em; border-radius: 5px; }
.c1 { color: var(--f1); } .c2 { color: var(--f2); } .c3 { color: var(--f3); } .c4 { color: var(--f4); }
.c5 { color: var(--f5); } .c6 { color: var(--f6); } .c7 { color: var(--f7); } .c8 { color: var(--f8); }
.c9 { color: var(--f9); } .c10 { color: var(--f10); }
ul.clean { list-style: none; padding: 0; margin: 0 0 1em; }
ul.clean li { margin: .35em 0; padding-left: 1.2em; position: relative; }
ul.clean li::before { content: ''; position: absolute; left: 0; top: .62em; width: .45em; height: .45em; border-radius: 2px; background: var(--accent); }

/* ---------- the postage stamp: a floor number with perforated edges (bar, map, doors, finale) */
.where-floor, .stamp {
  width: 32px; height: 38px; flex: none; display: grid; place-items: center; padding: 3px;
  font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 19px; color: #fff; line-height: 1;
  background: var(--accent);
  -webkit-mask: radial-gradient(circle at 3px 3px, #0000 1.6px, #000 1.9px) -3px -3px / 6px 6px, linear-gradient(#000 0 0) content-box;
  mask: radial-gradient(circle at 3px 3px, #0000 1.6px, #000 1.9px) -3px -3px / 6px 6px, linear-gradient(#000 0 0) content-box;
}
.where-floor.f0, .where-floor.f11 { background: var(--spectrum); background-size: 100% 100%; text-shadow: 0 0 3px rgba(0,0,0,.55); }

/* ---------- inline jumps & doors (forks) */
.jump {
  color: inherit; text-decoration: none; cursor: pointer;
  border-bottom: 2px solid color-mix(in srgb, var(--jc, var(--accent)) 70%, transparent); padding-bottom: 1px;
}
.jump::after { content: '\00a0↗'; font-family: var(--mono); font-size: .7em; color: var(--jc, var(--accent)); }
.jump:hover { background: color-mix(in srgb, var(--jc, var(--accent)) 12%, transparent); }

/* a door is an envelope: paper, a stamp for the floor it leads to, a postmark once you've been */
.doors { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 28px; }
.layout-center .doors { justify-content: center; }
.door {
  position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  background: var(--card); border: 2px solid var(--ink); border-radius: 6px;
  padding: 16px 20px 16px; width: 270px; box-shadow: 4px 4px 0 var(--dc, var(--accent));
  transition: transform .18s, box-shadow .18s; text-decoration: none; color: inherit;
}
.door:hover { transform: translate(-2px, -3px) rotate(-.6deg); box-shadow: 6px 7px 0 var(--dc, var(--accent)); }
.door .door-k { font-family: var(--display); font-stretch: 75%; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--dc, var(--accent)); font-weight: 800; padding-right: 30px; line-height: 1.2; }
.door .door-t { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.15; }
.door .door-s { font-size: 16px; color: var(--ink-2); line-height: 1.35; }
.door .door-stamp { position: absolute; top: 9px; right: 10px; width: 24px; height: 29px; font-size: 14px; background: var(--dc, var(--accent)); }
.door.main {
  background: repeating-linear-gradient(-45deg, var(--dc, var(--accent)) 0 9px, var(--card) 9px 15px, var(--ink) 15px 24px, var(--card) 24px 30px) top / 100% 6px no-repeat, var(--ink);
  color: #fff; padding-top: 20px;
}
.door.main .door-s { color: #c9ccd4; }
.door.main .door-stamp { top: 14px; }
/* postmark: a cancelled stamp means you've been through this door */
.door.seen::before {
  content: 'SEEN'; position: absolute; top: 4px; right: 22px; width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid currentColor; display: grid; place-items: center; transform: rotate(-14deg);
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; color: var(--ink-2); opacity: .75;
  background: repeating-linear-gradient(0deg, transparent 0 7px, color-mix(in srgb, currentColor 35%, transparent) 7px 8px) 50% 50% / 80px 26px no-repeat;
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px color-mix(in srgb, currentColor 40%, transparent);
  pointer-events: none; z-index: 1;
}
.door.main.seen::before { color: #c9ccd4; top: 9px; }

/* ---------- controls: things you press are keys */
.btn {
  font-family: var(--display); font-weight: 650; font-size: 18px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  padding: 10px 20px; border-radius: 12px; box-shadow: 0 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s, background .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--ink); }
.btn.small { font-size: 15px; padding: 6px 14px; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }
.btn.small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: 0 4px 0 var(--ink); }
.btn.on { background: var(--ink); color: #fff; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.layout-center .row { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.slider { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font-family: var(--mono); font-size: 14px; }
.slider label { color: var(--ink-2); }
.slider output { min-width: 5ch; text-align: right; font-weight: 700; color: var(--accent-dark, color-mix(in oklab, var(--accent) 80%, #000)); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: var(--line); border-radius: 3px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); cursor: grab; box-shadow: 0 3px 0 var(--accent); }
input[type=text], textarea, select {
  font-family: var(--mono); font-size: 16px; border: 2px solid var(--ink); border-radius: 10px;
  padding: 8px 12px; background: var(--card); color: var(--ink); outline: none;
}
input[type=text]:focus, textarea:focus { box-shadow: 3px 3px 0 var(--accent); }

/* ---------- surfaces: things you read are printed (offset shadow in the floor's ink) */
.stage {
  position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--accent) 85%, #000);
  overflow: hidden;
}
.stage svg { display: block; width: 100%; height: 100%; }
/* instruments glow: oscilloscopes and terminals are the only dark things in the building */
.stage.scope { background: #15171d; }
.stage.scope::after, .term::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.028) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0,0,0,.28));
}
.stage-caption { font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-top: 12px; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.note {
  font-size: 17px; color: var(--ink-2); border-left: 4px solid var(--accent); padding: 6px 0 6px 16px; margin: 18px 0;
}
.honest { font-size: 16px; color: var(--ink-2); font-style: italic; }
/* the customs label: an honest note about where the model cuts a corner */
.honest::before {
  content: 'Simplified'; display: inline-block; font-style: normal; font-family: var(--display); font-stretch: 75%; font-weight: 800;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
  border: 1.5px solid currentColor; border-radius: 3px; padding: 0 5px; margin-right: 8px; line-height: 13px;
  transform: rotate(-2deg); vertical-align: 1px;
}

/* terminal / raw protocol text */
.term {
  position: relative;
  font-family: var(--mono); font-size: 15px; line-height: 1.6; text-align: left;
  background: #15171d; color: #e8eaef; border-radius: 12px; padding: 18px 22px; white-space: pre-wrap; word-break: break-word;
  box-shadow: 6px 6px 0 var(--accent);
  text-shadow: 0 0 8px rgba(232,234,239,.18);
}
.term .t-dim { color: #7c8394; }
.term .t-a { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.term .t-y { color: #f2c14e; } .term .t-g { color: #6ed39a; } .term .t-b { color: #7fb0ff; } .term .t-r { color: #ff8a70; } .term .t-p { color: #c8a6ff; }

/* encapsulation: nested envelopes, coloured by layer */
.env { display: inline-flex; align-items: stretch; border-radius: 10px; font-family: var(--mono); font-size: 13px; }
.env > .env-h { padding: 6px 8px; color: #fff; font-weight: 700; display: flex; align-items: center; writing-mode: horizontal-tb; }
.env > .env-b { padding: 5px; display: flex; align-items: center; background: color-mix(in srgb, var(--ec) 16%, #fff); }
.env { background: var(--ec); border: 2px solid var(--ec); }
.env.payload { background: var(--card); border: 2px dashed var(--ink-3); padding: 6px 10px; color: var(--ink); font-weight: 600; }

/* packet token used in many playables */
.pkt {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: #fff; background: var(--accent); border: 2px solid var(--ink);
}

/* reveal after meaningful action */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.reveal.shown { opacity: 1; transform: none; pointer-events: auto; }

/* two-choice predictions: betting slips */
.bets { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.layout-center .bets { justify-content: center; }
.bet { cursor: pointer; border: 2px solid var(--ink); background: var(--card); border-radius: 10px; padding: 10px 16px; font-family: var(--display); font-weight: 600; font-size: 18px; box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.bet:hover { background: var(--bg-2); }
.bet:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.bet.right { background: var(--ink); color: #fff; }
.bet.wrong { background: var(--ink-3); color: #fff; text-decoration: line-through; }
.bet.picked { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- bottom bar: the lift panel */
#bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar-h); z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 18px; background: var(--ink); color: #fff;
  --hi: var(--accent);
}
#bar::before { /* airmail stripe in the floor's colour */
  content: ''; position: absolute; left: 0; right: 0; top: -5px; height: 5px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, var(--card) 12px 18px, var(--ink) 18px 30px, var(--card) 30px 36px);
  transition: background .5s;
}
body[data-floor="0"] #bar, body[data-floor="11"] #bar { --hi: #fff; }
body[data-floor="0"] #bar::before, body[data-floor="11"] #bar::before { background: var(--spectrum); background-size: 50vw 100%; }
.bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bar-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.where { display: flex; align-items: center; gap: 12px; min-width: 0; }
.where-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.where-text b { font-family: var(--display); font-size: 16px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where-text em { font-style: normal; font-family: var(--display); font-stretch: 75%; font-weight: 700; font-size: 12px; color: #9aa0ad; letter-spacing: .14em; text-transform: uppercase; }
.bar-back { background: transparent; border: 1.5px solid #4a4f5c; color: #d8dbe2; border-radius: 10px; padding: 5px 12px; font-family: var(--display); font-size: 14px; cursor: pointer; white-space: nowrap; }
.bar-back b { font-weight: 650; color: #fff; }
.bar-back:hover { border-color: #fff; }
.dots { display: flex; gap: 7px; align-items: center; }
.dot { width: 14px; height: 14px; border-radius: 4px; border: 2px solid #5a5f6c; background: transparent; cursor: pointer; padding: 0; transition: transform .15s, width .25s, background .2s; }
.dot.seen { border-color: color-mix(in srgb, var(--hi) 55%, #c9ccd4); background: color-mix(in srgb, var(--hi) 35%, #2a2d36); }
.dot.on { background: var(--hi); border-color: #fff; width: 30px; }
.dot:disabled { cursor: default; opacity: .45; }
.dot:not(:disabled):hover { transform: scale(1.2); }
.nav-btn { width: 44px; height: 38px; border-radius: 10px; border: 1.5px solid #4a4f5c; background: #23252d; color: #fff; font-size: 18px; cursor: pointer; font-family: var(--display); font-weight: 650; box-shadow: 0 3px 0 #000; transition: transform .08s, box-shadow .08s; margin-bottom: 3px; }
.nav-btn:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.nav-btn.wide { width: auto; padding: 0 16px; font-size: 15px; white-space: nowrap; }
.nav-btn.primary { background: var(--card); color: var(--ink); border-color: #fff; box-shadow: 0 3px 0 var(--hi); }
.nav-btn:disabled { opacity: .3; cursor: default; box-shadow: none; }
.nav-btn.locked { background: transparent; color: #6c7280; border-color: #3a3e49; border-style: dashed; box-shadow: none; }
.nav-btn.juice { animation: juice .6s ease; }
@keyframes juice { 0% { transform: scale(1); } 30% { transform: scale(1.18); box-shadow: 0 0 0 6px color-mix(in srgb, var(--hi) 45%, transparent); } 100% { transform: scale(1); } }
.gate-hint { font-family: var(--mono); font-size: 12px; color: #9aa0ad; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; line-height: 1.3; }
.gate-hint::before { content: '🔒\00a0'; font-size: 10px; filter: grayscale(1) brightness(1.6); }
.gate-hint:empty::before { content: none; }
.gate-hint.nudge { animation: nudge .45s ease; color: #fff; }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.map-btn { white-space: nowrap; background: transparent; border: 1.5px solid #4a4f5c; color: #fff; border-radius: 10px; height: 44px; padding: 0 12px 0 8px; cursor: pointer; font-family: var(--display); font-size: 15px; display: inline-flex; align-items: center; gap: 9px; }
.map-btn kbd, .map-close kbd { background: transparent; color: inherit; border-color: #6c7280; }
.map-btn:hover { border-color: #fff; }
/* the lift indicator: twelve floors, yours lit */
.lift { display: flex; flex-direction: column-reverse; gap: 1px; width: 12px; }
.lift i { display: block; height: 2px; border-radius: 1px; background: #4a4f5c; transition: background .3s; }
.lift i.on { background: var(--hi); box-shadow: 0 0 4px var(--hi); height: 2px; }

/* ---------- map: the building in cross-section */
.map { position: fixed; inset: 0; z-index: 10; background: rgba(21,23,29,.6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; }
.map[hidden] { display: none; }
.map-inner { position: relative; width: min(1340px, 100%); height: min(95vh, 1000px); background: var(--bg); border: 2px solid var(--ink); border-radius: 14px; display: grid; grid-template-columns: 1fr 290px; grid-template-rows: auto 1fr auto; column-gap: 26px; overflow: hidden; box-shadow: 10px 10px 0 var(--ink); }
.map-inner::before { content: ''; position: absolute; inset: 0; background-image: var(--grain); background-size: 220px; opacity: .7; pointer-events: none; }
.map-head { grid-column: 1 / -1; position: relative; display: flex; justify-content: space-between; align-items: flex-end; padding: 16px 26px 10px; }
.map-head h2 { margin: 0; font-size: 32px; }
.map-head .kicker { margin-bottom: 4px; }
.map-close { background: var(--ink); color: #fff; border: none; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-family: var(--display); box-shadow: 0 3px 0 #000; }
.map-body { display: contents; }
.bld-wrap { grid-column: 1; grid-row: 2 / 4; margin: 0 0 14px 26px; position: relative; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 4px 0 0; display: flex; flex-direction: column; }
.bld-roof { height: 34px; flex: none; position: relative; }
.bld-roof svg { position: absolute; left: 0; bottom: -2px; width: 100%; height: 38px; overflow: visible; }
.bld { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; border: 3px solid var(--ink); border-bottom: none; background: var(--card); margin: 0 24px 0 6px; }
.map-floor {
  position: relative; flex: 1 0 auto; min-height: 46px; display: grid; grid-template-columns: 100px 40px 190px 1fr; gap: 0;
  align-items: stretch; border-bottom: 3px solid var(--ink);
  background: color-mix(in srgb, var(--accent) 9%, var(--card));
}
.map-floor.f0, .map-floor.f11 { background: var(--card); }
.map-floor.f11 { background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(21,23,29,.07) 22px 24px), var(--card); }
.map-floor-label { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-right: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent); min-width: 0; }
.map-floor-label .where-floor { width: 26px; height: 31px; font-size: 15px; }
.map-floor-label b { display: block; font-family: var(--display); font-stretch: 75%; font-size: 14px; font-weight: 750; line-height: 1.05; }
.map-floor-label em { display: none; }
.map-shaft { position: relative; background:
  linear-gradient(90deg, transparent 8px, rgba(21,23,29,.5) 8px 9.5px, transparent 9.5px calc(100% - 9.5px), rgba(21,23,29,.5) calc(100% - 9.5px) calc(100% - 8px), transparent calc(100% - 8px)),
  color-mix(in srgb, var(--ink) 6%, var(--card));
  margin-bottom: -3px; z-index: 2; border-right: 1.5px solid rgba(21,23,29,.25); border-left: 1.5px solid rgba(21,23,29,.25); }
.map-spine, .map-branches { display: flex; gap: 7px; align-items: stretch; padding: 4px 7px; min-width: 0; }
.map-spine { border-right: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent); }
.map-node {
  position: relative; z-index: 1; background: var(--card); border: 2px solid var(--ink); border-radius: 5px; padding: 3px 7px 4px;
  flex: 1 1 0; min-width: 0; max-width: 190px; display: flex; flex-direction: column; justify-content: space-between; gap: 2px;
  box-shadow: 3px 3px 0 var(--accent); transition: transform .12s;
}
.map-node:hover, .map-node:focus-within { transform: translate(-1px, -1px); }
.map-branches .map-node.branch { border-style: dashed; box-shadow: none; background: color-mix(in srgb, var(--card) 80%, transparent); }
.map-node.unseen { border-color: color-mix(in srgb, var(--ink) 45%, transparent); box-shadow: none; }
.map-node.unseen .map-title { color: var(--ink-2); }
.map-node.here { outline: 3px solid var(--accent); outline-offset: 2px; }
.map-floor.f0 .map-node.here, .map-floor.f11 .map-node.here { outline-color: var(--ink); }
.map-title { background: none; border: none; padding: 0; text-align: left; font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 1.07; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.map-title:hover { color: var(--accent-dark, color-mix(in oklab, var(--accent) 80%, #000)); }
.map-blurb { display: none; }
/* each slide is a window; windows light up once you've been in the room */
.pips { display: flex; gap: 3px; flex-wrap: wrap; }
.pip { width: 9px; height: 8px; border-radius: 1.5px; border: 1.5px solid color-mix(in srgb, var(--ink) 40%, transparent); cursor: pointer; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.pip.seen { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 5px color-mix(in srgb, var(--accent) 60%, transparent); }
.map-floor.f0 .pip.seen, .map-floor.f11 .pip.seen { background: #f2c14e; border-color: #b08a1c; box-shadow: 0 0 5px #f2c14e; }
.pip.now { outline: 2px solid var(--ink); outline-offset: 1px; }
/* the lift car */
.lift-car {
  position: absolute; z-index: 3; left: 106px; width: 28px; top: 0; height: 40px; border: 2px solid var(--ink); border-radius: 4px;
  background: var(--accent); display: grid; place-items: center; color: #fff; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 14px;
  transition: top .9s cubic-bezier(.45,0,.2,1), background .4s; box-shadow: 0 0 0 3px var(--card);
}
.lift-car.f0, .lift-car.f11 { background: var(--spectrum); text-shadow: 0 0 3px #000; }
.lift-car::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 1.5px; height: 2000px; background: rgba(21,23,29,.55); }
.bld-ground { position: relative; flex: none; height: 46px; margin: 0; border-top: 4px solid var(--ink);
  background: repeating-linear-gradient(-45deg, rgba(21,23,29,.12) 0 1.5px, transparent 1.5px 9px); }
.bld-riser { position: absolute; left: 127px; top: -4px; width: 4px; height: 26px; background: var(--f1); }
.bld-riser::after { content: ''; position: absolute; left: 0; top: 22px; width: 3000px; height: 4px; background: var(--f1); }
.bld-cable { position: absolute; right: 30px; top: 25px; font-family: var(--mono); font-size: 11px; color: var(--accent-dark, color-mix(in oklab, var(--accent) 80%, #000)); color: #9a4f12; background: var(--bg); padding: 0 6px; }
.bld-antenna { right: auto; }
/* the lobby directory: a letter board */
.map-dir { grid-column: 2; grid-row: 2; margin-right: 26px; position: relative; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.dir-board {
  background: #1c1e25; color: #eceae4; border-radius: 10px; border: 2px solid var(--ink); padding: 16px 18px 18px; box-shadow: 5px 5px 0 var(--accent);
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0 2px, transparent 2px 6px);
}
.dir-k { font-family: var(--display); font-stretch: 75%; font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #9aa0ad; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.dir-k .where-floor { width: 26px; height: 31px; font-size: 15px; }
.dir-t { font-family: var(--display); font-weight: 750; font-size: 24px; line-height: 1.08; margin-bottom: 8px; letter-spacing: -.01em; }
.dir-b { font-size: 16px; line-height: 1.35; color: #c9ccd4; margin: 0 0 12px; }
.dir-w { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.dir-w i { width: 16px; height: 13px; border-radius: 2px; border: 1.5px solid #5a5f6c; }
.dir-w i.seen { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px var(--accent); }
.dir-board.f0 .dir-w i.seen, .dir-board.f11 .dir-w i.seen { background: #f2c14e; border-color: #f2c14e; box-shadow: 0 0 6px #f2c14e; }
.dir-s { font-family: var(--mono); font-size: 12px; color: #9aa0ad; margin-bottom: 14px; }
.dir-go { background: var(--card); color: var(--ink); border: 2px solid #fff; border-radius: 10px; padding: 7px 14px; font-family: var(--display); font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 3px 0 var(--accent); }
.dir-go:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent); }
.dir-total { font-family: var(--body); font-size: 16px; color: var(--ink-2); line-height: 1.35; }
.dir-total b { font-family: var(--display); font-size: 30px; color: var(--ink); display: block; letter-spacing: -.02em; line-height: 1; }
.map-foot { grid-column: 2; grid-row: 3; margin: 0 26px 16px 0; position: relative; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; padding-top: 10px; border-top: 1.5px dashed var(--ink-3); font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.lg { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; border: 1.5px solid var(--ink-3); }
.lg.seen { background: var(--ink-2); border-color: var(--ink-2); }
.lg.here { outline: 2px solid var(--ink); outline-offset: 1px; }
.lg.side { border-style: dashed; border-color: var(--ink-2); width: 18px; }
.map-reset { margin-top: 6px; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); cursor: pointer; }

/* ---------- misc helpers */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.center { text-align: center; }
.mt { margin-top: 24px; } .mt2 { margin-top: 40px; } .mb0 { margin-bottom: 0; }
.big-num { font-family: var(--display); font-weight: 800; font-size: 72px; letter-spacing: -0.04em; line-height: 1; color: var(--accent); }
.tag { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 700; letter-spacing: .03em; }
.fade-in { animation: fadein .5s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
.caret { display: inline-block; width: .55em; height: 1em; background: currentColor; vertical-align: -0.12em; animation: blink 1s steps(1) infinite; }
/* rubber-stamp postmark (start, finale) */
.postmark { display: inline-grid; place-items: center; text-align: center; width: 128px; height: 128px; border-radius: 50%; border: 3px solid currentColor; color: var(--danger);
  font-family: var(--display); font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; line-height: 1.05;
  box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 7px currentColor;
  --distress: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='d'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.2 1.75'/></filter><rect width='100%' height='100%' filter='url(%23d)'/></svg>");
  -webkit-mask: var(--distress); mask: var(--distress); -webkit-mask-size: 160px; mask-size: 160px; }
.postmark.stamped { animation: stampIn .42s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes stampIn { from { transform: scale(1.8) rotate(var(--r, -12deg)); opacity: 0; } to { transform: rotate(var(--r, -12deg)); opacity: .9; } }

@media (max-width: 1100px) {
  .layout-split .slide-inner, .layout-split.flip .slide-inner { grid-template-columns: 1fr; gap: 28px; }
  .slide { padding: 28px 28px; }
  .gate-hint { display: none; }
  .map-body { grid-template-columns: 1fr; } .map-dir { display: none; }
}

/* Code is code: never turn -> or != into ligature glyphs. */
code, pre, .mono, .term, kbd, input, textarea, select, [class*="mono"] { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
svg text { font-variant-ligatures: none; }

/* Short screens (e.g. 1280x720): tighten the frame, not the ideas. */
@media (max-height: 780px) {
  .slide { padding: 24px 48px; }
  body { font-size: 19px; }
  h2 { font-size: clamp(28px, 3.2vw, 42px); }
  .lede { font-size: 1.14em; }
  .map-head { padding: 10px 22px 6px; } .map-head h2 { font-size: 26px; }
  .map-floor { min-height: 36px; }
  .bld-roof { height: 26px; } .bld-ground { height: 32px; } .bld-cable { display: none; } .bld-riser { height: 22px; } .bld-riser::after { top: 18px; }
  .map-spine, .map-branches { padding: 3px 6px; }
  .map-title { font-size: 12.5px; -webkit-line-clamp: 1; }
  .dir-t { font-size: 20px; } .dir-b { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .slide, .reveal, .lift-car, #floor-mark { transition: none !important; animation: none !important; }
  .slide.entering, .slide.leaving { transform: none !important; }
}
