/* ============================================================
   bator-deck viewer — bildr brand
   Palette scraped from bildr.hu:
     cream #fbf6ec · ink #1a1610 · surface #fdf9ef · border #d8cab1
     espresso #16120d · terracotta #c97b3a · tan #e0a45a · moss #5b7a3e
   Fonts: Noto Serif (display) · Plus Jakarta Sans (body) · JetBrains Mono
   ============================================================ */

:root {
  --cream: #fbf6ec;
  --surface: #fdf9ef;
  --ink: #1a1610;
  --ink-soft: #4a3f30;
  --border: #d8cab1;
  --border-soft: #eadfc7;
  --espresso: #16120d;
  --terracotta: #c97b3a;
  --terracotta-deep: #9a4d18;
  --tan: #e0a45a;
  --moss: #5b7a3e;

  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Noto Serif", "Source Serif Pro", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(26, 22, 16, 0.06);
  --shadow-md: 0 6px 24px rgba(26, 22, 16, 0.08);
  --shadow-lg: 0 24px 60px rgba(26, 22, 16, 0.14);

  --slide-max: 1180px;
  --slide-pad: clamp(28px, 5vw, 72px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--cream); }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------- deck stage ---------------- */
.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--slide-pad);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 260ms ease, transform 320ms cubic-bezier(0.22, 0.68, 0.22, 1), visibility 0s linear 320ms;
  background: var(--cream);
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 260ms ease, transform 320ms cubic-bezier(0.22, 0.68, 0.22, 1);
}

.slide__inner {
  width: 100%;
  max-width: var(--slide-max);
  animation: none;
}
.slide.is-active .slide__inner {
  animation: rise 480ms cubic-bezier(0.22, 0.68, 0.22, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- typography ---------------- */
.slide__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  margin: 0 0 18px;
}
.slide__h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6.4vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
  color: inherit;
  white-space: pre-line;
}
.slide__h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  white-space: pre-line;
}
.slide__sub, .slide__lead {
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 780px;
  margin: 0 0 12px;
}
.slide__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 32px;
  letter-spacing: 0.04em;
}
.slide__logo {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
  border-radius: 12px;
  object-fit: contain;
}

/* ---------------- title slide (light) ---------------- */
.slide--title { background: var(--cream); }
.slide--title .slide__inner { max-width: 960px; }

