/* Custom game consoles: early access.
   The living rooms are the picture. Everything laid over them is glass, in the manner of
   current iOS: capsules and a deep-cornered sheet that blur and bend what's behind them, a
   bright rim where the light catches an edge, and in each picker one drop of glass that
   flows from choice to choice. Type is Michroma (the wide face on every hi-fi and VCR
   faceplate) for names and years, Archivo for reading. One accent, and it changes with the
   decade: tungsten amber, 90s teal, blue LED, loft brass. */

/* registered as a colour, so it pours from one decade's accent into the next */
@property --accent { syntax: '<color>'; inherits: true; initial-value: #ffa23a; }

:root {
  --night: #0c0b0e;
  --ink: #f7f3ea;
  --dim: #d2cbbd;
  --line: rgba(255, 255, 255, 0.13);
  --accent: #ffa23a;
  --accent-ink: #1d1206;
  --plate: 'Michroma', 'Eurostile', 'Arial Black', sans-serif;
  --text: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 1rem;
  --inset: 14px;                                   /* how far the sheet floats from the window's edge */
  --sheet: clamp(22.5rem, 33vw, 29rem);
  --clear: calc(var(--inset) + var(--sheet));      /* where the open picture begins */
  --glass: rgba(22, 20, 26, 0.44);                 /* the tint of a pane over the picture */
  --fill: rgba(255, 255, 255, 0.07);               /* a control set into the sheet */
  /* the chosen item's drop of glass */
  --drop: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1)), color-mix(in srgb, var(--accent) 22%, transparent);
  --drop-edge: 0 6px 16px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  /* a spring that overshoots by a twelfth and settles */
  --spring: linear(0, 0.049, 0.169, 0.325, 0.49, 0.645, 0.78, 0.889, 0.971, 1.028, 1.062, 1.08, 1.083, 1.078, 1.068, 1.055, 1.041, 1.028, 1.017, 1.008, 1.002, 0.997, 1);
}
html[data-room='90s'] { --accent: #2fe0cf; --accent-ink: #04201d; }
html[data-room='00s'] { --accent: #6db9ff; --accent-ink: #04162a; }
html[data-room='loft'] { --accent: #f0d9a8; --accent-ink: #1d1608; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); color-scheme: dark; -webkit-text-size-adjust: 100%; transition: --accent 0.6s ease; }
body { margin: 0; min-height: 100svh; display: flow-root; color: var(--ink); font: 400 1rem/1.5 var(--text); position: relative; }
a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
button, input { font: inherit; color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------------------------------------------------------------- glass */

/* A pane: ::before is the glass itself (its tint, the blur of what's behind, the shadow it
   casts) and ::after the rim, brightest where light would catch it. They are pseudo-elements
   because a blur only sees through to the picture if nothing above it is faded or filtered,
   so a pane fades by --o on these parts and never as a whole. --lens is set by glass.js in
   browsers that can also bend the picture at the rim; until then it is a filter that does
   nothing. */
.panel, .seg, .step, .back, .hotspot-tag { isolation: isolate; }
:is(.panel, .seg, .step, .back, .hotspot-tag)::before {
  content: ''; position: absolute; inset: 0; z-index: -2; border-radius: inherit; pointer-events: none; opacity: var(--o, 1);
  background: var(--tint, var(--glass));
  -webkit-backdrop-filter: blur(var(--blur, 5px)) saturate(1.8) brightness(1.06);
  backdrop-filter: var(--lens, saturate(1)) blur(var(--blur, 5px)) saturate(1.8) brightness(1.06);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.24), inset 0 0 16px rgba(255, 255, 255, 0.07);
}
:is(.panel, .seg, .step, .back, .hotspot-tag)::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none; opacity: var(--o, 1);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.14) 30%, rgba(255, 255, 255, 0.05) 62%, rgba(255, 255, 255, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* The drop of glass on a picker's chosen item. glass.js adds it (.thumb is its anchor, which
   takes no room and scrolls with the items) and moves it; until then, and without
   JavaScript, the chosen item wears the same look itself. */
.thumb { display: block; position: relative; height: 0; }
.drop {
  position: absolute; left: 0; top: 0; z-index: -1; border-radius: 18px; pointer-events: none;
  background: var(--drop); box-shadow: var(--drop-edge);
  transition: scale 0.5s var(--spring), filter 0.3s;
}

/* ---------------------------------------------------------------- the stage */

.stage { position: fixed; inset: 0; overflow: hidden; background: var(--night); }
.poster, #view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.poster { object-fit: cover; object-position: 62% 50%; }
#view { opacity: 0; transition: opacity 0.7s ease; touch-action: pan-y; cursor: grab; }
.is-3d #view { opacity: 1; }
.is-3d .poster { visibility: hidden; }
.dragging #view { cursor: grabbing; }

/* The console's own button: a rim of light around it in the picture, wherever it is this
   frame, and a tag of tinted glass above. --shown comes from app.js as the room slides. */
.hotspot { position: absolute; left: 0; top: 0; z-index: 2; margin: 0; padding: 0; border: 0; border-radius: 16px; background: none; cursor: pointer; --shown: 0; }
.hotspot::before, .hotspot::after { content: ''; position: absolute; inset: -8px; border-radius: 22px; pointer-events: none; }
.hotspot::before {
  border: 1.5px solid rgba(255, 255, 255, 0.86); opacity: calc(var(--shown) * 0.78);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(0, 0, 0, 0.16), 0 0 22px rgba(255, 255, 255, 0.16), inset 0 0 26px rgba(255, 255, 255, 0.1);
  transition: inset 0.45s var(--spring);
}
.hotspot:hover::before, .hotspot:focus-visible::before { inset: -12px; opacity: var(--shown); }
.hotspot::after { border: 1.5px solid var(--accent); opacity: 0; }
.hotspot:not(.used, .away)::after { animation: ping 2.6s ease-out infinite; }
@keyframes ping { 0% { opacity: 0.8; inset: -8px; } 70%, 100% { opacity: 0; inset: -28px; } }
.hotspot-tag {
  position: absolute; left: 50%; bottom: calc(100% + 20px); translate: -50% 0; white-space: nowrap;
  padding: 0.5rem 0.95rem; border-radius: 999px; font: 700 0.8125rem/1.2 var(--text); color: var(--accent-ink);
  --tint: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff 12%), color-mix(in srgb, var(--accent) 80%, transparent)); --o: var(--shown); --blur: 6px;
  transition: scale 0.45s var(--spring);
}
.hotspot-tag > span { opacity: var(--shown); }
.hotspot-tag .count { font-weight: 500; margin-left: 0.35em; color: color-mix(in srgb, var(--accent-ink) 72%, transparent); }
.hotspot:hover .hotspot-tag, .hotspot:focus-visible .hotspot-tag { scale: 1.06; }
.hotspot:active .hotspot-tag { scale: 0.97; }

