/* compact.zone — one door, every COMPACT address.

   Twilight Zone by way of a 1967 record sleeve: the suite's own palette,
   but saturated and swirling instead of sitting still. Everything on the
   page is a thing rather than a rectangle — a panelled door with a brass
   knob and a bevelled frame, a room with a floor behind it, a strip of
   paper feeding out of the gap underneath. The door hinges on its left
   edge and really turns in space; the room is lit the whole time, so what
   opens is a view and not a reveal animation.

   Only transform and opacity are animated. The swirl behind everything is
   a rotating element, not a moving gradient: a conic-gradient whose angle
   changes repaints the whole backdrop every frame. */

:root {
  --ink: #1b1530;
  --paper: #fff6e0;
  --pink: #ff4f9a;
  --teal: #19b3a6;
  --mustard: #ffc83d;
  --tomato: #ff5a36;
  --purple: #6b3fd6;
  --mint: #8dffbf;
  --wheat: #f2c75c;
  --sky: #5a9fe0;
  --wood: #7a4a24;
  --wood-lit: #a9703a;
  --brass: linear-gradient(180deg, #fff1b8 0%, #e0b45a 30%, #a87526 62%, #6e4512 100%);

  --f-deco: "Limelight", "Dela Gothic One", serif;
  --f-neon: "Monoton", "Dela Gothic One", cursive;
  --f-body: "Courier Prime", "Kiwi Maru", ui-monospace, monospace;
  --f-marker: "Permanent Marker", "Zen Kaku Gothic New", cursive;
  --f-stencil: "Big Shoulders Stencil Display", Impact, sans-serif;
  --f-crt: "VT323", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #150f28;
  color: var(--paper);
  font: 16px/1.6 var(--f-body);
  overflow-x: hidden;
}

/* ------------------------------------------------------- the dimension */

.fyi-sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
/* The swirl is painted once and never moves. It is nearly two viewports
   across, and a layer that big has to be rasterised whole — rotating it is
   what pinned the GPU for hours the last time something like this went up
   (tools/check-animation-cost.py exists because of it). The groove comes
   from small things instead: the halo below, the planet's own rings, the
   bulbs, the grain. */
.fyi-swirl {
  /* exactly the viewport, with the gradient's own centre doing the work a
     giant rotated box used to do. No oversize layer, and the angle is baked
     into the gradient rather than applied as a transform. */
  position: absolute; inset: 0; opacity: .5;
  background: conic-gradient(from 346deg at 50% 34%,
    #6b3fd6 0deg, #1b1530 34deg, #ff4f9a 70deg, #1b1530 104deg,
    #19b3a6 140deg, #1b1530 174deg, #ffc83d 210deg, #1b1530 244deg,
    #ff5a36 280deg, #1b1530 314deg, #6b3fd6 360deg);
  -webkit-mask-image: radial-gradient(circle 120vmax at 50% 34%, #000 0 14%, rgba(0,0,0,.5) 38%, transparent 66%);
          mask-image: radial-gradient(circle 120vmax at 50% 34%, #000 0 14%, rgba(0,0,0,.5) 38%, transparent 66%);
}
/* The one thing that turns: a halo of spokes behind the planet, sized in
   vmin so it stays a small layer whatever the window does. */
.fyi-rays {
  position: absolute; left: 50%; top: 190px; width: 64vmin; height: 64vmin;
  margin: -32vmin 0 0 -32vmin; border-radius: 50%; opacity: .3; mix-blend-mode: screen;
  background: repeating-conic-gradient(from 0deg,
    rgba(255, 241, 201, .55) 0deg 1.6deg, transparent 1.6deg 9deg);
  -webkit-mask-image: radial-gradient(circle, transparent 0 30%, #000 58%, transparent 78%);
          mask-image: radial-gradient(circle, transparent 0 30%, #000 58%, transparent 78%);
  animation: fyi-turn 90s linear infinite;
  will-change: transform;
}
@keyframes fyi-turn { to { transform: rotate(360deg); } }

/* film grain, so none of it looks like a gradient */
.fyi-grain {
  position: absolute; inset: -40px; opacity: .07;
  background-image:
    radial-gradient(circle at 17% 23%, #fff 0 .6px, transparent 1px),
    radial-gradient(circle at 61% 77%, #fff 0 .6px, transparent 1px),
    radial-gradient(circle at 83% 31%, #fff 0 .6px, transparent 1px);
  background-size: 23px 29px, 31px 23px, 19px 37px;
  animation: fyi-grain 1.1s steps(3) infinite;
}
@keyframes fyi-grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-11px, 7px); }
  66%  { transform: translate(9px, -13px); }
  100% { transform: translate(0, 0); }
}
/* The stars. Their positions used to be 26 inline style attributes; this
   app's CSP is style-src 'self' with no unsafe-inline, so they live here.
   They are children 4 onwards of .fyi-sky — the swirl, the rays and the
   grain come first. */
.fyi-star {
  position: absolute;
  width: 3px; height: 3px; border-radius: 50%; background: #fff1c9;
  opacity: .8;
  animation: fyi-twinkle 4.5s ease-in-out infinite;
}
.fyi-star:nth-child(4) { left: 0%; top: 13%; animation-delay: 0.0s; transform: scale(0.5); }
.fyi-star:nth-child(5) { left: 41%; top: 80%; animation-delay: 0.7s; transform: scale(0.8); }
.fyi-star:nth-child(6) { left: 82%; top: 47%; animation-delay: 1.4s; transform: scale(1.1); }
.fyi-star:nth-child(7) { left: 23%; top: 14%; animation-delay: 2.1s; transform: scale(1.4); }
.fyi-star:nth-child(8) { left: 64%; top: 81%; animation-delay: 2.8s; transform: scale(1.7); }
.fyi-star:nth-child(9) { left: 5%; top: 48%; animation-delay: 3.5s; transform: scale(0.5); }
.fyi-star:nth-child(10) { left: 46%; top: 15%; animation-delay: 4.2s; transform: scale(0.8); }
.fyi-star:nth-child(11) { left: 87%; top: 82%; animation-delay: 4.9s; transform: scale(1.1); }
.fyi-star:nth-child(12) { left: 28%; top: 49%; animation-delay: 0.0s; transform: scale(1.4); }
.fyi-star:nth-child(13) { left: 69%; top: 16%; animation-delay: 0.7s; transform: scale(1.7); }
.fyi-star:nth-child(14) { left: 10%; top: 83%; animation-delay: 1.4s; transform: scale(0.5); }
.fyi-star:nth-child(15) { left: 51%; top: 50%; animation-delay: 2.1s; transform: scale(0.8); }
.fyi-star:nth-child(16) { left: 92%; top: 17%; animation-delay: 2.8s; transform: scale(1.1); }
.fyi-star:nth-child(17) { left: 33%; top: 84%; animation-delay: 3.5s; transform: scale(1.4); }
.fyi-star:nth-child(18) { left: 74%; top: 51%; animation-delay: 4.2s; transform: scale(1.7); }
.fyi-star:nth-child(19) { left: 15%; top: 18%; animation-delay: 4.9s; transform: scale(0.5); }
.fyi-star:nth-child(20) { left: 56%; top: 85%; animation-delay: 0.0s; transform: scale(0.8); }
.fyi-star:nth-child(21) { left: 97%; top: 52%; animation-delay: 0.7s; transform: scale(1.1); }
.fyi-star:nth-child(22) { left: 38%; top: 19%; animation-delay: 1.4s; transform: scale(1.4); }
.fyi-star:nth-child(23) { left: 79%; top: 86%; animation-delay: 2.1s; transform: scale(1.7); }
.fyi-star:nth-child(24) { left: 20%; top: 53%; animation-delay: 2.8s; transform: scale(0.5); }
.fyi-star:nth-child(25) { left: 61%; top: 20%; animation-delay: 3.5s; transform: scale(0.8); }
.fyi-star:nth-child(26) { left: 2%; top: 87%; animation-delay: 4.2s; transform: scale(1.1); }
.fyi-star:nth-child(27) { left: 43%; top: 54%; animation-delay: 4.9s; transform: scale(1.4); }
.fyi-star:nth-child(28) { left: 84%; top: 21%; animation-delay: 0.0s; transform: scale(1.7); }
.fyi-star:nth-child(29) { left: 25%; top: 88%; animation-delay: 0.7s; transform: scale(0.5); }
@keyframes fyi-twinkle { 0%, 100% { opacity: .25; } 50% { opacity: .95; } }

/* -------------------------------------------------------------- the top */

.fyi-lang {
  position: relative; z-index: 3;
  display: flex; gap: 2px; justify-content: center; padding: 14px 16px 0;
}
.fyi-lang a {
  padding: 5px 13px 4px; font: 14px/1 var(--f-crt); letter-spacing: .16em;
  color: var(--paper); text-decoration: none;
  border: 2px solid rgba(255, 246, 224, .3); border-radius: 999px;
  background: rgba(27, 21, 48, .55);
}
.fyi-lang a[aria-current] { color: var(--ink); background: var(--mint); border-color: var(--ink); }
.fyi-lang a:hover { border-color: var(--mint); }

.fyi-top { position: relative; z-index: 2; text-align: center; padding: 6px 16px 0; }

.fyi-head { display: block; width: min(420px, 78vw); height: auto; margin: 0 auto -4%; }
.fh-face {
  mix-blend-mode: luminosity; transform-box: fill-box; transform-origin: 50% 50%;
  animation: fh-surface 9s ease-in-out infinite;
}
@keyframes fh-surface {
  0%, 100% { opacity: .22; transform: scale(.97); }
  50%      { opacity: .62; transform: scale(1.02); }
}
/* The bulbs chase round the ring. The delay used to be an inline
   style="--i:n" on each circle; this app's CSP has no unsafe-inline, so the
   walk is nth-child rules instead. Two groups (behind the planet and in
   front), each about twenty lamps. */
.fh-bulbs circle { fill: #fff3b0; animation: fh-bulb 2.6s steps(1) infinite; }
.fh-bulbs circle:nth-child(1) { animation-delay: -0.0s; }
.fh-bulbs circle:nth-child(2) { animation-delay: -0.13s; }
.fh-bulbs circle:nth-child(3) { animation-delay: -0.26s; }
.fh-bulbs circle:nth-child(4) { animation-delay: -0.39s; }
.fh-bulbs circle:nth-child(5) { animation-delay: -0.52s; }
.fh-bulbs circle:nth-child(6) { animation-delay: -0.65s; }
.fh-bulbs circle:nth-child(7) { animation-delay: -0.78s; }
.fh-bulbs circle:nth-child(8) { animation-delay: -0.91s; }
.fh-bulbs circle:nth-child(9) { animation-delay: -1.04s; }
.fh-bulbs circle:nth-child(10) { animation-delay: -1.17s; }
.fh-bulbs circle:nth-child(11) { animation-delay: -1.3s; }
.fh-bulbs circle:nth-child(12) { animation-delay: -1.43s; }
.fh-bulbs circle:nth-child(13) { animation-delay: -1.56s; }
.fh-bulbs circle:nth-child(14) { animation-delay: -1.69s; }
.fh-bulbs circle:nth-child(15) { animation-delay: -1.82s; }
.fh-bulbs circle:nth-child(16) { animation-delay: -1.95s; }
.fh-bulbs circle:nth-child(17) { animation-delay: -2.08s; }
.fh-bulbs circle:nth-child(18) { animation-delay: -2.21s; }
.fh-bulbs circle:nth-child(19) { animation-delay: -2.34s; }
.fh-bulbs circle:nth-child(20) { animation-delay: -2.47s; }
.fh-bulbs circle:nth-child(21) { animation-delay: -2.6s; }
.fh-bulbs circle:nth-child(22) { animation-delay: -2.73s; }
.fh-bulbs circle.b1 { fill: #ffd36b; }
.fh-bulbs circle.b2 { fill: #ffb3d1; }
@keyframes fh-bulb { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .35; } }

.fyi-wordmark {
  margin: 0; line-height: .9;
  font: 400 clamp(44px, 11vw, 104px)/.9 var(--f-deco);
  letter-spacing: .02em;
  color: var(--mustard);
  text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 var(--pink), 9px 9px 0 var(--purple);
}
.fyi-wordmark span + span { color: var(--pink); text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 var(--mustard), 9px 9px 0 var(--teal); }
.fyi-wordmark b {
  display: block; margin-top: 6px;
  font: 400 clamp(19px, 4.4vw, 40px)/1 var(--f-neon);
  color: var(--mint); letter-spacing: .08em; text-transform: lowercase;
  text-shadow: 0 0 8px rgba(141, 255, 191, .8), 0 0 22px rgba(141, 255, 191, .45), 2px 2px 0 var(--ink);
}
.fyi-tag {
  margin: 10px auto 0; max-width: 30em;
  font: 400 clamp(13px, 2.2vw, 17px)/1.5 var(--f-stencil);
  letter-spacing: .22em; color: var(--mint);
}
.lang-ja .fyi-tag { font-family: var(--f-marker); letter-spacing: .1em; font-size: clamp(14px, 2.4vw, 19px); }

/* -------------------------------------------------------------- the door */

.fyi-stage { position: relative; z-index: 2; padding: 26px 16px 0; }
/* the leaf swings out past the jamb, so the stage must not clip it */
.fyi-frame, .fyi-stage { overflow: visible; }

/* The frame is the thing with perspective; the leaf turns inside it. The
   perspective lives here and not on the leaf, so the hinge reads as a hinge
   and not as a flat card flipping. */
.fyi-frame {
  position: relative;
  width: min(560px, 92vw);
  margin: 0 auto;
  aspect-ratio: 5 / 8;
  perspective: 1400px;
  perspective-origin: 50% 46%;
  /* the architrave: three bevels of stained wood round the opening */
  padding: 18px;
  border-radius: 10px 10px 2px 2px;
  background:
    linear-gradient(150deg, var(--wood-lit), var(--wood) 42%, #5a3418 100%);
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, .45),
    inset 0 0 0 9px rgba(255, 220, 170, .14),
    inset 0 0 0 12px rgba(0, 0, 0, .35),
    0 26px 60px rgba(0, 0, 0, .65);
}

/* the room behind, lit, with a floor running away from you */
.fyi-room {
  position: absolute; inset: 18px; overflow: auto;
  border-radius: 4px 4px 1px 1px;
  padding: 22px 18px 24px;
  background:
    linear-gradient(180deg, rgba(27, 21, 48, .2) 0 62%, rgba(27, 21, 48, .75) 100%),
    radial-gradient(ellipse 120% 70% at 50% 8%, rgba(255, 241, 201, .34), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 1px, transparent 1px 7%),
    linear-gradient(170deg, #241c42, #130e24 70%);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .8), inset 0 14px 30px rgba(0, 0, 0, .6);
  scrollbar-width: thin;
  /* the room runs back further than the doorway shows: the last line fades
     into the dark rather than being cut off by the frame */
  -webkit-mask-image: linear-gradient(180deg, #000 0 88%, rgba(0, 0, 0, .25) 100%);
          mask-image: linear-gradient(180deg, #000 0 88%, rgba(0, 0, 0, .25) 100%);
}
.fyi-room-head {
  margin: 0 0 14px; text-align: center;
  font: 400 clamp(17px, 3.4vw, 23px)/1.2 var(--f-deco);
  letter-spacing: .04em; color: var(--mustard);
  text-shadow: 2px 2px 0 var(--ink);
}
.lang-ja .fyi-room-head { font-family: var(--f-marker); }

.fyi-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  transition: padding-left .9s ease; }
/* with the leaf standing open across the left of the doorway, the signs step
   out from behind it */
.fyi-frame:has(.fyi-door[aria-expanded="true"]) .fyi-list,
.fyi-frame:has(.fyi-door[aria-expanded="true"]) .fyi-dark { padding-left: 8px; }
/* each address is a lit sign standing in the room */
.fyi-site a {
  display: block; padding: 11px 13px 10px;
  color: var(--ink); text-decoration: none;
  background: var(--paper);
  border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, .55);
  /* a card lies a little differently from the one above it; by position in
     the list rather than by an inline --i, for the same CSP reason */
  transform: rotate(-1deg);
  transition: transform .18s ease, box-shadow .18s ease;
}
.fyi-site:nth-child(3n+2) a { transform: rotate(-.2deg); }
.fyi-site:nth-child(3n) a   { transform: rotate(.6deg); }
.fyi-site a:hover, .fyi-site a:focus-visible {
  transform: rotate(0) translate(-1px, -2px);
  box-shadow: 6px 8px 0 rgba(0, 0, 0, .6);
}
.fyi-site b {
  display: block; font: 400 19px/1.1 var(--f-deco); letter-spacing: .03em;
}
.lang-ja .fyi-site b { font-family: var(--f-marker); font-weight: 400; font-size: 17px; }
.fyi-site span { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.5; }
.fyi-site small {
  display: block; margin-top: 5px;
  font: 12px/1 var(--f-crt); letter-spacing: .1em; opacity: .62;
}
/* the colour each one is lit in: a bar down its left edge */
.fyi-site a { border-left-width: 12px; }
.c-pink    a { border-left-color: var(--pink); }
.c-teal    a { border-left-color: var(--teal); }
.c-mustard a { border-left-color: var(--mustard); }
.c-tomato  a { border-left-color: var(--tomato); }
.c-purple  a { border-left-color: var(--purple); }
.c-wheat   a { border-left-color: var(--wheat); }
.c-sky     a { border-left-color: var(--sky); }
.c-mint    a { border-left-color: var(--mint); }

.fyi-dark-head {
  margin: 18px 0 6px; font: 12px/1.4 var(--f-crt); letter-spacing: .14em;
  color: var(--mint); text-transform: uppercase;
}
.fyi-dark-head span { opacity: .6; text-transform: none; letter-spacing: .04em; }
.lang-ja .fyi-dark-head { font-family: var(--f-body); letter-spacing: .04em; text-transform: none; }
.fyi-dark { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.fyi-dark li {
  padding: 3px 8px 2px; font: 12px/1.4 var(--f-crt); letter-spacing: .08em;
  color: rgba(255, 246, 224, .5);
  border: 1px dashed rgba(255, 246, 224, .25); border-radius: 3px;
}

/* the leaf itself: a button, so it works from the keyboard and says what it
   is to a screen reader */
.fyi-door {
  position: absolute; inset: 18px; z-index: 2;
  padding: 0; border: 0; background: none; cursor: pointer;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
}
.fyi-leaf {
  position: absolute; inset: 0;
  transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform 1.25s cubic-bezier(.33, .92, .25, 1);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  border-radius: 3px;
  /* stained, varnished wood with a grain that is drawn rather than filtered */
  background:
    repeating-linear-gradient(92deg, rgba(0,0,0,.16) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(88deg, rgba(255, 220, 170, .07) 0 1px, transparent 1px 13px),
    linear-gradient(104deg, #8a5527 0%, #6d3f1c 38%, #8f5a2b 62%, #5e3418 100%);
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, .5),
    inset 3px 4px 10px rgba(255, 220, 170, .14),
    inset -6px -8px 18px rgba(0, 0, 0, .55),
    10px 12px 28px rgba(0, 0, 0, .6);
}
/* the varnish: one slow highlight down the face */
.fyi-leaf::after {
  content: ""; position: absolute; inset: 0; border-radius: 3px; pointer-events: none;
  background: linear-gradient(112deg, transparent 22%, rgba(255, 241, 201, .17) 38%,
                                      rgba(255, 241, 201, .04) 48%, transparent 64%);
}
/* the hinge side: two knuckles on the jamb */
.fyi-edge {
  position: absolute; left: -7px; top: 12%; bottom: 12%; width: 13px; z-index: 3;
  border-radius: 7px; background: var(--brass);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .55), 2px 2px 5px rgba(0, 0, 0, .6);
}
.fyi-edge::before, .fyi-edge::after {
  content: ""; position: absolute; left: -2px; width: 17px; height: 52px;
  border-radius: 8px; background: var(--brass);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .6), 2px 3px 6px rgba(0, 0, 0, .55);
}
.fyi-edge::before { top: 8%; }
.fyi-edge::after  { bottom: 8%; }

/* the four sunk panels */
.fyi-panel {
  position: absolute; border-radius: 2px;
  background: linear-gradient(140deg, #4f2d13, #7b4a22 55%, #45260f);
  box-shadow:
    inset 2px 3px 7px rgba(0, 0, 0, .72),
    inset -2px -2px 5px rgba(255, 220, 170, .12),
    0 0 0 3px rgba(0, 0, 0, .35),
    0 0 0 5px rgba(255, 220, 170, .09);
}
.fyi-panel-tl { left: 10%; top: 7%;  width: 33%; height: 27%; }
.fyi-panel-tr { right: 10%; top: 7%; width: 33%; height: 27%; }
.fyi-panel-bl { left: 10%; bottom: 9%;  width: 33%; height: 30%; }
.fyi-panel-br { right: 10%; bottom: 9%; width: 33%; height: 30%; }

/* the peephole, lit from the other side */
.fyi-eye {
  position: absolute; left: 50%; top: 22%; width: 38px; height: 38px; margin-left: -19px;
  border-radius: 50%; background: var(--brass);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .6), 2px 3px 7px rgba(0, 0, 0, .6);
  display: grid; place-items: center;
}
.fyi-eye i {
  width: 17px; height: 17px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6c8, #ffc83d 45%, #a85a1f 100%);
  box-shadow: 0 0 10px rgba(255, 200, 61, .9), 0 0 22px rgba(255, 200, 61, .5);
  animation: fyi-eye 5.5s ease-in-out infinite;
}
@keyframes fyi-eye { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ------------------------------------------------- the keypad on the door

   Translucent keycaps in a recessed metal bezel, lit from behind — the
   chunky backlit plastic of a 1960s console, the kind that still turned up
   in a missile-launch set twenty years later. A cap is a lens, not a
   rectangle: the light lives under it and comes through the plastic, so the
   colour is in a layer behind the legend rather than on it. */

.fyi-pad {
  position: absolute; left: 50%; top: 31%; transform: translateX(-50%);
  width: min(70%, 224px);
  padding: 9px 9px 8px;
  border-radius: 8px;
  /* The bezel is dark on purpose: a translucent cap only reads as
     translucent if what is behind it is darker than the cap. */
  background: linear-gradient(168deg, #3e4248, #22252a 46%, #15171b);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, .6),
    inset 0 2px 5px rgba(255, 255, 255, .22),
    inset 0 -3px 8px rgba(0, 0, 0, .6),
    0 5px 14px rgba(0, 0, 0, .7);
}

/* the readout: a strip of smoked glass with the code glowing behind it */
.fyi-readout { display: block; margin: 0 0 10px; }
.fyi-readout input {
  display: block; width: 100%; padding: 5px 8px 3px;
  font: 19px/1.1 var(--f-crt); letter-spacing: .2em; text-align: center;
  color: #8dffbf; caret-color: #8dffbf;
  background: #0b1a12;
  border: 2px solid #11151a; border-radius: 4px;
  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, .95),
    inset 0 0 16px rgba(141, 255, 191, .22),
    0 1px 0 rgba(255, 255, 255, .16);
  text-shadow: 0 0 7px rgba(141, 255, 191, .9);
}
.fyi-readout input::placeholder { color: rgba(141, 255, 191, .3); letter-spacing: .1em; }
.fyi-readout input:focus { outline: 2px solid var(--mint); outline-offset: 2px; }

.fyi-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }

.fyi-key {
  position: relative; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: 1 / .78; border-radius: 4px;
  /* The cap: amber plastic you can see into. The colour is carried by a
     translucent fill over the dark bezel, which is what makes it read as a
     lens with a lamp behind it rather than a painted tile. */
  background:
    linear-gradient(176deg, rgba(255, 244, 214, .5) 0%, rgba(255, 214, 130, .2) 36%,
                            rgba(255, 176, 60, .14) 62%, rgba(120, 70, 18, .3) 100%),
    radial-gradient(ellipse at 50% 135%, rgba(255, 190, 80, .34), transparent 70%);
  box-shadow:
    inset 0 2px 1px rgba(255, 248, 228, .75),
    inset 0 -5px 8px rgba(60, 32, 6, .75),
    inset 0 0 0 1.5px rgba(16, 10, 4, .7),
    0 3px 0 #16181c, 0 4px 6px rgba(0, 0, 0, .7);
  transition: transform .06s linear, box-shadow .06s linear;
}
.fyi-key span {
  display: grid; place-items: center; height: 100%;
  font: 17px/1 var(--f-stencil); letter-spacing: .04em;
  color: #ffd79a;
  text-shadow: 0 0 6px rgba(255, 170, 50, .55), 0 1px 0 rgba(0, 0, 0, .6);
}
/* the lamp under the cap: off until the key is pressed */
.fyi-key::after {
  content: ""; position: absolute; inset: 2px; border-radius: 4px;
  background: radial-gradient(ellipse at 50% 120%, rgba(255, 196, 80, .95), rgba(255, 150, 30, .25) 62%, transparent 75%);
  opacity: 0; transition: opacity .07s linear;
  pointer-events: none;
}
.fyi-key:hover { background: linear-gradient(176deg, rgba(255, 236, 190, .6), rgba(255, 206, 116, .36) 42%, rgba(190, 130, 46, .34)); }
/* pressed, or lit by the script when a key is typed on a real keyboard */
.fyi-key:active, .fyi-key.lit {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, .5),
    inset 0 -2px 4px rgba(90, 50, 10, .5),
    inset 0 0 0 1.5px rgba(40, 24, 8, .55),
    0 0 0 #2a2d33, 0 1px 3px rgba(0, 0, 0, .6),
    0 0 14px rgba(255, 180, 60, .8);
}
.fyi-key:active::after, .fyi-key.lit::after { opacity: 1; }
.fyi-key:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

/* ENTER: the one big lit key, in the green of a console that is ready */
.fyi-enter {
  display: block; width: 100%; margin: 6px 0 0; padding: 7px 10px 6px;
  border: 0; border-radius: 5px; cursor: pointer;
  background:
    linear-gradient(176deg, rgba(214, 255, 232, .5) 0%, rgba(120, 235, 180, .2) 38%,
                            rgba(30, 170, 110, .16) 64%, rgba(10, 70, 46, .32) 100%),
    radial-gradient(ellipse at 50% 135%, rgba(110, 255, 180, .3), transparent 70%);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, .6),
    inset 0 -4px 7px rgba(8, 60, 36, .6),
    inset 0 0 0 1.5px rgba(8, 40, 24, .55),
    0 3px 0 #2a2d33, 0 4px 7px rgba(0, 0, 0, .65);
  transition: transform .06s linear, box-shadow .06s linear;
}
.fyi-enter b {
  font: 16px/1 var(--f-stencil); letter-spacing: .2em; color: #b6ffd8;
  text-shadow: 0 0 7px rgba(110, 255, 180, .6), 0 1px 0 rgba(0, 0, 0, .55);
}
.lang-ja .fyi-enter b { font-family: var(--f-marker); letter-spacing: .08em; font-size: 15px; }
.fyi-enter:active, .fyi-enter.lit {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, .5),
    inset 0 -2px 4px rgba(8, 60, 36, .5),
    inset 0 0 0 1.5px rgba(8, 40, 24, .55),
    0 0 0 #2a2d33, 0 1px 3px rgba(0, 0, 0, .6),
    0 0 18px rgba(120, 255, 180, .85);
}
.fyi-enter:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

.fyi-pad-hint {
  margin: 6px 0 0; text-align: center;
  font: 9.5px/1.3 var(--f-body); color: rgba(255, 246, 224, .6);
}
.lang-ja .fyi-pad-hint { font-size: 10px; }

/* the wrong code: the readout shakes its head */
.fyi-pad.nope .fyi-readout input {
  color: var(--tomato); text-shadow: 0 0 8px rgba(255, 90, 54, .9);
  animation: fyi-nope .4s ease;
}
@keyframes fyi-nope {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

/* the knob, on the swinging edge */
.fyi-knob {
  position: absolute; right: 7%; top: 50%; width: 38px; height: 38px; margin-top: -19px;
  border-radius: 50%; background: var(--brass); display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .5), 3px 4px 9px rgba(0, 0, 0, .65);
}
.fyi-knob i {
  width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6d0, #c08a2e 60%, #6e4512);
}

/* Open. The leaf swings towards you and to the left, and stops short of
   square: past 90 degrees you are looking at the back of a door, which is
   blank, and with backface-visibility hidden it disappears entirely —
   leaving the brass plate floating on its own, mirrored. Seventy-eight
   degrees keeps the face towards the reader and still clears the opening. */
.fyi-door[aria-expanded="true"] .fyi-leaf {
  /* out of the frame as well as round the hinge: the lift towards the reader
     is what stops a 70-degree leaf reading as a dark sliver stuck to the jamb */
  /* 70 degrees projects the leaf to cos(70) = 34% of its width, so shifting
     it left by exactly that parks its far edge on the hinge line: the door
     stands beside the opening, fully visible, instead of across the list. */
  transform: translateX(-34%) translateZ(18px) rotateY(-70deg);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .5), 34px 22px 54px rgba(0, 0, 0, .75);
}
/* the leading edge catches the light from the room as it comes round */
.fyi-door[aria-expanded="true"] .fyi-leaf::before { opacity: 1; }
.fyi-leaf::before {
  content: ""; position: absolute; top: 0; bottom: 0; right: -4px; width: 9px;
  border-radius: 2px; opacity: 0; transition: opacity .9s ease .25s;
  background: linear-gradient(90deg, #c98f4e, #f3d9a6 45%, #8a5527);
  box-shadow: 0 0 14px rgba(255, 220, 160, .35);
}
/* The leaf is not a button and never was a click target as a whole: only
   the keys are. Open, the leaf stands beside the doorway anyway, so nothing
   needs disabling — the keypad rides round with it and still works. */


/* Shutting it again. The leaf's own keypad is unusable once it has turned,
   so this is a separate control, flat to the reader, hung on the frame and
   present only while the door is open. */
.fyi-shut {
  position: absolute; z-index: 5; right: 14px; top: -16px;
  padding: 7px 15px 6px; cursor: pointer;
  font: 14px/1 var(--f-stencil); letter-spacing: .18em; color: #0d3524;
  background: linear-gradient(176deg, #d6ffe8 0%, #8dffbf 45%, #46c98a 100%);
  border: 2px solid var(--ink); border-radius: 4px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .5), 0 5px 12px rgba(0, 0, 0, .55);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .25s ease .55s, transform .25s ease .55s, visibility 0s linear .8s;
}
.lang-ja .fyi-shut { font-family: var(--f-marker); letter-spacing: .06em; font-size: 13px; }
.fyi-frame:has(.fyi-door[aria-expanded="true"]) .fyi-shut {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .3s ease .5s, transform .3s ease .5s, visibility 0s;
}
.fyi-shut:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.fyi-shut:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }

/* --------------------------------------------- the narration under the door */

.fyi-crawl {
  position: relative; z-index: 1;
  width: min(560px, 92vw); margin: -10px auto 0;
  padding: 26px 22px 20px;
  overflow: hidden;
  /* a strip of paper fed out of the gap: torn at the bottom, curling */
  background:
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(59, 91, 219, .13) 25px 26px),
    linear-gradient(180deg, #efe3c6 0%, #f6ecd4 40%, #e8dabb 100%);
  color: #241c12;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .55), inset 0 10px 18px rgba(0, 0, 0, .3);
  -webkit-mask-image: linear-gradient(180deg, #000 0 88%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0 88%, transparent 100%);
}
.fyi-crawl-line {
  margin: 0; max-width: 34em;
  font: 15px/26px var(--f-body); letter-spacing: .01em;
}
.lang-ja .fyi-crawl-line { font-size: 14.5px; line-height: 26px; }
/* it types itself out when the door opens (zone.js); without the script the
   whole line is simply there, which is the correct page either way */
.fyi-crawl-line.typing::after {
  content: "▌"; color: var(--tomato); animation: fyi-caret .8s steps(1) infinite;
}
@keyframes fyi-caret { 50% { opacity: 0; } }

/* ------------------------------------------------------------- the foot */

.fyi-foot { position: relative; z-index: 2; text-align: center; padding: 34px 16px 44px; }
.fyi-foot p { margin: 0; font: 14px/1.6 var(--f-body); color: rgba(255, 246, 224, .72); }
.fyi-quiet { margin-top: 4px !important; font-family: var(--f-crt) !important; letter-spacing: .16em; opacity: .5; }

/* ------------------------------------------------------------- phones */

@media (max-width: 560px) {
  .fyi-frame { aspect-ratio: 4 / 7; padding: 12px; }
  .fyi-room, .fyi-door { inset: 12px; }
  .fyi-room { padding: 16px 12px 18px; }
  .fyi-head { width: 86vw; }
  .fyi-panel-tl, .fyi-panel-tr { height: 24%; }
  .fyi-knob { width: 30px; height: 30px; margin-top: -15px; }
}

/* A door that swings is the whole point, but it is also the one thing on
   the page that moves a long way. Off, it simply is not there. */
@media (prefers-reduced-motion: reduce) {
  .fyi-swirl, .fyi-rays, .fyi-grain, .fyi-star,
  .fh-face, .fh-bulbs circle, .fyi-eye i { animation: none; }
  .fyi-leaf { transition: none; }
}

/* --------------------------------------- the switchboard, behind 8675309

   A back room should not look like the front of the house: green phosphor
   on black, one scanline wash, no psychedelia. */

.sw-body {
  margin: 0; min-height: 100vh; background: #04120b; color: #8dffbf;
  font: 17px/1.6 var(--f-crt);
}
.lang-ja .sw-body { font-family: "Kiwi Maru", var(--f-body); font-size: 15px; }
/* one static wash, not an animated one: a moving scanline repaints the
   whole screen every frame for no gain */
.sw-scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .5;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .34) 0 1px, transparent 1px 3px);
}
.sw { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; padding: 40px 18px 60px; }
.sw a { color: #8dffbf; }
.sw-dial { margin: 0 0 18px; opacity: .72; letter-spacing: .08em; }
.sw-dial b { color: #d9ffe9; text-shadow: 0 0 9px rgba(141, 255, 191, .9); }
.sw-title {
  margin: 0; font: 40px/1 var(--f-crt); letter-spacing: .18em;
  text-shadow: 0 0 10px rgba(141, 255, 191, .8), 0 0 28px rgba(141, 255, 191, .35);
}
.lang-ja .sw-title { font-family: "Kiwi Maru", var(--f-body); font-size: 30px; letter-spacing: .1em; }
.sw-tag { margin: 6px 0 0; opacity: .78; }
.sw-found { margin: 20px 0 26px; padding: 10px 14px; border-left: 3px solid #8dffbf;
  background: rgba(141, 255, 191, .07); }

.sw-table { width: 100%; border-collapse: collapse; }
.sw-table td { padding: 6px 8px; border-bottom: 1px dashed rgba(141, 255, 191, .2); vertical-align: middle; }
.sw-lamp { width: 22px; }
.sw-lamp i {
  display: block; width: 10px; height: 10px; border-radius: 50%;
  background: #1d4a33; box-shadow: inset 0 0 3px rgba(0, 0, 0, .8);
}
.sw-table tr.on .sw-lamp i {
  background: #8dffbf; box-shadow: 0 0 9px rgba(141, 255, 191, .95), 0 0 18px rgba(141, 255, 191, .5);
}
.sw-table tr.off { opacity: .45; }
.sw-host { letter-spacing: .06em; }
.sw-state { text-align: right; font-size: .82em; letter-spacing: .14em; opacity: .7; white-space: nowrap; }
.sw-when { margin: 22px 0 0; opacity: .5; letter-spacing: .08em; font-size: .9em; }
.sw-note { margin: 4px 0 0; opacity: .5; font-size: .9em; }
.sw-back { margin: 30px 0 0; }
