/* teia.cafe pitch deck. Slides are authored on a fixed 1920x1080 canvas with
   inline styles; this file supplies the defaults they assume, scales the
   canvas to the window above a toolbar, reflows the slides into a scrolling
   page on phones, and lays the deck out one landscape slide per page for print. */

@font-face {
  font-family: 'JetBrains Mono';
  src: url(fonts/JetBrainsMono-Regular.woff2) format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url(fonts/JetBrainsMono-Bold.woff2) format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #0a0a0a;
  --paper: #f4f2ee;
  --muted: #cfcbc3;
  --accent: #ffab40;
  --edge: #2a2a2a;
  --bar: 56px;
  --scale: 1;
}

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

html, body { height: 100%; background: #050505; color: var(--paper); }
body { overflow: hidden; font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* ---- the canvas ---------------------------------------------------------- */

/* The stage sits above the toolbar and clips the full-size slides, so they
   never widen the page. */
.deck { position: fixed; inset: 0 0 var(--bar) 0; overflow: hidden; }

.slide {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(var(--scale));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  visibility: hidden;
  opacity: 0;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}
.slide.is-current {
  visibility: visible;
  opacity: 1;
  transition: opacity 240ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .slide, .slide.is-current { transition: none; }
}

/* Defaults the slide format assumes (the markup sets most of these inline). */
.slide > * { flex-shrink: 0; }
.slide div { display: flex; flex-direction: column; }
.slide h1 { font-size: 96px; font-weight: 600; line-height: 1.1; }
.slide h2 { font-size: 64px; font-weight: 600; line-height: 1.15; }
.slide h3 { font-size: 44px; font-weight: 600; line-height: 1.2; }
.slide p  { font-size: 32px; line-height: 1.4; }
.slide b, .slide th { font-weight: 700; }
.slide ul { list-style: disc; }
.slide img { display: block; object-fit: cover; }
.slide x-shape { display: block; }
.slide [hidden] { display: none !important; }

/* Slide 4's voice buttons (deck.js swaps the sample report). */
.slide [data-voice] {
  padding: 6px 16px;
  font-family: inherit;
  line-height: 1.4;
  color: #dddad3;
  background: transparent;
  border: 2px solid var(--edge);
  border-radius: 4px;
  cursor: pointer;
}
.slide [data-voice]:hover { border-color: var(--accent); color: var(--paper); }
.slide [data-voice][aria-pressed="true"] { background: #1c1405; border-color: var(--accent); color: var(--paper); font-weight: 700; }
.slide [data-voice]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.slide table { border-collapse: collapse; width: 100%; }
.slide td, .slide th { border: 1px solid var(--edge); text-align: left; vertical-align: top; }
.slide a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.slide a:hover { text-decoration-color: var(--paper); }
.slide a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

/* ---- toolbar ------------------------------------------------------------- */

.controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: ". nav downloads";
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: #050505;
  border-top: 1px solid #1c1c1c;
  font-size: 14px;
  z-index: 10;
}
.controls .group { display: flex; align-items: center; gap: 4px; }
.controls [data-nav] { grid-area: nav; justify-self: center; }
.controls .downloads { grid-area: downloads; justify-self: end; }
.controls .sep { display: none; }
.controls .label { color: var(--muted); margin-right: 4px; }
.controls button, .controls .group a {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  font: inherit;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.controls button:hover, .controls .group a:hover { background: #1c1c1c; color: var(--accent); }
.controls button:focus-visible, .controls .group a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.controls button:disabled { opacity: 0.35; cursor: default; background: transparent; color: var(--paper); }
.counter { min-width: 72px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }

.progress {
  position: fixed;
  left: 0;
  bottom: var(--bar);
  height: 2px;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
  background: var(--accent);
  transition: transform 240ms ease;
  z-index: 10;
}

/* ?bare hides the toolbar and fills the window; used to render images. */
.bare { --bar: 0px; }
.bare .controls, .bare .progress { display: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

noscript p {
  position: fixed; inset: auto 16px calc(var(--bar) + 16px) 16px; z-index: 20;
  padding: 12px 16px; font-size: 16px; line-height: 1.5;
  background: #161616; border: 1px solid var(--edge); border-radius: 10px;
}
noscript a { color: var(--accent); }

/* ---- layout check (?check) ---------------------------------------------- */

.check-panel {
  position: fixed; left: 16px; top: 16px; z-index: 30;
  max-width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  padding: 14px 16px; font-size: 13px; line-height: 1.5;
  background: rgba(10, 10, 10, 0.94); border: 1px solid var(--accent); border-radius: 10px;
}
.check-panel h2 { font-size: 14px; margin-bottom: 6px; color: var(--accent); }
.check-panel li { list-style: none; }
.check-panel .bad { color: #ff7a6b; }
.check-panel .ok { color: #9ad29a; }

/* ---- phones: reflow the slides into a scrolling page --------------------
   A 1920px slide shrunk to a phone makes 24px text about 5px tall, so small
   screens get the same content stacked in one column at readable sizes.
   Screen only: printing always uses the landscape layout below. */

@media screen and (max-width: 900px), screen and (max-height: 500px) and (orientation: landscape) {
  :root { --bar: 52px; }
  html, body { height: auto; }
  body { overflow: auto; }

  .deck {
    position: static;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 12px calc(var(--bar) + 16px);
  }
  .slide {
    position: relative !important;
    left: auto; top: auto;
    width: auto !important;
    height: auto !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 24px 18px !important;
    gap: 18px !important;
    border: 1px solid #1c1c1c;
    border-radius: 4px;
    
  }
  .slide div {
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    flex: none !important;
  }
  /* Keep a flag beside its line of text. */
  .slide div[style*="flex-direction:row"]:has(> img[alt^="Flag"]) {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }
  /* Rows that wrap (the voice pills) stay rows. */
  .slide div[style*="flex-wrap:wrap"] { flex-direction: row !important; flex-wrap: wrap; align-items: center !important; gap: 8px !important; }
  /* Keep a tool icon beside its card title. */
  .slide div[style*="flex-direction:row"]:has(> img[alt^="Icon"]) {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .slide img[alt^="Icon"] { width: 28px !important; height: 28px !important; }
  .slide [style*="position:absolute"] { position: static !important; width: auto !important; }
  .slide [style*="display:grid"] { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .slide [style*="display:grid"] > div { min-width: 0; }
  .slide p, .slide li, .slide h1, .slide h2, .slide h3 { width: auto !important; max-width: 100%; overflow-wrap: anywhere; }
  .slide img { width: auto !important; height: auto !important; max-width: 100%; max-height: 60vh; align-self: center; }
  .slide img[src*="/demo-"] { width: 100% !important; max-height: none; }
  .slide img[alt^="Flag"] { width: 22px !important; height: 22px !important; align-self: flex-start; }
  .slide [style*="display:grid"] img[alt^="Flag"] { align-self: center; }
  .slide table { display: block; overflow-x: auto; font-size: 13px !important; }
  .slide td, .slide th { padding: 6px 8px !important; min-width: 88px; }
  .slide ul { padding-left: 20px !important; }
  .slide a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

  /* Page numbers make no sense on a scrolling page. */
  .slide p[style*="right:128px; bottom:64px"] { display: none; }

  /* The slide type scale, mapped to phone sizes. */
  .slide [style*="font-size:140px"] { font-size: 52px !important; }
  .slide [style*="font-size:60px"], .slide [style*="font-size:56px"] { font-size: 25px !important; line-height: 1.2 !important; }
  .slide [style*="font-size:48px"] { font-size: 28px !important; }
  .slide [style*="font-size:44px"] { font-size: 22px !important; }
  .slide [style*="font-size:40px"] { font-size: 24px !important; }
  .slide [style*="font-size:36px"] { font-size: 19px !important; }
  .slide [style*="font-size:30px"] { font-size: 17px !important; }
  .slide [style*="font-size:28px"] { font-size: 16px !important; }
  .slide [style*="font-size:24px"] { font-size: 14px !important; }
  .slide [style*="letter-spacing:2px"] { letter-spacing: 1px !important; }

  .controls { grid-template-columns: auto 1fr; grid-template-areas: "nav downloads"; padding: 0 6px; }
  .controls [data-nav] { justify-self: start; }
  .controls [data-fullscreen], .controls .label { display: none; }
  .controls button, .controls .group a { min-width: 38px; padding: 0 7px; }
  .counter { min-width: 60px; }
  .progress { display: none; }
}

/* ---- print: one landscape slide per page, full size ---------------------- */

@page { size: 1920px 1080px; margin: 0; }
@media print {
  html, body { height: auto; overflow: visible; background: var(--ink); }
  .deck { position: static; overflow: visible; }
  .slide {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    visibility: visible;
    opacity: 1;
    transition: none;
    break-after: page;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .slide:last-of-type { break-after: auto; }
  .slide a { text-decoration-thickness: 1px; }
  .controls, .progress, .check-panel, noscript, .sr-only { display: none !important; }
  .slide [data-voice-card] { display: none !important; }
  .slide [data-voice-card="mentor"] { display: flex !important; }
}