.back {
  position: absolute; z-index: 3; top: calc(var(--inset) + 4px); right: calc(var(--inset) + 4px);
  display: flex; align-items: center; gap: 0.4rem; height: 44px; padding: 0 1.1rem 0 0.85rem; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-weight: 500; font-size: 0.9375rem; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  transition: scale 0.45s var(--spring);
}
.back svg, .step svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
.back:hover, .step:hover:not(:disabled) { --tint: rgba(74, 70, 80, 0.42); }
.back:active, .step:active:not(:disabled) { scale: 1.07; }

/* The row of decades: a capsule of glass, with the drop on the room the camera is in. */
.decades {
  position: absolute; z-index: 3; bottom: clamp(1rem, 3.2vh, 1.75rem); left: calc(var(--clear) + (100% - var(--clear)) / 2); translate: -50% 0;
  display: flex; align-items: center; gap: 0.5rem;
}
.decades[hidden], .hotspot[hidden], .back[hidden] { display: none; }
.seg { position: relative; padding: 4px; border-radius: 999px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.seg ol { display: flex; margin: 0; padding: 0; list-style: none; }
.seg ol button {
  display: block; min-width: 5.5rem; height: 40px; padding: 0 0.9rem; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 400 0.75rem/1 var(--plate); letter-spacing: 0.04em; color: rgba(247, 243, 234, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); transition: color 0.25s;
}
.seg ol button:hover { color: var(--ink); }
.seg ol button[aria-current='true'] { color: var(--accent-ink); text-shadow: none; }
.seg ol button:focus-visible { outline-offset: -2px; }
.seg:not(.live) ol button[aria-current='true'] { background: var(--drop); box-shadow: var(--drop-edge); }
.seg .thumb { position: absolute; left: 0; top: 0; }
.seg .drop {
  border-radius: 999px;
  --drop: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), color-mix(in srgb, var(--accent) 80%, transparent));
  --drop-edge: 0 5px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
