/* ============================================================
   Quadrafolio deck — native, responsive investor deck.
   Design system pulled from the pitch-deck brief:
   dark cinematic ground, bookish serif display, grotesque body,
   orange = the new, blue = the old, pink = one wink.
   ============================================================ */

:root {
  --bg: #0e0e12;
  --card: #17171c;
  --card-2: #202028;
  --fg: #f4f1ea;          /* warm off-white, never pure white */
  --muted: #9b968b;
  --dim: #6e6960;
  --orange: #ee6026;
  --blue: #3b73c0;
  --blue-2: #5a5fb2;
  --blue-3: #46628f;
  --blue-4: #20406f;
  --blue-5: #17294a;
  --pink: #e68ca0;
  --line: rgba(244, 241, 234, 0.1);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --fs-title: clamp(26px, 4.4vw, 46px);
  --fs-statement: clamp(30px, 6vw, 66px);
  --fs-kicker: clamp(10px, 1.1vw, 12px);
  --fs-body: clamp(14px, 1.5vw, 17px);
  --tr-kicker: 0.22em;
  --pad-x: clamp(20px, 6vw, 96px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.accent { color: var(--orange); }
.blue { color: var(--blue); }
.dim { color: var(--dim); }

/* ---------- back button ---------- */
.back {
  position: fixed;
  top: 20px;
  left: 22px;
  z-index: 8;
  color: var(--dim);
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  transition: color 0.2s ease;
}
.back:hover { color: var(--fg); }

/* ---------- gate ---------- */
.gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}
.gate-reel {
  width: 84px;
  height: 84px;
  opacity: 0.92;
  margin-bottom: 30px;
  animation: slowspin 44s linear infinite;
  filter: drop-shadow(0 12px 34px rgba(59, 115, 192, 0.32));
}
@keyframes slowspin { to { transform: rotate(360deg); } }

.gate-form { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gate-form label {
  font-family: var(--sans);
  font-size: var(--fs-kicker);
  letter-spacing: var(--tr-kicker);
  text-transform: uppercase;
  color: var(--dim);
}
.gate-form input {
  width: min(78vw, 280px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  padding: 12px 16px;
  text-align: center;
  letter-spacing: 0.2em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gate-form input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(238, 96, 38, 0.16);
}
.gate-form button {
  margin-top: 4px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--sans);
  font-size: var(--fs-kicker);
  letter-spacing: var(--tr-kicker);
  text-transform: uppercase;
  padding: 13px 28px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.gate-form button:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.gate-form button:disabled { opacity: 0.5; cursor: progress; }
.gate-error { min-height: 16px; font-size: var(--fs-kicker); letter-spacing: 0.04em; color: var(--orange); }
.gate.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ---------- deck shell ---------- */
.deck { position: relative; z-index: 1; height: 100vh; height: 100svh; }
.slides { position: relative; height: 100%; }

.slide {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s;
  -webkit-overflow-scrolling: touch;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Inner wrapper is at least full height and centers content;
   if content is taller (mobile), the slide scrolls instead of clipping. */
.s-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 3.5vh, 44px);
  padding: clamp(64px, 9vh, 104px) var(--pad-x) clamp(96px, 12vh, 120px);
  max-width: 1240px;
  margin: 0 auto;
}

/* ---------- shared header ---------- */
.s-head { display: flex; flex-direction: column; gap: 14px; }
.kicker {
  font-family: var(--sans);
  font-size: var(--fs-kicker);
  font-weight: 500;
  letter-spacing: var(--tr-kicker);
  text-transform: uppercase;
  color: var(--dim);
}
.s-title {
  font-family: var(--serif);
  font-weight: 420;
  font-size: var(--fs-title);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--fg);
}
.tag {
  font-family: var(--sans);
  font-size: var(--fs-kicker);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* pull-lines: italic serif */
.pull {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 2.4vw, 27px);
  line-height: 1.3;
  color: var(--muted);
}
.pull strong { color: var(--fg); font-weight: 600; }
.pull.center { text-align: center; }

/* ---------- 1 · cover ---------- */
.s-inner.cover { align-items: center; text-align: center; justify-content: center; }
.cover-reel {
  width: clamp(96px, 13vw, 150px);
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 16px 40px rgba(59, 115, 192, 0.28));
}
.cover-word {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 8vw, 92px);
  letter-spacing: 0.06em;
  line-height: 1;
}
.cover-sub { font-family: var(--sans); font-size: clamp(15px, 2vw, 20px); color: var(--muted); }
.cover-meta {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: var(--fs-kicker);
  letter-spacing: var(--tr-kicker);
  text-transform: uppercase;
  color: var(--orange);
}
.cover-note {
  font-family: var(--sans);
  font-size: var(--fs-kicker);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- 2 · shift ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 1.6vw, 22px); }
