/* ============================================================
   TIGHT KNIT × PANDORA · deck styles
   Aesthetic: CRT transmission · restraint · one color alive
   ============================================================ */

:root {
  --bg: #070707;
  --bg-raise: #0e0e0e;
  --ink: #e8e4dc;
  --muted: #8a857c;
  --line: #262420;
  --accent: #ff2b1f;
  --accent-dim: rgba(255, 43, 31, 0.14);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Archivo", system-ui, -apple-system, sans-serif;
  --chrome-h: 44px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

/* ---------- CRT atmosphere ---------- */
.crt-overlay {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0, 0, 0, 0.14) 3px, rgba(0, 0, 0, 0.14) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.vignette {
  position: fixed; inset: 0; z-index: 49; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,0.5) 100%);
}

/* ---------- chrome (top bar / bottom nav) ---------- */
.chrome {
  position: fixed; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  height: var(--chrome-h);
  padding: 0 clamp(14px, 3vw, 32px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.chrome-top {
  top: 0;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(7,7,7,0.92), rgba(7,7,7,0.75));
  backdrop-filter: blur(6px);
}

.chrome-live { display: flex; align-items: center; gap: 7px; color: var(--accent); }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: blink 1.4s steps(1) infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }

.chrome-bottom {
  bottom: 0;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, rgba(7,7,7,0.95), rgba(7,7,7,0.8));
  backdrop-filter: blur(6px);
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--chrome-h) + env(safe-area-inset-bottom));
}

.nav-center { display: flex; align-items: center; gap: 14px; }

/* ---------- language pill ---------- */
.lang-pill { position: relative; }

