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

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

/* ---------- 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, #start { animation: fadeUp 0.8s cubic-bezier(.2,.7,.2,1) both; }
.lede { animation-delay: 0.7s; }
#start { animation-delay: 1.05s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

@keyframes bump { 50% { transform: scale(1.35); } }

/* The start button doubles as the auto-start countdown: a darker band
   sweeps across it; the seconds left are in the line under it. */
.btn-rec { position: relative; overflow: hidden; isolation: isolate; }
.btn-rec::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(20, 8, 5, 0.18); transform-origin: left; transform: scaleX(var(--auto, 0));
}

/* ---------- 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 22px; font-family: var(--mono); font-size: clamp(22px, 4.4vw, 30px); font-weight: 600; color: var(--ink); }
.boot-title::before { content: '$ '; color: var(--red); }
.boot-lines { font-family: var(--mono); font-size: clamp(15px, 2.4vw, 18px); line-height: 2.05; color: var(--ink); 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(--green); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.boot-lines .val.hot { color: var(--red); }
/* Phones: the value drops onto its own line under the label, in full. */
@media (max-width: 560px) {
  .boot-lines { line-height: 1.5; }
  .boot-lines div { display: grid; grid-template-columns: 2.2em 1fr; column-gap: 10px; margin-bottom: 10px; }
  .boot-lines .val { grid-column: 2; margin-left: 0; max-width: none; text-align: left; white-space: normal; overflow: visible; }
}
.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; }