.shift-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(20px, 2vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shift-then {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(155, 150, 139, 0.6);
  font-size: var(--fs-body);
  line-height: 1.45;
}
.shift-now { color: var(--fg); font-weight: 600; font-size: var(--fs-body); line-height: 1.45; margin-top: 4px; }
.shift-card .tag { margin-top: 4px; }

/* ---------- 3 · pattern (filmstrip) ---------- */
.filmstrip {
  background: linear-gradient(180deg, #202028, #14141a);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sprockets { display: flex; justify-content: space-between; padding: 0 6px; }
.hole { width: clamp(10px, 1vw, 16px); height: clamp(7px, 0.7vw, 10px); background: var(--bg); border-radius: 2px; }
.frames { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(8px, 1vw, 14px); }
.frame {
  background: rgba(244, 241, 234, 0.05);
  border-radius: 10px;
  padding: clamp(14px, 1.6vw, 22px) clamp(10px, 1.2vw, 16px);
  min-height: clamp(120px, 16vh, 190px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  justify-content: flex-start;
}
.frame-accent { background: var(--orange); }
.frame-label { font-weight: 700; font-size: clamp(13px, 1.5vw, 18px); color: var(--fg); }
.frame-sub { font-size: clamp(12px, 1.2vw, 14px); color: var(--muted); line-height: 1.35; }
.frame-accent .frame-label, .frame-accent .frame-sub { color: #17140f; }

/* ---------- 4 · statement ---------- */
.s-inner.statement { position: relative; align-items: flex-start; overflow: hidden; }
.ghost-reel {
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  width: min(52vw, 560px);
  height: auto;
  opacity: 0.16;
  pointer-events: none;
}
.statement-lead {
  position: relative;
  font-family: var(--serif);
  font-weight: 460;
  font-size: var(--fs-statement);
  line-height: 1.02;
  letter-spacing: -0.01em;
  max-width: 15ch;
}
.statement-body {
  position: relative;
  max-width: 46ch;
  color: var(--muted);
  font-size: var(--fs-body);
  line-height: 1.6;
}
.statement-emph {
  position: relative;
  max-width: 46ch;
  color: var(--fg);
  font-size: var(--fs-body);
  line-height: 1.6;
}

/* ---------- 5 · problem (value bar) ---------- */
.bar-label {
  font-size: var(--fs-kicker);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.value-bar { display: flex; gap: 4px; height: clamp(44px, 6vh, 62px); }
.value-bar .seg { border-radius: 6px; min-width: 6px; }
.seg-blue { background: var(--blue); }
.seg-blue2 { background: var(--blue-2); }
.seg-blue3 { background: var(--blue-3); }
.seg-blue4 { background: var(--blue-4); }
.seg-blue5 { background: var(--blue-5); }
.seg-orange { background: var(--orange); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.chip { display: flex; align-items: center; gap: 8px; }
.chip-t { font-size: clamp(12px, 1.2vw, 14px); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-blue { background: var(--blue); }
.dot-blue2 { background: var(--blue-2); }
.dot-blue3 { background: var(--blue-3); }
.dot-blue4 { background: var(--blue-4); }
.dot-blue5 { background: var(--blue-5); }
.dot-orange { background: var(--orange); }
.dot-pink { background: var(--pink); }
.points { display: flex; flex-direction: column; gap: 14px; }
.point { display: flex; align-items: center; gap: 12px; }
.point .dot { margin-top: 1px; }
.point-t { font-weight: 600; font-size: var(--fs-body); color: var(--fg); }

/* ---------- 6 · model ---------- */
.model-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: start; }
.model-col { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.one-film {
  width: clamp(150px, 18vw, 220px);
  height: clamp(150px, 18vw, 220px);
  border: 1px solid var(--dim);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: clamp(14px, 1.4vw, 18px);
}
.dot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.6vw, 22px);
  width: 100%;
  max-width: 360px;
}
.gdot { aspect-ratio: 1; border-radius: 50%; background: var(--card-2); }
.gdot-orange { background: var(--orange); }
.gdot-pink { background: var(--pink); }
.model-cap { color: var(--muted); font-size: clamp(12px, 1.3vw, 15px); line-height: 1.4; max-width: 34ch; }

/* ---------- 7 · structure (comparison table) ---------- */
.cmp { display: flex; flex-direction: column; }
.cmp-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.4fr;
  gap: clamp(12px, 2vw, 32px);
  align-items: center;
  padding: clamp(12px, 1.7vh, 20px) 0;
  border-top: 1px solid var(--line);
}
.cmp-row:first-child { border-top: 0; }
.cmp-head { padding-top: 0; }
.cmp-head span { font-size: var(--fs-kicker); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.cmp-ai.accent { color: var(--orange); }
.cmp-k { font-weight: 700; color: var(--fg); font-size: var(--fs-body); }
.cmp-legacy { font-size: var(--fs-body); }
.cmp-ai { font-size: var(--fs-body); color: var(--fg); }
.cmp-row:not(.cmp-head) .cmp-ai {
  background: linear-gradient(90deg, rgba(238, 96, 38, 0.08), rgba(238, 96, 38, 0.02));
  border-radius: 8px;
  padding: 8px 14px;
  margin: -8px 0;
}

/* ---------- 8 · founder ---------- */
.founder-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2vw, 26px); }
.founder-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(20px, 2vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.founder-list { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.founder-list li {
  position: relative;
  padding-left: 18px;
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--muted);
}
.founder-list li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.stat { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.stat-n { font-family: var(--serif); font-size: clamp(34px, 5vw, 54px); line-height: 1; }
.stat-l { font-size: clamp(12px, 1.2vw, 14px); color: var(--muted); }
.founder-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.founder-foot .pull { font-size: clamp(15px, 1.9vw, 22px); }
.byline { font-family: var(--sans); font-size: var(--fs-kicker); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }

/* ---------- 9 · studio ---------- */
.studio-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.studio-lead {
  font-family: var(--serif);
  font-size: clamp(22px, 3.2vw, 40px);
  line-height: 1.15;
  color: var(--fg);
}
.num-list { display: flex; flex-direction: column; gap: 22px; }
.num-row { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.num { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 32px); line-height: 1; }
.num-t { font-size: var(--fs-body); line-height: 1.5; color: var(--muted); padding-top: 2px; }

/* ---------- 10 · raise ---------- */
.slide-raise .s-inner { align-items: flex-start; position: relative; }
.sign-reel { position: absolute; top: clamp(56px, 8vh, 96px); right: var(--pad-x); width: clamp(48px, 6vw, 74px); height: auto; opacity: 0.92; }
.raise-title { font-size: clamp(30px, 5vw, 58px); }
.raise-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(20px, 2vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.raise-h { font-weight: 700; font-size: clamp(15px, 1.7vw, 20px); color: var(--fg); }
.raise-b { color: var(--muted); font-size: var(--fs-body); line-height: 1.45; }

/* ---------- 11 · contact ---------- */
.contact-email {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(30px, 6.4vw, 74px);
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}
.contact-email:hover { color: var(--orange); }
.memo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 13px 26px;
  font-family: var(--sans);
  font-size: var(--fs-kicker);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.memo-btn:hover { background: var(--card-2); border-color: var(--orange); color: var(--orange); }

/* ---------- nav + progress ---------- */
.deck-nav {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 20px;
}
.deck-nav button {
  background: rgba(23, 23, 28, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  color: var(--fg);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.deck-nav button:hover { background: var(--card-2); border-color: var(--orange); }
.deck-nav button:disabled { opacity: 0.28; cursor: default; }
.counter {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--dim);
  min-width: 54px;
  text-align: center;
}
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--orange);
  transition: width 0.4s ease;
  z-index: 7;
}

/* ============================================================
   Mobile — stack every multi-column layout, let slides scroll.
   ============================================================ */
@media (max-width: 760px) {
  .cards-3,
  .model-cols,
  .founder-cols,
  .studio-cols { grid-template-columns: 1fr; }

  .frames { grid-template-columns: repeat(2, 1fr); }
  .frame { min-height: 0; }

  .cmp-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; }
  .cmp-head { display: none; }
  .cmp-k { margin-bottom: 2px; }
  .cmp-legacy::before { content: "Legacy — "; color: var(--dim); }
  .cmp-ai::before { content: "AI-native — "; color: var(--orange); }
  .cmp-row:not(.cmp-head) .cmp-ai { margin: 4px 0 0; }

  .dot-grid { max-width: 260px; margin: 0 auto; }
  .founder-foot { flex-direction: column; gap: 8px; }
  .ghost-reel { right: -18%; opacity: 0.1; }
  .studio-lead { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-reel { animation: none; }
  .slide { transition: opacity 0.2s ease; transform: none; }
}
