/* Motion and the pieces added with it. Loaded after style.css. */

.progress { margin-left: auto; color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---------- intro: the data leaking behind the headline ---------- */
.leak {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  display: flex; justify-content: space-around; gap: 24px; padding: 0 12px;
  font-family: var(--mono); font-size: 12px; line-height: 2.1; color: var(--ink);
  opacity: 0; transition: opacity 1.2s;
  -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
          mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
}
.leak.on { opacity: 0.075; }
.started .leak { opacity: 0 !important; }
.leak-col { white-space: nowrap; animation: leak var(--d, 40s) linear infinite; }
.leak-col:nth-child(2n) { padding-top: 120px; }
@keyframes leak { to { transform: translateY(-50%); } }
@media (max-width: 640px) { .leak-col:nth-child(n+3) { display: none; } }
main { position: relative; z-index: 1; }

/* ---------- intro: the mouse tracker ---------- */
.reticle {
  position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 1px solid rgba(255, 75, 54, 0.7); border-radius: 50%;
  opacity: 0; transition: opacity 0.3s, width 0.2s, height 0.2s, margin 0.2s;
}
.reticle::before, .reticle::after { content: ''; position: absolute; background: rgba(255, 75, 54, 0.7); }
.reticle::before { left: 50%; top: -8px; bottom: -8px; width: 1px; }
.reticle::after { top: 50%; left: -8px; right: -8px; height: 1px; }
.reticle span {
  position: absolute; left: 34px; top: 30px; white-space: nowrap;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: #ffb3a8;
}
.reticle.on { opacity: 1; }
.reticle.lock { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--red); }
.started .reticle { display: none; }
@media (hover: none), (pointer: coarse) { .reticle { display: none; } }