.lang-btn {
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.lang-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.caret { font-size: 8px; color: var(--muted); }

.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: none; flex-direction: column;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
.lang-pill.open .lang-menu { display: flex; }

.lang-menu button {
  appearance: none; background: none; border: 0;
  color: var(--ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  padding: 10px 16px;
  text-align: left; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.lang-menu button:hover { background: var(--accent-dim); color: var(--accent); }
.lang-menu button[aria-selected="true"] { color: var(--accent); }

/* ---------- google translate widget: keep its UI out of the frame ---------- */
#google_translate_element { position: fixed; top: -9999px; left: -9999px; height: 0; overflow: hidden; }
iframe.skiptranslate, .goog-te-banner-frame { display: none !important; }
body { top: 0 !important; position: static !important; }
#goog-gt-tt, .goog-tooltip, .goog-tooltip:hover { display: none !important; }
font.goog-text-highlight { background: none !important; box-shadow: none !important; }
/* GT collapses whitespace around inline notranslate islands; restore breathing room */
html.translated-ltr span.notranslate { margin: 0 0.35em; }
html.translated-ltr span.notranslate:first-child { margin-left: 0; }

.nav-btn {
  appearance: none; background: none; border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  padding: 7px 14px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  border-radius: 2px;
  min-width: 44px; min-height: 32px;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.nav-btn:active { transform: translateY(1px); }
.nav-btn[disabled] { opacity: 0.25; pointer-events: none; }

.counter { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 7ch; text-align: center; white-space: nowrap; }
.slide-code { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }

/* ---------- progress ---------- */
.progress {
  position: fixed; top: var(--chrome-h); left: 0; right: 0; z-index: 60;
  height: 2px; background: var(--line);
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width 0.5s var(--ease);
  box-shadow: 0 0 12px var(--accent);
}

/* ---------- deck & slides ---------- */
.deck { position: fixed; inset: 0; }

.slide {
  position: absolute; inset: 0;
  display: none;
  padding: calc(var(--chrome-h) + 2px) 0 calc(var(--chrome-h) + env(safe-area-inset-bottom)) 0;
}
.slide.active { display: block; }

.slide-inner {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(28px, 5vh, 64px) clamp(20px, 6vw, 96px);
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 2.6vh, 28px);
}

/* slide-level entrance: each .reveal staggers in via JS-set --i */
.reveal {
  opacity: 0;
  transform: translateY(18px);
}
.slide.active .reveal {
  animation: rise 0.7s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.slide.active.from-next .reveal { /* navigating backward: quicker, subtler */
  animation-duration: 0.45s;
  animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- type ---------- */
.kicker {
  font-family: var(--mono);
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.22em;
  color: var(--accent);
}

h2 {
  font-weight: 800;
  font-stretch: 110%;
  font-size: clamp(26px, 4.6vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 22ch;
}

h3 { font-size: clamp(18px, 2.2vw, 24px); font-weight: 700; letter-spacing: -0.01em; }

.prose p {
  max-width: 62ch;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.65;
  color: var(--ink);
}
.prose p + p { margin-top: 0.9em; }
.prose em { color: var(--accent); font-style: normal; }

.muted { color: var(--muted); }

.pull {
  border-left: 2px solid var(--accent);
  padding-left: clamp(16px, 2vw, 24px);
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.5;
  max-width: 56ch;
  color: var(--ink);
}
.pull.compact { font-size: clamp(13px, 1.5vw, 16px); max-width: 72ch; }

.parenthetical {
  font-size: clamp(13px, 1.45vw, 15px);
  font-style: italic;
  line-height: 1.55;
  color: var(--muted);
  max-width: 62ch;
}

.footnote {
  font-size: clamp(12px, 1.3vw, 14px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 90ch;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* ---------- cover ---------- */
.slide-cover .slide-inner { align-items: flex-start; }

.cover-title {
  font-weight: 900;
  font-stretch: 115%;
  font-size: clamp(64px, 16vw, 190px);
  line-height: 0.88;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  display: flex; flex-direction: column;
}

.cursor {
  display: inline-block;
  width: 0.55em; height: 0.08em;
  margin-left: 0.06em;
  background: var(--accent);
  vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite;
}

.cover-sub {
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.5;
  max-width: 44ch;
}
.cover-sub strong { color: var(--accent); font-weight: 700; }

.cover-meta {
  font-family: var(--mono);
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.16em;
  line-height: 2;
  text-transform: uppercase;
}

.cover-hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}

/* ---------- image placeholders ("NO SIGNAL") ---------- */
.img-slot {
  position: relative;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(45deg, #0c0c0c 0 8px, #090909 8px 16px);
  min-height: 120px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
}
.img-slot::before {
  content: attr(data-label) " · NO SIGNAL";
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  animation: flicker 3.2s infinite;
  z-index: 2;
  text-align: center;
  padding: 0 10px;
}
.img-slot::after { /* static noise sweep */
  content: "";
  position: absolute; inset: -100% 0 auto 0; height: 60%;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.035), transparent);
  animation: sweep 4s linear infinite;
}
.img-slot img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 3;
}
.img-slot img.fit-contain { object-fit: contain; }
.img-slot:has(img)::before, .img-slot:has(img)::after { display: none; }
@keyframes flicker {
  0%, 92%, 100% { opacity: 0.85; }
  93% { opacity: 0.2; }
  95% { opacity: 0.7; }
  97% { opacity: 0.3; }
}
@keyframes sweep {
  from { transform: translateY(0); }
  to { transform: translateY(350%); }
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.img-grid.two { grid-template-columns: repeat(2, 1fr); }
.img-grid .img-slot { aspect-ratio: 4 / 3; }
.img-slot.landscape { aspect-ratio: 16 / 9; }
.img-slot.portrait { aspect-ratio: 3 / 4; }

/* ---------- operators ---------- */
.operators {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
}
.operator .img-slot { margin-bottom: 16px; aspect-ratio: 8 / 9; } /* 2x the height of the old 16:9 frame */
.operator .img-slot img { object-position: top; } /* keep faces in frame */
.operator h3 { margin-bottom: 2px; }
.operator .role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 12px;
}
.operator p:not(.role) {
  font-size: clamp(13px, 1.35vw, 15px);
  line-height: 1.6;
  color: var(--ink);
}

/* ---------- ledger (receipts) ---------- */
.ledger { list-style: none; max-width: 76ch; }
.ledger li {
  display: flex; gap: 16px; align-items: baseline;
  padding: clamp(8px, 1.2vh, 13px) 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.55;
}
.ledger li:last-child { border-bottom: 0; }
.index {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 2ch;
}

/* ---------- model phases ---------- */
.phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 24px);
}
.phase {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: clamp(16px, 2vw, 26px);
  background: var(--bg-raise);
  transition: border-color 0.3s;
}
.phase:hover { border-color: var(--accent); }
.phase-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 10px;
}
.phase h3 { margin-bottom: 8px; }
.phase p:not(.phase-tag) { font-size: clamp(13px, 1.3vw, 14px); line-height: 1.6; color: var(--muted); }

/* ---------- split layout (series / platform) ---------- */
.split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.split.img-left { grid-template-columns: 2fr 3fr; }
.split-text { display: flex; flex-direction: column; gap: clamp(14px, 2.2vh, 24px); }
.split-img .img-slot { max-height: 62vh; }

.series-title {
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 900;
  font-stretch: 115%;
}

/* ---------- spec list ---------- */
.spec { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.spec > div {
  display: grid;
  grid-template-columns: minmax(110px, 150px) 1fr;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.spec dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  padding-top: 3px;
}
.spec dd { font-size: clamp(13px, 1.4vw, 15px); line-height: 1.5; }

/* ---------- production badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  font-family: var(--mono);
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.14em;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px 18px;
  background: var(--bg-raise);
  color: var(--ink);
  transition: border-color 0.3s, color 0.3s;
}
.badge:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- growth mechanics ---------- */
.mechanics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 1.6vw, 20px);
}
.mech {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg-raise);
  padding: clamp(14px, 1.8vw, 22px);
  transition: border-color 0.3s;
}
.mech:hover { border-color: var(--accent); }
.mech-stat {
  font-weight: 900;
  font-stretch: 115%;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  color: var(--accent);
  margin-bottom: 10px;
}
.mech-qualifier {
  display: block;
  font-size: 0.32em;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 6px;
  text-transform: uppercase;
}
.mech h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 600;
  margin-bottom: 8px;
}
.mech p:not(.mech-stat) { font-size: clamp(12px, 1.25vw, 13.5px); line-height: 1.55; color: var(--muted); }

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
  animation: ticker 22s linear infinite;
}
.ticker-track span { padding-right: 0; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- the ask ---------- */
.ask-list { list-style: none; max-width: 78ch; }
.ask-list li {
  display: flex; gap: 16px; align-items: baseline;
  padding: clamp(8px, 1.3vh, 14px) 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.6;
}
.ask-list strong { color: var(--accent); font-weight: 700; }

.contact {
  font-family: var(--mono);
  font-size: clamp(11px, 1.3vw, 13px);
  letter-spacing: 0.08em;
  line-height: 2;
}
.contact-label { color: var(--accent); display: inline-block; min-width: 11ch; }

.signoff {
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 30ch;
}

.end-transmission {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
}

/* ---------- nav label hiding on small screens ---------- */
@media (max-width: 720px) {
  .nav-label { display: none; }
  .chrome-id { display: none; } /* brand lives in the slides; free the bar for REC + language */
  .lang-btn { padding: 5px 12px; font-size: 10px; }
  .slide-code { max-width: 34vw; font-size: 9px; }
  .counter { min-width: 0; font-size: 10px; }
  .nav-center { gap: 8px; }

  .operators { grid-template-columns: 1fr; }
  .operator .img-slot { aspect-ratio: 21 / 18; }
  .phases { grid-template-columns: 1fr; }
  .mechanics { grid-template-columns: 1fr 1fr; }
  .img-grid { grid-template-columns: 1fr 1fr; }
  .split, .split.img-left { grid-template-columns: 1fr; }
  .split-img { order: 2; } /* text first, image after, scroll to see it */
  .split-img .img-slot { max-height: 42vh; width: 100%; }
  .slide-inner { justify-content: flex-start; }
  .spec > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 420px) {
  .mechanics { grid-template-columns: 1fr; }
}

/* short landscape phones / small laptops: let content scroll, don't squish */
@media (max-height: 560px) {
  .slide-inner { justify-content: flex-start; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .slide.active .reveal { animation: none; opacity: 1; transform: none; }
  .ticker-track { animation: none; }
  .img-slot::after { animation: none; }
  .dot, .cursor { animation: none; }
  .progress-fill { transition: none; }
}