/* picked up, the drop swells and brightens, and goes where the finger goes */
.seg.held { cursor: grabbing; }
.seg.held .drop { scale: 1.1 1.24; filter: brightness(1.25); }
.step {
  position: relative; flex: none; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 999px; background: none; cursor: pointer;
  display: grid; place-items: center; transition: scale 0.45s var(--spring);
}
.step:disabled { --o: 0.45; cursor: default; }
.step:disabled svg { opacity: 0.35; }

/* ---------------------------------------------------------------- the words */

/* One sheet of glass down the left of the window, with the room going by behind it. */
.panel {
  position: relative; z-index: 4; width: var(--sheet); min-height: calc(100svh - 2 * var(--inset)); margin: var(--inset);
  padding: 1.9rem 1.5rem 1.3rem; border-radius: 36px;
  display: flex; flex-direction: column; justify-content: center; gap: 1.5rem;
  --tint: linear-gradient(180deg, rgba(20, 18, 24, 0.5), rgba(13, 12, 16, 0.64)); --blur: 30px;
}
.panel::before { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(255, 255, 255, 0.04); }
h1 { margin: 0; font: 400 clamp(1.5rem, 2.25vw, 2.05rem)/1.22 var(--plate); letter-spacing: -0.01em; text-wrap: balance; }
.pitch { margin: 0.9rem 0 0; color: var(--dim); max-width: 34em; text-wrap: pretty; }