/* ---------- intro: headline and counter ---------- */
h1 .w { display: inline-block; animation: wordIn 0.8s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
@keyframes wordIn { from { opacity: 0; transform: translateY(0.4em); filter: blur(8px); } }
h1 em .w { animation: wordIn 0.8s cubic-bezier(.2,.7,.2,1) both, glitch 0.25s steps(2) 1.7s 3; animation-delay: calc(var(--i) * 70ms + 150ms), 1.7s; }
@keyframes glitch {
  0% { text-shadow: 3px 0 #ff4b36, -3px 0 #38e1ff; }
  50% { text-shadow: -4px 1px #ff4b36, 2px -1px #38e1ff; }
  100% { text-shadow: none; }
}
.lede, .found, #start, .fine { animation: fadeUp 0.8s cubic-bezier(.2,.7,.2,1) both; }
.lede { animation-delay: 0.7s; }
.found { animation-delay: 0.9s; }
#start { animation-delay: 1.05s; }
.fine { animation-delay: 1.2s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

.found { margin: -14px 0 22px; font-family: var(--mono); font-size: 13.5px; color: var(--dim); }
.found b { color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; display: inline-block; min-width: 1.4em; }
.found b.bump { animation: bump 0.25s; }
@keyframes bump { 50% { transform: scale(1.35); } }

.btn-rec { position: relative; }
.btn-rec::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit;
  border: 2px solid var(--red); opacity: 0; pointer-events: none;
  animation: ring 2.2s ease-out 2s infinite;
}
@keyframes ring { 0% { opacity: 0.8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12, 1.45); } }

/* ---------- scanning sequence ---------- */
#boot { min-height: 100vh; min-height: 100dvh; padding: 120px 0 80px; flex-direction: column; justify-content: center; }
#boot.is-on { display: flex; }
#boot.is-on::before {
  content: ''; position: fixed; left: 0; right: 0; top: 0; height: 120px; z-index: 0; pointer-events: none;
  background: linear-gradient(transparent, rgba(255, 75, 54, 0.10), transparent);
  animation: scan 1.4s linear infinite;
}
@keyframes scan { from { transform: translateY(-120px); } to { transform: translateY(100vh); } }
.boot-title { margin: 0 0 18px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.boot-lines { font-family: var(--mono); font-size: clamp(13.5px, 2.2vw, 16px); line-height: 2.05; color: var(--ink-2); min-height: 17em; }
.boot-lines div { display: flex; gap: 12px; animation: fadeUp 0.25s both; }
.boot-lines div span:first-child { color: var(--dim); min-width: 2.2em; }
.boot-lines .val { margin-left: auto; color: var(--ink); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.boot-lines .val.hot { color: var(--red); }
.boot-bar { height: 3px; margin-top: 24px; background: var(--line); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--red); box-shadow: 0 0 12px var(--red); transition: width 0.25s; }

/* ---------- story motion ---------- */
.line { animation: lineIn 0.35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes lineIn { from { opacity: 0; transform: translateY(8px); } }
.line b {
  background: linear-gradient(transparent 64%, rgba(255, 75, 54, 0.32) 0) no-repeat;
  background-size: 0% 100%;
  transition: background-size 0.7s cubic-bezier(.2,.7,.2,1);
}
.line.done b { background-size: 100% 100%; }
.chapter::after { transform-origin: left; animation: draw 0.9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes draw { from { transform: scaleX(0); } }
.line.aside { animation: lineIn 0.3s both, shake 0.45s 0.05s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.meter { animation: fadeUp 0.5s both; }
.meter.suspense .meter-track { animation: pulse 0.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 75, 54, 0.25); } }
.meter-wait { margin: 14px 0 0; font-size: 13px; color: var(--dim); }
.meter-wait::after { content: '...'; display: inline-block; width: 1.4em; overflow: hidden; vertical-align: bottom; animation: dots 1s steps(4) infinite; }
@keyframes dots { from { width: 0; } to { width: 1.4em; } }

.flash { position: fixed; inset: 0; z-index: 8; pointer-events: none; background: var(--red); opacity: 0; }
.flash.go { animation: flash 0.6s ease-out; }
@keyframes flash { 0% { opacity: 0.35; } 100% { opacity: 0; } }

/* ---------- verdict motion ---------- */
.verdict-name .w { display: inline-block; animation: slam 0.55s cubic-bezier(.2,1.4,.4,1) both; animation-delay: calc(var(--i) * 140ms + 250ms); }
@keyframes slam { from { opacity: 0; transform: scale(1.9); filter: blur(10px); } }
.verdict-blurb { animation: fadeUp 0.6s 0.8s both; }
.verdict-class { animation: pop 0.5s cubic-bezier(.2,1.6,.4,1) 1.05s both; }
@keyframes pop { from { opacity: 0; transform: scale(0.85) rotate(-2deg); } }
.formats, .card-wrap, .destruct, #verdict .actions { animation: fadeUp 0.7s cubic-bezier(.2,.7,.2,1) both; }
.formats { animation-delay: 1.25s; }
.card-wrap { animation-delay: 1.35s; }
.destruct { animation-delay: 1.5s; }
#verdict .actions { animation-delay: 1.6s; }

.formats { display: flex; gap: 8px; margin: 0 0 14px; }
.formats .chip[aria-pressed="true"] { background: var(--red-dim); border-color: var(--red); color: #ffb3a8; }
.card-wrap { perspective: 1200px; }
.card-wrap img {
  border: 0;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out, opacity 0.25s;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line);
}
.card-wrap.status img { width: auto; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.card-wrap img.swap { opacity: 0.2; }

.destruct { margin: 0 0 22px; font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.destruct span { color: var(--red); animation: blink 1.4s steps(2, start) infinite; }
.actions-quiet { margin-top: -36px; }
.actions-quiet .btn { min-height: 44px; font-size: 13.5px; }
.appeal-result {
  margin: -32px 0 44px; padding: 12px 16px; border-left: 2px solid var(--red);
  font-family: var(--mono); font-size: 14.5px; color: var(--ink);
  animation: lineIn 0.3s both, shake 0.4s;
}

/* ---------- the eyes see you ---------- */
.start-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; animation: fadeUp 0.8s cubic-bezier(.2,.7,.2,1) 1.05s both; }
#start { animation: none; }
.btn-see { gap: 10px; min-height: 58px; color: var(--ink-2); }
.btn-see:hover { color: var(--ink); }
.see-eye { width: 18px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #0c0b0a 0 28%, var(--red) 30% 70%, transparent 72%); box-shadow: 0 0 10px rgba(255, 75, 54, 0.7); }
.see-hint { margin: 14px 0 0; font-family: var(--mono); font-size: 13.5px; color: #ffb3a8; animation: fadeUp 0.4s both; }
.cam-on {
  pointer-events: auto; margin-left: 14px; padding: 4px 10px; border: 1px solid var(--red); border-radius: 999px;
  background: var(--red-dim); color: #ffb3a8; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.cam-on::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--red); vertical-align: 1px; animation: blink 1.2s steps(2, start) infinite; }
@media (max-width: 480px) {
  .start-row { flex-direction: column; align-items: stretch; }
  .btn-see { min-height: 50px; }
  .cam-on { margin-left: 8px; }
}

/* ---------- live ticker ---------- */
.live { margin: -10px 0 22px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--dim); animation: fadeUp 0.6s both; }
#verdict .live { margin: -8px 0 22px; }
.live b { color: var(--ink); font-weight: 600; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; vertical-align: 1px; animation: blink 1.6s steps(2, start) infinite; }
.live-msg { animation: fadeUp 0.4s both; display: inline-block; }

/* ---------- secrets ---------- */
.secrets-count { margin-left: auto; color: #ffb3a8; opacity: 0; transition: opacity 0.6s; }
.started .secrets-count { opacity: 1; }
.progress + .secrets-count, .secrets-count + .progress { margin-left: 14px; }
@media (max-width: 480px) { .progress { display: none !important; } }
.secret-toast {
  position: fixed; left: 50%; top: 56px; z-index: 9; width: max-content; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px;
  border: 1px solid var(--red); border-radius: 14px; background: rgba(21, 19, 17, 0.96);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9), 0 0 24px rgba(255, 75, 54, 0.25);
  font-family: var(--mono); font-size: 13.5px; color: var(--ink);
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  transition: transform 0.35s cubic-bezier(.2,1.4,.4,1), opacity 0.3s;
}
.secret-toast.on { transform: translate(-50%, 0); opacity: 1; }
.secret-toast b { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.secrets-board { margin: 0 0 36px; }
.secrets-board .kicker b { color: var(--ink); }
.secrets-board ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.secrets-board li {
  padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px;
  font-family: var(--mono); font-size: 12px; color: var(--dim);
}
.secrets-board li.got { border-style: solid; border-color: var(--red); background: var(--red-dim); color: #ffb3a8; }
.secrets-hint { margin: 12px 0 0; font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* ---------- duels ---------- */
.duel-banner {
  display: inline-block; margin: 0 0 18px; padding: 8px 14px;
  border: 1px solid var(--red); border-radius: 12px; background: var(--red-dim);
  font-family: var(--mono); font-size: 13.5px; color: #ffb3a8;
  animation: fadeUp 0.7s cubic-bezier(.2,.7,.2,1) 0.4s both;
}
.duel-banner b { color: var(--ink); }
.duel-banner i { font-style: normal; color: var(--ink); }
.line.duel { padding: 12px 14px; border: 1px solid var(--red); border-radius: 12px; background: var(--red-dim); color: var(--ink); }

.duel-result {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px 14px;
  margin: 0 0 28px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2);
  animation: pop 0.5s cubic-bezier(.2,1.6,.4,1) 1.15s both;
}
.duel-result[hidden] { display: none; }
.duel-me, .duel-them { display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); }
.duel-them { text-align: right; }
.duel-me span, .duel-them span { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-me b, .duel-them b { font-family: var(--sans); font-size: 48px; font-weight: 800; line-height: 1; color: var(--ink); }
.duel-me b { color: var(--red); }
.duel-result.lost .duel-me b { color: var(--ink); }
.duel-result.lost .duel-them b { color: var(--red); }
.duel-vs { font-family: var(--mono); font-size: 13px; color: var(--dim); text-transform: uppercase; }
.duel-verdict { grid-column: 1 / -1; margin: 6px 0 0; font-family: var(--mono); font-size: 14px; color: #ffb3a8; text-align: center; }

.dare-name { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; max-width: 360px; font-family: var(--mono); font-size: 12.5px; color: var(--dim); animation: fadeUp 0.7s cubic-bezier(.2,.7,.2,1) 1.55s both; }
.dare-name input {
  min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); color: var(--ink); font: 500 15px var(--mono);
}
.dare-name input:focus { outline: none; border-color: var(--red); }

/* ---------- eyes in the dark ---------- */
.eyes { display: block; pointer-events: none; }
.eyes svg { display: block; width: 100%; height: auto; overflow: visible; }
/* lids, gaze and pupils are driven from js/eyes.js */
.eyes svg { will-change: transform; }

.eyes-hero { width: min(250px, 62vw); margin: 0 0 34px -14px; filter: drop-shadow(0 0 22px rgba(255, 75, 54, 0.35)); }
.eyes-mini { width: 46px; margin-left: 4px; opacity: 0; transition: opacity 0.6s; }
.started .eyes-mini { opacity: 1; }
@media (max-width: 480px) { .eyes-hero { margin-bottom: 26px; } }

/* ---------- mugshot ---------- */
.mug-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 16px; animation: fadeUp 0.7s cubic-bezier(.2,.7,.2,1) 1.3s both; }
.mug-cta p { margin: 0; flex: 1 1 220px; font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.btn-mug { border-color: var(--red); color: #ffb3a8; background: var(--red-dim); }
.btn-mug:hover { border-color: #ff7a66; }
.mug-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1.4s steps(2, start) infinite; }

.mug-dialog {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 22px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--bg); color: var(--ink);
}
.mug-dialog::backdrop { background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(4px); }
.mug-dialog[open] { animation: fadeUp 0.35s cubic-bezier(.2,.7,.2,1); }
.mug-stage { position: relative; aspect-ratio: 504 / 600; max-height: 56dvh; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #140806; }
.mug-stage canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.mug-lines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(12.5% - 1px), rgba(12, 11, 10, 0.45) calc(12.5% - 1px) 12.5%);
}
.mug-count {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--sans); font-weight: 800; font-size: 120px; color: var(--ink); text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}
.mug-count.pop { animation: slam 0.5s cubic-bezier(.2,1.4,.4,1); }
.mug-stage.shot::after { content: ''; position: absolute; inset: 0; background: #fff; animation: shutter 0.5s ease-out forwards; }
@keyframes shutter { from { opacity: 0.9; } to { opacity: 0; } }
.mug-hint { margin: 14px 0; font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); text-align: center; }
.mug-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mug-actions .btn { min-height: 46px; }
.mug-fine { margin: 14px 0 0; font-family: var(--mono); font-size: 11.5px; color: var(--dim); text-align: center; }