/* ---------------- bullets ---------------- */
.bullets {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.bullets li {
  position: relative;
  padding: 14px 18px 14px 44px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 4px rgba(201, 123, 58, 0.15);
}
.bullets li b, .bullets li strong { color: var(--terracotta-deep); font-weight: 700; }

/* ---------------- kpi ---------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: 4px;
  background: var(--terracotta);
}
.kpi__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.kpi__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.05;
  margin: 0 0 8px;
  color: var(--ink);
}
.kpi__hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------------- quote ---------------- */
.slide--quote { background: var(--surface); }
.quote {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  position: relative;
}
.quote::before {
  content: "\201C";
  font-family: var(--font-display);
  font-size: clamp(140px, 16vw, 220px);
  line-height: 0.9;
  color: var(--terracotta);
  opacity: 0.35;
  position: absolute;
  top: -30px; left: -14px;
  pointer-events: none;
}
.quote__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.28;
  margin: 0 0 24px;
  color: var(--ink);
  position: relative;
  z-index: 1;
}
.quote__author {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.quote__author::before { content: "— "; }

/* ---------------- split ---------------- */
.slide__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
@media (max-width: 900px) {
  .slide__split { grid-template-columns: 1fr; }
}
.slide__col--visual {
  min-height: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.slide__col--visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide__prose { color: var(--ink-soft); font-size: clamp(16px, 1.2vw, 19px); line-height: 1.55; }
.slide__prose p { margin: 0 0 12px; }
.slide__prose b, .slide__prose strong { color: var(--ink); font-weight: 700; }

/* ---------------- image slide ---------------- */
.slide--image { background: var(--espresso); }
.figure { margin: 0; max-width: 1100px; width: 100%; }
.figure__img { width: 100%; height: auto; max-height: 78vh; object-fit: contain; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: var(--surface); }
.figure__cap { color: var(--surface); opacity: 0.8; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; margin-top: 14px; text-align: center; }

/* ---------------- table ---------------- */
.slide--table { background: var(--cream); }
.table-wrap { margin-top: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: clamp(14px, 1.05vw, 17px); }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.table thead th { background: var(--cream); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(216, 202, 177, 0.15); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; font-family: var(--font-mono); letter-spacing: 0.02em; }
.pill--ok      { background: rgba(91, 122, 62, 0.15); color: var(--moss); }
.pill--warn    { background: rgba(224, 164, 90, 0.22); color: var(--terracotta-deep); }
.pill--err     { background: rgba(154, 77, 24, 0.18); color: var(--terracotta-deep); }
.pill--info    { background: rgba(26, 22, 16, 0.08); color: var(--ink); }
.pill--neutral { background: var(--border-soft); color: var(--ink); }

/* ---------------- end slide (dark) ---------------- */
.slide--end { background: var(--espresso); color: var(--surface); }
.slide--end .slide__inner { max-width: 780px; text-align: center; }
.slide--end .slide__logo { margin: 0 auto 32px; filter: drop-shadow(0 8px 32px rgba(0,0,0,0.3)); }
.slide--end .slide__h1 { color: var(--surface); font-size: clamp(38px, 5vw, 72px); }
.slide--end .slide__sub { color: rgba(253, 249, 239, 0.7); margin: 0 auto 28px; }
.slide--end .slide__cta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
  border: 1px solid var(--terracotta);
  border-radius: 999px;
  padding: 12px 24px;
  margin: 0;
}

/* ---------------- error slide ---------------- */
.slide--error { background: var(--cream); }
.slide--error h2 { font-family: var(--font-display); }
.err-msg { color: var(--ink-soft); }
.err-hash { display: block; margin-top: 20px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-mono); font-size: 12px; word-break: break-all; }

/* ---------------- HUD ---------------- */
.hud {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: rgba(253, 249, 239, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  z-index: 10;
  font-family: var(--font-mono);
  transition: opacity 260ms ease, transform 260ms ease;
}
.hud:hover, .hud:focus-within { opacity: 1; }
.deck.is-idle ~ .hud { opacity: 0.35; }

.hud__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: grid;
  place-items: center;
  transition: background 160ms ease;
}
.hud__btn:hover { background: var(--border-soft); }
.hud__btn:active { transform: scale(0.95); }
.hud__btn:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.hud__count {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 0 10px;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.hint {
  position: fixed;
  top: 20px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  opacity: 0.65;
  z-index: 10;
  transition: opacity 200ms ease;
}
.hint kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  margin: 0 1px;
}
.deck.is-idle ~ .hint { opacity: 0.25; }

/* dark slide overrides HUD tint */
.slide--end.is-active ~ .hud { background: rgba(26, 22, 16, 0.6); border-color: rgba(253, 249, 239, 0.2); }
.slide--end.is-active ~ .hud .hud__btn { color: var(--surface); }
.slide--end.is-active ~ .hud .hud__count { color: rgba(253, 249, 239, 0.7); }
.slide--end.is-active ~ .hint,
.slide--image.is-active ~ .hint { color: rgba(253, 249, 239, 0.8); }
.slide--image.is-active ~ .hud { background: rgba(26, 22, 16, 0.6); border-color: rgba(253, 249, 239, 0.2); }
.slide--image.is-active ~ .hud .hud__btn { color: var(--surface); }
.slide--image.is-active ~ .hud .hud__count { color: rgba(253, 249, 239, 0.7); }

/* ---------------- fullscreen ---------------- */
:fullscreen .deck { background: var(--cream); }
:fullscreen .hint { display: none; }

/* ---------------- print (export to PDF) ---------------- */
@media print {
  html, body { overflow: visible; background: white; }
  .hud, .hint { display: none !important; }
  .slide {
    position: relative !important;
    inset: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
    page-break-after: always;
    height: 100vh;
    break-after: page;
  }
  .slide.is-active { animation: none !important; }
  .slide__inner { animation: none !important; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .slide, .slide__inner { transition: none !important; animation: none !important; }
}