/* The consoles: a list set into the sheet, and the drop on the one that's chosen. */
.pick { margin: 0; padding: 0; border: 0; min-width: 0; position: relative; }
.pick legend { padding: 0; margin-bottom: 0.6rem; font-weight: 700; }
.opts { isolation: isolate; padding: 4px; border-radius: 22px; background: var(--fill); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 1px 3px rgba(0, 0, 0, 0.22); }
.opt {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 1rem;
  padding: 0.5rem 0.85rem; border-radius: 18px; cursor: pointer; transition: background 0.2s;
}
.opt + .opt::before { content: ''; position: absolute; left: 0.85rem; right: 0.85rem; top: 0; height: 1px; background: var(--line); transition: opacity 0.2s; }
.opt:has(input:checked)::before, .opt:has(input:checked) + .opt::before, .opt:hover::before, .opt:hover + .opt::before { opacity: 0; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt-theme { font-weight: 500; }
.opt .tight { display: none; }
.opt-detail { display: contents; }
.opt-name { font: 400 0.6875rem/1.4 var(--plate); letter-spacing: 0.05em; color: var(--dim); transition: color 0.25s; }
.opt-line { grid-column: 1 / -1; display: none; margin-top: 0.15rem; font-size: 0.875rem; line-height: 1.45; color: var(--dim); text-wrap: pretty; }
.opt:hover:not(:has(input:checked)) { background: rgba(255, 255, 255, 0.055); }
.opts:not(.live) .opt:has(input:checked) { background: var(--drop); box-shadow: var(--drop-edge); }
.opt:has(input:checked) .opt-name { color: var(--ink); }
.opt:has(input:checked) .opt-line { display: block; color: var(--ink); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The email and its button share one capsule, pressed into the sheet. */
.join { margin-top: 1.3rem; }
.join > label { display: block; margin-bottom: 0.45rem; font-weight: 700; }
.field {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: box-shadow 0.2s;
}
.field:has(input:focus-visible) { box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 0 0 1.5px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent); }
.field input { flex: 1; min-width: 0; padding: 0.55rem 0.4rem 0.55rem 1rem; border: 0; border-radius: 999px; background: none; outline: none; }
.field input::placeholder { color: rgba(210, 203, 189, 0.6); }
.go {
  flex: none; min-height: 44px; padding: 0 1.15rem; border: 0; border-radius: 999px; color: var(--accent-ink); font-weight: 700; cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent) 52%, color-mix(in srgb, var(--accent) 90%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), inset 0 -1px 0 rgba(0, 0, 0, 0.16), 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: scale 0.45s var(--spring), filter 0.2s;
}
.go:hover { filter: brightness(1.08); }
.go:active { scale: 1.05; }
.go:disabled { filter: saturate(0.4) brightness(0.8); cursor: progress; scale: none; }
.trap { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }
.status { margin: 0.65rem 0.3rem 0; font-size: 0.875rem; line-height: 1.45; color: var(--dim); text-wrap: pretty; }
.status.bad { display: none; color: #ffb4a6; }
/* one message at a time: the Worker's redirect (#bad-email) without JavaScript, data-state with it */
.status.bad:target, .signup[data-state='bad-email'] #bad-email, .signup[data-state='busy'] #busy, .signup[data-state='down'] #down { display: block; }
.join:has(.bad:target) #status, .signup[data-state='bad-email'] #status, .signup[data-state='busy'] #status, .signup[data-state='down'] #status { display: none; }

.joined {
  display: none; margin-top: 1.3rem; padding: 1rem 1.15rem; border-radius: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)), var(--fill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
}
.joined h2 { margin: 0 0 0.3rem; font: 400 1rem/1.3 var(--plate); color: var(--accent); }
.joined p { margin: 0.3rem 0 0; font-size: 0.9375rem; }
.joined:target, .signup[data-state='joined'] .joined { display: block; }
.joined:focus { outline: none; }
.signup:has(.joined:target) .join, .signup[data-state='joined'] .join { display: none; }

.fine { display: flex; gap: 1.25rem; padding-inline: 0.3rem; font-size: 0.8125rem; color: var(--dim); }

/* a small window: the sheet takes a third of it, so the row of decades draws in */
@media (max-width: 1000px) { .seg ol button { min-width: 4.6rem; padding-inline: 0.6rem; } }

/* ---------------------------------------------------------------- narrow: the room on top, the words under it */

