:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #08090a;
  color: #c7c6c2;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 50% 43%, #151618 0%, #0b0c0d 48%, #050506 100%);
}

/* Decorative layers stay behind the content and never affect page layout. */
.ambient-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, #16191d 0%, transparent 62%),
    radial-gradient(ellipse at 12% 20%, #121b23 0%, transparent 55%),
    linear-gradient(135deg, #060709, #0e1013 48%, #040506);
  transition: opacity 800ms ease;
}

.ambient-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 65% 25%, #576575, transparent 75%);
  opacity: 0.015;
  animation: monitor-breathe 48s ease-in-out infinite;
}

.ambient-feed {
  position: absolute;
  inset: 6% 5%;
  opacity: 0.11;
  filter: blur(4px);
  /* Fade the interface completely out around the countdown. */
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 30%, transparent 70%, #000);
  mask-image: linear-gradient(90deg, #000, transparent 30%, transparent 70%, #000);
}

.ambient-feed::before,
.ambient-feed::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  border: 1px solid #555f6c;
  border-radius: 8px;
  background:
    radial-gradient(circle at 22px 25px, #7d8794 0 9px, transparent 10px) 0 0 / 100% 156px repeat-y,
    linear-gradient(#77818d, #77818d) 45px 20px / 38% 5px no-repeat,
    repeating-linear-gradient(180deg, transparent 0 51px, #515c69 52px 53px, transparent 54px 66px, #515c69 67px 68px, transparent 69px 155px, #697380 156px);
}

.ambient-feed::before { left: 0; }
.ambient-feed::after { right: 0; top: 42px; }

.audio-hint {
  position: fixed;
  z-index: 3;
  right: 0;
  bottom: max(52px, calc(env(safe-area-inset-bottom) + 25px));
  left: 0;
  margin: 0;
  text-align: center;
  color: #6d7278;
  font-size: 10px;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.eyebrow, .caption, .divider { transition: opacity 800ms ease; }
.is-final-seconds .eyebrow,
.is-final-seconds .caption,
.is-final-seconds .divider,
.is-final-seconds .footer,
.is-final-seconds .ambient-background,
.is-final-seconds::before,
.is-final-seconds::after { opacity: 0; }
.is-final-seconds::before,
.is-final-seconds .ambient-background::after { animation-play-state: paused; }

@keyframes monitor-breathe {
  0%, 55%, 100% { opacity: 0.015; }
  78% { opacity: 0.045; }
}

@keyframes grain-drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(-1%, -1%); }
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  transition: opacity 800ms ease;
}

body::before {
  z-index: 2;
  inset: -2%;
  opacity: 0.022;
  animation: grain-drift 9s steps(1, end) infinite;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23noise)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

body::after {
  z-index: 1;
  background: radial-gradient(ellipse at 50% 43%, transparent 22%, #000b 100%),
    repeating-linear-gradient(0deg, transparent 0 3px, #00000012 3px 4px);
}

.scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 72px 20px 110px;
  text-align: center;
}

.countdown-panel {
  width: 100%;
  max-width: 920px;
  transition: opacity 800ms ease;
}

.eyebrow {
  margin: 0 0 33px;
  color: #777a7c;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  padding-left: 0.24em;
  font-size: clamp(34px, 7vw, 62px);
  font-weight: 400;
  letter-spacing: 0.24em;
  line-height: 1.2;
}

.divider {
  width: 28px;
  height: 1px;
  margin: 34px auto;
  background: #414345;
}

.timer {
  margin: 0;
  color: #deddd8;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(30px, 8.3vw, 88px);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
  line-height: 1.2;
  white-space: nowrap;
}

.caption {
  margin: 24px 0 0;
  color: #929395;
  font-size: 12px;
  letter-spacing: 0.05em;
  line-height: 1.7;
}

.whisper-space {
  height: 16.5px;
  margin: 30px 0 0;
}

.whisper {
  position: absolute;
  top: 20px;
  left: 16px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: min(360px, calc(100% - 32px));
  padding: 16px;
  border: 1px solid #373a3e;
  border-radius: 8px;
  background: #1c1e21;
  color: #e6e7e8;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.post-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  background: #44545c;
  color: #f0f1f2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.post-content { flex: 1; min-width: 0; }
.post-header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.post-identity { min-width: 0; }
#post-name { display: block; font-size: 13px; font-weight: 700; }
.post-handle { display: block; overflow-wrap: anywhere; }
.post-handle, #post-time { color: #989da4; font-size: 11px; }
#post-time { flex-shrink: 0; }
.post-text { margin: 10px 0 12px; overflow-wrap: anywhere; }
.post-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #303338;
  color: #969ca3;
  font-size: 10px;
}
.post-actions span { display: inline-flex; align-items: center; gap: 5px; }
.post-actions svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.whisper.is-visible { opacity: 1; transform: translateY(0); }
@media (max-width: 600px) {
  .whisper { width: calc(100% - 32px); }
}
.is-flickering h1 { animation: flicker 150ms linear; }

@keyframes flicker {
  0%, 100% { opacity: 1; }
  35%, 65% { opacity: 0.55; }
}

.footer {
  position: fixed;
  right: 0;
  bottom: max(27px, env(safe-area-inset-bottom));
  left: 0;
  text-align: center;
  color: #727577;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity 800ms ease;
}

.status-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 9px 2px 0;
  border-radius: 50%;
  background: #696d70;
}

.ending {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  padding: 30px;
  background: #000;
  color: #aaa9a6;
  font-size: clamp(14px, 3.4vw, 19px);
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1.9;
  opacity: 0;
  transition: opacity 800ms ease;
}

.ending.is-visible { animation: reveal 1800ms ease both; }
#ending-message { margin: 0; }
#entry-slot { height: 68px; padding-top: 24px; }

.enter-link {
  display: inline-block;
  min-height: 44px;
  padding: 10px 18px;
  color: #aaa9a6;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-decoration: none;
  animation: enter-reveal 1400ms ease both;
}

.enter-link:hover { color: #deddd8; }
.enter-link:focus-visible { outline: 1px solid #929395; outline-offset: 3px; }
@keyframes enter-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes reveal {
  from { color: transparent; }
  to { color: #aaa9a6; }
}

/* Stage hooks are intentionally unstyled until the later stages are designed:
   .state-under-6-hours, .state-under-3-hours, .state-under-1-hour,
   .state-under-10-minutes, .state-under-1-minute. */
.state-finished .timer { display: none; }
.state-finished .countdown-panel,
.state-finished .footer,
.state-finished .ambient-background,
.state-finished::before,
.state-finished::after { opacity: 0; }
.state-finished .countdown-panel { visibility: hidden; }
.state-finished .ending { opacity: 1; }

.noscript { color: #929395; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