/* ---------- why this exists ---------- */
.why { margin: 8px 0 40px; padding: 26px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); }
.why h3 { margin: 0 0 14px; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 4.4vw, 38px); line-height: 1.05; letter-spacing: 0.01em; color: var(--ink); text-wrap: balance; }
.why > p { margin: 0 0 20px; color: var(--ink-2); }
.why b { color: var(--ink); }
.why-actions { margin: 0; }
.evidence { margin-top: 20px; }
.evidence-intro { margin: 0 0 12px; font-family: var(--mono); font-size: 14px; color: var(--dim); }
.evidence table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 14px; }
.evidence th { text-align: left; padding: 8px 10px; font-size: 14px; color: var(--dim); border-bottom: 1px solid var(--line); }
.evidence td { padding: 9px 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
.evidence td:first-child { color: var(--ink); width: 42%; }
.evidence td:last-child { color: var(--dim); word-break: break-word; }
@media (max-width: 480px) {
  .why { padding: 20px 16px; }
  .evidence td { display: block; width: auto !important; padding: 4px 0; border: 0; }
  .evidence tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .evidence thead { display: none; }
}

/* ---------- top bar: say plainly it's theatre ---------- */
.rec-note { margin-left: 8px; color: var(--dim); text-transform: none; letter-spacing: 0.02em; }
@media (max-width: 480px) { .rec-note { display: none; } }

/* ---------- after the scan: choose ---------- */
.boot-choice { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; animation: fadeUp 0.5s both; }
.boot-choice[hidden] { display: none; }
.boot-choice p { flex-basis: 100%; margin: 0 0 6px; font-family: var(--sans); font-size: 19px; font-weight: 600; color: var(--ink); }
.dim-note { font-weight: 400; opacity: 0.75; }
@media (max-width: 480px) { .boot-choice .btn { flex: 1 1 100%; } }
/* a skip control people can actually see */
#ffBtn { font-weight: 600; color: var(--ink); }
#ffBtn[aria-pressed="true"] { border-color: var(--green); color: var(--green); }
#skipBtn { border-color: var(--red); color: #ffb3a8; background: var(--red-dim); font-weight: 600; }

/* ---------- fact vs joke ---------- */
.reading {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px;
  font-family: var(--mono); font-size: 15px; color: var(--dim);
}
.line .reading b { color: var(--green); font-weight: 600; background: none; }
.reading.opinion, .line .reading.opinion b { color: #ffb3a8; }
.line:has(.reading) > span:not(.reading):not(.caret):not(.receipt) { color: var(--ink); }

/* ---------- 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); } }
.card-wrap, #verdict .actions { animation: fadeUp 0.7s cubic-bezier(.2,.7,.2,1) both; }
.card-wrap { animation-delay: 1.35s; }
#verdict .actions { animation-delay: 1.6s; }

.card-wrap { perspective: 1200px; }
.card-wrap img {
  border: 0;
  transition: opacity 0.25s;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line);
}
.card-wrap.status { width: fit-content; max-width: 100%; margin-inline: auto; }
.card-wrap.status img { width: auto; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.card-wrap img.swap { opacity: 0.2; }

/* the verdict stamp (js/verdict.js slamStamp) */
.verdict-stamp {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: fit-content; max-width: 100%; margin: 26px 0 40px 6px; padding: 10px 20px;
  border: 5px solid var(--red); border-radius: 12px; color: var(--red); transform: rotate(-7deg);
  font-family: var(--mono); text-transform: uppercase;
}
.verdict-stamp span { font-size: 14px; letter-spacing: 0.2em; }
.verdict-stamp b { text-transform: none; font-family: var(--display); font-size: clamp(26px, 4.6vw, 36px); text-align: center; font-weight: 400; line-height: 1; letter-spacing: 0.02em; }
.verdict-stamp i { font-style: normal; font-size: 18px; letter-spacing: 0.2em; }
.verdict-stamp.slam { animation: stampSlam 0.42s cubic-bezier(.5,0,.75,0) both; }
@keyframes stampSlam {
  0% { opacity: 0; transform: translateY(-40px) scale(3) rotate(-24deg); filter: blur(4px); }
  85% { opacity: 1; transform: scale(0.94) rotate(-7deg); filter: none; }
  100% { transform: scale(1) rotate(-7deg); }
}
.jolt main { animation: jolt 0.35s steps(4, end); }
@keyframes jolt { 25% { transform: translate(-6px, 4px); } 50% { transform: translate(5px, -3px); } 75% { transform: translate(-2px, 2px); } }

@media (prefers-reduced-motion: reduce) { .verdict-stamp.slam, .jolt main { animation: none; } }

/* A Mac terminal window around the scan and the story: the title bar with
   the three traffic-light buttons, a title, and a lifted dark window. */
.term {
  position: relative; padding: 64px 28px 28px; border: 1px solid #2f2a26; border-radius: 12px;
  background: #100f0e; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.term::before {
  content: ''; position: absolute; top: 16px; left: 18px; width: 12px; height: 12px; border-radius: 50%;
  background: #ff5f57; box-shadow: 20px 0 0 #febc2e, 40px 0 0 #28c840;
}
.term::after {
  content: attr(data-title); position: absolute; top: 0; left: 0; right: 0; height: 44px; line-height: 44px;
  border-bottom: 1px solid #2a2622; border-radius: 12px 12px 0 0; background: #181614;
  font-family: var(--mono); font-size: 13px; color: var(--dim); text-align: center; z-index: -1;
}
.term { isolation: isolate; }
@media (max-width: 560px) {
  .term { padding: 56px 16px 20px; margin: 0 -8px; }
  .term::after { font-size: 12px; }
}

.top-share { display: flex; width: fit-content; margin: 6px 0 28px; animation: fadeUp 0.5s cubic-bezier(.2,.7,.2,1) both; }

/* Phones: tighter type and spacing, so less scrolling through empty space. */
@media (max-width: 560px) {
  h1 { font-size: clamp(38px, 12vw, 52px); margin-bottom: 16px; }
  .lede { font-size: 16px; margin-bottom: 24px; }
  #story { padding: 64px 0 120px; }
  #verdict { padding: 64px 0 100px; }
  .chapter { margin: 36px 0 14px; font-size: 22px; }
  .line { font-size: 15px; line-height: 1.55; margin-bottom: 14px; }
  .reading { font-size: 13px; }
  .verdict-name { font-size: clamp(40px, 13vw, 60px); }
  .verdict-blurb { font-size: 16px; }
  .verdict-stamp { margin: 16px 0 24px 4px; padding: 8px 14px; }
  .verdict-stamp b { font-size: 26px; }
  .card-wrap { margin-bottom: 16px; }
  .card-wrap.status img { max-height: 70vh; }
  .why { padding: 20px 16px; }
}