@media (max-width: 820px) {
  .stage { position: relative; inset: auto; height: clamp(18rem, 52svh, 34rem); }
  .poster { object-position: 70% 50%; }
  /* the headline sits on the picture here: darken behind it */
  .stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(12, 11, 14, 0.8) 0, rgba(12, 11, 14, 0) 26%); }
  /* all four decades fit across a phone, and the picture and the drop both drag, so no arrows */
  .decades { left: 50%; bottom: 2.1rem; }
  .step { display: none; }
  .seg ol button { min-width: 0; padding: 0 0.7rem; font-size: 0.6875rem; }
  .back { top: auto; right: auto; left: 50%; bottom: 5.7rem; translate: -50% 0; height: 40px; font-size: 0.875rem; }
  .hotspot-tag { font-size: 0.75rem; left: auto; right: -4px; translate: none; }

  /* The words are a sheet drawn up over the foot of the picture, lit a little by the room. */
  .panel {
    position: static; width: auto; min-height: calc(100svh - clamp(18rem, 52svh, 34rem) + 1.25rem); margin: -1.25rem 0 0;
    padding: 1.3rem var(--gutter) 1.5rem; gap: 1.1rem; justify-content: flex-start; border-radius: 26px 26px 0 0;
    background: radial-gradient(120% 15rem at 50% 0, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%), #131116;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 -12px 30px rgba(0, 0, 0, 0.4);
  }
  .panel::before, .panel::after { display: none; }
  .panel header { display: contents; }
  h1 { position: absolute; z-index: 4; top: 0.8rem; left: var(--gutter); right: var(--gutter); font-size: 1.0625rem; pointer-events: none; }
  .pitch { order: 3; margin: 0; font-size: 0.9375rem; }
  .signup { order: 1; }
  .fine { order: 4; }

  /* the consoles become a tray of chips that scrolls sideways */
  .pick { padding-bottom: 4.7rem; }
  .pick legend { margin-bottom: 0.55rem; }
  .opts { display: flex; gap: 2px; overflow-x: auto; border-radius: 999px; scrollbar-width: none; scroll-padding-inline: 2.5rem; overscroll-behavior-x: contain; }
  .opts::-webkit-scrollbar { display: none; }
  .thumb { flex: none; width: 0; height: auto; margin-right: -2px; }
  .drop { border-radius: 999px; }
  .opt, .opt:hover:not(:has(input:checked)) { flex: none; display: block; position: static; padding: 0.62rem 0.95rem; border-radius: 999px; white-space: nowrap; background: none; }
  .opt + .opt::before { display: none; }
  .opt .wide { display: none; }
  .opt .tight { display: inline; }
  .opt input { position: fixed; left: -200vw; width: 1px; height: 1px; inset: auto; }
  /* the chosen console's name and line sit under the tray, where they don't scroll with it */
  .opt-detail { display: none; position: absolute; left: 0.3rem; right: 0.3rem; bottom: 0; height: 4.1rem; color: var(--ink); white-space: normal; }
  .opt:has(input:checked) .opt-detail { display: block; }
  .opt-name, .opt:has(input:checked) .opt-name { display: block; font-size: 0.8125rem; color: var(--accent); }
  .opt-line, .opt:has(input:checked) .opt-line { display: block; margin-top: 0.1rem; color: var(--dim); }
  .join { margin-top: 0.9rem; }
  .joined { margin-top: 0.9rem; }
}
@media (max-width: 360px) { .go { padding-inline: 0.8rem; } .seg ol button { padding-inline: 0.45rem; } }

/* ---------------------------------------------------------------- without the room, or without the glass */

/* No JavaScript, or no WebGL: the poster stands in, and the list and the form work as they are. */
html:not(.is-3d) .hotspot, html:not(.is-3d) .decades, html:not(.is-3d) .back { display: none; }

/* A browser that can't blur what's behind a pane, or a person who has asked for less
   see-through: the panes are nearly solid instead, so the words stay readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(26, 24, 30, 0.9); }
  .panel { --tint: rgba(17, 15, 20, 0.94); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: rgba(26, 24, 30, 0.94); }
  .panel { --tint: rgba(17, 15, 20, 0.97); }
  :is(.panel, .seg, .step, .back, .hotspot-tag)::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --dim: var(--ink); --line: rgba(255, 255, 255, 0.4); --glass: rgba(14, 13, 17, 0.86); }
  .panel { --tint: rgba(12, 11, 14, 0.94); }
  :is(.panel, .seg, .step, .back, .hotspot-tag)::after { background: rgba(255, 255, 255, 0.7); }
}

@media (prefers-reduced-motion: reduce) {
  html, #view, .opt, .go, .back, .step, .drop, .hotspot-tag, .hotspot::before, .seg ol button { transition: none; }
  .go:active, .back:active, .step:active:not(:disabled), .hotspot:hover .hotspot-tag, .hotspot:active .hotspot-tag, .seg.held .drop { scale: none; }
  .hotspot:not(.used, .away)::after { animation: none; opacity: calc(var(--shown) * 0.5); inset: -12px; }
}

/* ---------------------------------------------------------------- the privacy page */

.doc { max-width: 40rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.doc h1 { font-size: 1.6rem; }
.doc h2 { margin: 2rem 0 0.4rem; font: 400 1rem/1.3 var(--plate); color: var(--accent); }
.doc p, .doc li { color: var(--dim); }
.doc .summary { color: var(--ink); font-size: 1.0625rem; }
.doc .updated { color: var(--dim); font-size: 0.875rem; margin: 0.5rem 0 1.5rem; }
.doc .home { display: inline-block; margin-bottom: 2rem; font-size: 0.875rem; color: var(--dim); }
