:root {
  --accent: #ff8a3d;
  --ink: #f4efe4;
  --dim: rgba(240, 235, 225, 0.62);
  --faint: rgba(255, 255, 255, 0.4);
  --serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --mono: "Courier New", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: var(--ink);
  overflow: hidden;
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

#hud::before,
#hud::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 16vh;
  pointer-events: none;
}
#hud::before { top: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0)); }
#hud::after { bottom: 0; background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0)); }

.top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 30px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  padding-top: 4px;
}
.brand svg {
  width: 15px;
  height: 15px;
  fill: var(--accent);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent));
  transition: fill 0.8s ease;
}

.yearwrap {
  text-align: right;
  line-height: 1;
}
.yearwrap .ylab {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
#year {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(22px, 3.4vw, 46px);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}

#titleBlock {
  position: absolute;
  left: 30px;
  bottom: 118px;
  max-width: min(46ch, 60vw);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
#hud.card #titleBlock {
  opacity: 0;
  transform: translateY(16px);
}

#kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
  transition: color 0.9s ease;
}
#title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 5.6vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--ink);
  text-shadow: 0 3px 40px rgba(0, 0, 0, 0.75);
}
#caption {
  font-size: clamp(13px, 1.35vw, 16px);
  line-height: 1.5;
  margin: 0;
  color: var(--dim);
  max-width: 40ch;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}

#titleBlock.anim #kicker { animation: fadeUp 0.7s ease both; }
#titleBlock.anim #title { animation: riseIn 0.95s cubic-bezier(0.16, 1, 0.3, 1) both; }
#titleBlock.anim #caption { animation: fadeUp 1.1s ease 0.14s both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(26px); filter: blur(7px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 30px 20px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.controls button {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 18, 24, 0.42);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.86);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.15s ease, background 0.25s ease;
}
.controls button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(28, 28, 34, 0.6);
}
.controls button:active { transform: scale(0.92); }
.controls button svg { width: 18px; height: 18px; fill: currentColor; }
.controls button.on { color: var(--accent); border-color: var(--accent); }
#counter {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--faint);
  margin-left: 8px;
  min-width: 74px;
}

#track {
  pointer-events: auto;
  position: relative;
  height: 42px;
  cursor: pointer;
  touch-action: none;
}
#track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 20px;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}
#fill {
  position: absolute;
  left: 0;
  top: 19.5px;
  height: 2px;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: background 0.9s ease;
}
#head {
  position: absolute;
  top: 12px;
  left: 0;
  width: 2px;
  height: 17px;
  background: #fff;
  box-shadow: 0 0 14px var(--accent), 0 0 4px #fff;
  transform: translateX(-1px);
}
#markers { position: absolute; inset: 0; }
.marker {
  position: absolute;
  top: 20px;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.marker i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.34);
  transition: all 0.3s ease;
}
.marker b {
  position: absolute;
  top: 17px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  font-weight: 400;
  color: var(--faint);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.marker:hover i { background: #fff; transform: scale(1.3); }
.marker:hover b { opacity: 1; }
.marker.active i {
  background: var(--accent);
  transform: scale(1.5);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.marker.active b { opacity: 1; color: var(--accent); }

#hint {
  margin-top: 2px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
  transition: opacity 1.2s ease;
}
#hint.hidden { opacity: 0; }

#endcard {
  position: absolute;
  left: 50%;
  bottom: 26vh;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease, transform 0.9s ease;
}
#endcard.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#btnReplay {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 13px 26px;
  color: var(--ink);
  background: rgba(18, 18, 24, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}
#btnReplay:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 40%, transparent);
}

@media (max-width: 700px) {
  .top { padding: 16px 18px 0; }
  .bottom { padding: 0 16px 14px; }
  #titleBlock { left: 18px; bottom: 104px; max-width: 78vw; }
  .brand { letter-spacing: 0.3em; font-size: 10px; }
  #counter { display: none; }
  .controls button { width: 34px; height: 34px; }
}
