@font-face {
  font-family: 'Aftermath Anton'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/welcome/anton.woff2') format('woff2');
}
@font-face {
  font-family: 'Aftermath Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/welcome/dm-sans.woff2') format('woff2');
}
@font-face {
  font-family: 'Aftermath Mono'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url('/welcome/jetbrains-mono.woff2') format('woff2');
}

/* Suspend rendering the dashboard behind the full-screen intro. */
#pile-driver-intro[open] ~ .shell { display: none; }
.shell:has(.aftermath:not([hidden])) { display: block; }
.shell:has(.aftermath:not([hidden])) > .spine { display: none; }
.aftermath {
  --gold: #ffda91; --focus: #fff0cd; --dim: #ebe1d4;
  --title-face: 'Aftermath Anton', Impact, 'Arial Narrow Bold', sans-serif;
  --mono-face: 'Aftermath Mono', Menlo, monospace;
  position: relative; isolation: isolate; overflow: hidden; box-sizing: border-box;
  min-height: 100vh; min-height: 100svh; padding: clamp(44px, 7vh, 96px) clamp(24px, 5vw, 90px);
  display: grid; align-items: center; color: #fff; color-scheme: dark;
  background: #201b19 url('/welcome/hasidic-circle.webp?v=4') center / cover no-repeat;
  font: 400 16px/1.45 'Aftermath Sans', 'Helvetica Neue', Arial, sans-serif;
}
#welcome-dance, .welcome-gold-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
}
.welcome-gold-frame { overflow: hidden; container-type: size; }
#welcome-gold {
  /* Project the coin region onto the same cover crop as the 1280×720 film. */
  --pixel: max(calc(100cqw / 1280), calc(100cqh / 720));
  position: absolute; width: calc(420 * var(--pixel)); height: auto;
  left: calc(50cqw - 100 * var(--pixel)); top: calc(50cqh - 360 * var(--pixel));
}
#welcome-dance { opacity: 0; }
#welcome-dance.playing { opacity: 1; }
.aftermath::before {
  z-index: 1; content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(13 13 17 / .9), rgb(13 13 17 / .78) 33%, rgb(13 13 17 / .23) 67%, rgb(13 13 17 / .08));
}
.aftermath-content {
  position: relative; z-index: 2; width: min(50vw, 720px); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: clamp(13px, 2.5vh, 24px);
}
.aftermath[inert] .aftermath-content { visibility: hidden; }
.aftermath h1 {
  margin: 0; font: 400 clamp(46px, 6.6vw, 104px)/.9 var(--title-face); color: #fff9ee;
  text-transform: uppercase; transform: skewX(-8deg); letter-spacing: 0;
  text-shadow: 0 3px 0 #65401e, 0 6px 20px rgb(0 0 0 / .65);
}
.aftermath h1 span { display: block; white-space: nowrap; }
.aftermath h1 span + span { font-size: 1.873em; margin-top: .05em; }
.aftermath-tagline { margin: 10px 0 0; color: #fff; font: 400 clamp(19px, 2.7vw, 39px)/1.15 var(--title-face); letter-spacing: .005em; text-wrap: balance; text-shadow: 0 2px 6px #15100d; }
.aftermath-status { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--gold); font: 500 clamp(12px, 1.5vw, 15px)/1.4 var(--mono-face); text-shadow: 0 1px 4px #17110c, 0 0 10px #ffb447b3, 0 0 20px #f4aa3b80; }
.aftermath-status span { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 5px #ffedcc, 0 0 13px 3px #f9ac49ad; }
.aftermath-access { position: relative; z-index: 2; width: 100%; max-width: 620px; margin-top: 5px; }
.aftermath button { color: inherit; }
.aftermath :is(button, input, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.welcome-modes { display: flex; gap: 22px; justify-content: center; margin-bottom: 10px; }
.welcome-modes button, .welcome-link, .welcome-guest { min-height: 42px; padding: 5px 2px; background: none; border: 0; }
.welcome-modes button { position: relative; font: 700 13px/1.2 var(--mono-face); color: var(--dim); }
.welcome-modes button[aria-pressed='true'] { color: var(--gold); }
.welcome-modes button[aria-pressed='true']::after { content: ''; position: absolute; inset: auto 2px 4px; height: 2px; background: var(--gold); }
.aftermath form { text-align: left; }
.welcome-confirmation { display: flex; align-items: center; gap: 10px; width: fit-content; min-height: 44px; margin-bottom: 5px; color: #fff6e7; cursor: pointer; }
.welcome-confirmation input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.welcome-label { display: block; margin: 0 0 7px; color: var(--dim); font: 700 12px/1.4 var(--mono-face); text-transform: uppercase; letter-spacing: .14em; }
.welcome-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.welcome-field { flex: 1 1 210px; min-width: 0; }
.aftermath .welcome-fields input {
  width: 100%; height: 60px; padding: 0 18px; border: 2px solid #a58e70; border-radius: 4px;
  color: #fff; background: #1a1818; font: 500 18px/1.2 'Aftermath Sans', Arial, sans-serif;
}
.aftermath .welcome-fields input::placeholder { color: #c4b9ab; }
.welcome-button-glow { display: flex; flex: 1 0 auto; }
form[data-password] .welcome-button-glow { flex-basis: 100%; }
#welcome-form[data-start] .welcome-button-glow {
  filter: drop-shadow(0 0 4px #ffe2a9) drop-shadow(0 0 13px #e8a039ad);
}
@media (prefers-reduced-motion: no-preference) {
  #welcome-form[data-start] .welcome-button-glow { animation: welcome-button-pulse 2.2s ease-in-out infinite alternate; }
  .aftermath-status span { animation: welcome-status-pulse 1.6s ease-in-out infinite alternate; }
}
@keyframes welcome-button-pulse {
  to { filter: drop-shadow(0 0 6px #ffe8b9) drop-shadow(0 0 21px #ffaf40); }
}
@keyframes welcome-status-pulse { to { opacity: .57; } }
.welcome-button-glow:focus-within { outline: 3px solid #fff; outline-offset: 4px; }
.aftermath .welcome-submit { flex: 1; height: 60px; padding: 0 32px; border: 0; border-radius: 0; color: #241710; background: var(--gold); font: 400 26px/1 var(--title-face); text-transform: uppercase; letter-spacing: .03em; clip-path: polygon(16px 0, 100% 0, calc(100% - 16px) 100%, 0 100%); }
.aftermath .welcome-submit:hover { filter: brightness(1.08); }
.aftermath .welcome-submit:disabled { background: #b5a58c; }
.welcome-code-hint { color: #f0e8dc; font-size: 15px; margin: 0 0 12px; overflow-wrap: anywhere; }
.aftermath #lock-status { color: #ffc1cd; font-size: 14px; font-weight: 500; margin: 11px 0 0; }
.aftermath #lock-status:empty { display: none; }
.welcome-code-actions { display: flex; justify-content: space-between; }
.aftermath .welcome-link { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
.aftermath .welcome-guest { display: block; margin: 10px auto 0; color: #fff6e7; font: 600 15px/1.4 'Aftermath Sans', Arial, sans-serif; }
.welcome-guest span { margin-left: 4px; color: var(--gold); }
.aftermath :is(.welcome-link, .welcome-guest, .welcome-modes button):hover { color: var(--focus); }
@media (max-width: 900px) {
  .aftermath { justify-items: center; }
  .aftermath::before {
    background: linear-gradient(180deg, rgb(13 13 17 / .35), rgb(13 13 17 / .6) 30%, rgb(13 13 17 / .84) 75%, rgb(13 13 17 / .72));
  }
  .aftermath-content { width: min(100%, 620px); }
}
@media (max-width: 620px) {
  .aftermath {
    --photo-height: clamp(225px, 69vw, 420px);
    padding: clamp(118px, 35vw, 205px) 20px 44px;
    background-color: #191616;
    background-image: linear-gradient(to bottom, transparent 46%, #191616), url('/welcome/hasidic-circle.webp?v=4');
    background-position: center top, 63% top;
    background-size: 100% var(--photo-height), auto var(--photo-height);
  }
  .aftermath::before {
    background: linear-gradient(to bottom, transparent, rgb(13 13 17 / .12) var(--photo-height));
  }
  #welcome-dance, .welcome-gold-frame {
    height: var(--photo-height); object-position: 63% top;
    mask-image: linear-gradient(to bottom, #000 46%, transparent);
  }
  #welcome-gold { left: calc(63cqw - 266.4 * var(--pixel)); top: 0; }
  .aftermath h1 { font-size: clamp(38px, 11vw, 68px); }
  .aftermath-tagline { max-width: 24em; }
  .aftermath .welcome-submit { padding-inline: 19px; font-size: 22px; }
  .welcome-button-glow { flex: 1 0 auto; }
}
@media (max-width: 420px) {
  .welcome-fields { flex-direction: column; align-items: stretch; }
  .welcome-field, form[data-password] .welcome-button-glow { flex: none; }
  .aftermath .welcome-fields input, .aftermath .welcome-submit { height: 52px; }
}
