/* Fresh Talks engine - structural CSS only. No brand colours or fonts here (those live in theme/). */

html, body { margin: 0; height: 100%; overflow: hidden; background: var(--stage, #111); }
body { -webkit-font-smoothing: antialiased; }

/* ---------- Stage + 1600x900 canvas, scaled to fit ---------- */
.deck { position: fixed; inset: 0; }
.deck-canvas {
  position: absolute; left: 50%; top: 50%;
  width: 1600px; height: 900px;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center center;
}
.slide { position: absolute; inset: 0; display: none; overflow: hidden; box-sizing: border-box; }
.slide *, .slide *::before, .slide *::after { box-sizing: border-box; }
.slide.is-active { display: block; }
.slide .notes { display: none !important; }

/* ---------- Steps (click-controlled reveals) ---------- */
.slide [data-step] { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility .45s; }
.slide [data-step].is-shown { opacity: 1; visibility: visible; }
.slide [data-step][data-hide-at].is-gone { opacity: 0; visibility: hidden; }

/* ---------- Animation vocabulary ----------
   data-anim="fade|rise|reveal|drop|zoom|draw|grow|wipe|pop"   delay: style="--d:.6s"
   Plays when the slide becomes active (or when its step is shown). Replays on every visit. */
.is-active [data-anim]:not([data-step]),
.is-active [data-anim][data-step].is-shown {
  animation-duration: var(--dur, .7s);
  animation-delay: var(--d, 0s);
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(.2, .7, .2, 1);
}
.is-active [data-anim="fade"]:not([data-step]),   .is-active [data-anim="fade"].is-shown   { animation-name: ft-fade; }
.is-active [data-anim="rise"]:not([data-step]),   .is-active [data-anim="rise"].is-shown   { animation-name: ft-rise; }
.is-active [data-anim="reveal"]:not([data-step]), .is-active [data-anim="reveal"].is-shown { animation-name: ft-reveal; --dur: .9s; }
.is-active [data-anim="drop"]:not([data-step]),   .is-active [data-anim="drop"].is-shown   { animation-name: ft-drop; }
.is-active [data-anim="zoom"]:not([data-step]),   .is-active [data-anim="zoom"].is-shown   { animation-name: ft-zoom; --dur: 14s; animation-timing-function: linear; }
.is-active [data-anim="draw"]:not([data-step]),   .is-active [data-anim="draw"].is-shown   { animation-name: ft-draw; transform-origin: left center; }
.is-active [data-anim="grow"]:not([data-step]),   .is-active [data-anim="grow"].is-shown   { animation-name: ft-grow; --dur: 1.2s; }
.is-active [data-anim="wipe"]:not([data-step]),   .is-active [data-anim="wipe"].is-shown   { animation-name: ft-wipe; --dur: 1.1s; }
.is-active [data-anim="pop"]:not([data-step]),    .is-active [data-anim="pop"].is-shown    { animation-name: ft-pop; --dur: .5s; }

@keyframes ft-fade   { from { opacity: 0; } }
@keyframes ft-rise   { from { opacity: 0; transform: translateY(28px); } }
@keyframes ft-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ft-drop   { from { opacity: 0; transform: translateY(-18px) scale(1.04) rotate(var(--r, 0deg)); } }
@keyframes ft-zoom   { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes ft-draw   { from { transform: scaleX(0); } }
@keyframes ft-grow   { from { width: 0; } }
@keyframes ft-wipe   { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ft-pop    { 0% { opacity: 0; transform: scale(.85); } 70% { transform: scale(1.03); } }

/* word-by-word reveal (components.js splits the words) */
.is-active [data-anim="words"] .w,
.is-active [data-anim="words"].is-shown .w { display: inline-block; animation: ft-rise .6s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(var(--d, 0s) + var(--i) * var(--gap, 90ms)); }

/* ---------- Static mode: grid thumbnails and print show the finished slide ---------- */
.is-static [data-step] { opacity: 1 !important; visibility: visible !important; }
.is-static *, .is-static *::before, .is-static *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .slide *, .slide *::before, .slide *::after { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; }
}

/* >> next to the page number: the slide is finished, the next click moves on (her ask 12.10) */
.ft-cue { position: absolute; right: 72px; bottom: 30px; width: 19px; height: 16px; z-index: 5; opacity: 0; transition: opacity .25s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 54'%3E%3Cpath fill='%2346FFC5' d='M0 0 35 27 10 27Z M28 0 63 27 38 27Z'/%3E%3Cpath fill='%2300AE8D' d='M10 27 35 27 0 54Z M38 27 63 27 28 54Z'/%3E%3C/svg%3E") no-repeat 0 50% / contain; }
.slide.is-done-cue .ft-cue { opacity: 1; }
.is-static .ft-cue { display: none; }

/* ---------- Chrome: controls, counter, overlays ---------- */
.ft-ui { position: fixed; right: 16px; bottom: 14px; display: flex; gap: 6px; align-items: center; z-index: 50;
  font: 500 15px/1 system-ui, sans-serif; color: #fff; white-space: nowrap; transition: opacity .4s; }
.ft-ui button { all: unset; cursor: pointer; padding: 7px 10px; border-radius: 6px; background: rgba(20,18,24,.55); color: #fff; }
.ft-ui button:hover { background: rgba(20,18,24,.85); }
.ft-ui button:focus-visible, .ft-ui .ft-home:focus-visible { outline: 2px solid #88DBBD; outline-offset: 2px; }
.ft-ui .ft-home { padding: 7px 10px; border-radius: 6px; background: rgba(20,18,24,.55); color: #fff; text-decoration: none; }
.ft-ui .ft-home:hover { background: rgba(20,18,24,.85); }
.ft-ui [hidden] { display: none; }
.ft-ui .ft-pdf { padding: 7px 10px; border-radius: 6px; background: #88DBBD; color: #2B2B33; font-weight: 600; text-decoration: none; }
.ft-ui .ft-pdf:hover { background: #a6e6cf; }
.ft-ui .ft-pdf:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 420px) { .ft-ui { right: 8px; gap: 4px; } .ft-ui button, .ft-ui .ft-home, .ft-ui .ft-count { padding: 7px 8px; } .ft-ui .ft-count { min-width: 0; } }
@media (max-width: 359px) { .ft-ui [data-a="fs"] { display: none; } }   /* tiny phones: fullscreen goes (iPhone Safari has none anyway) */
.ft-ui .ft-count { padding: 7px 10px; background: rgba(20,18,24,.55); border-radius: 6px; min-width: 56px; text-align: center; }
.ft-ui .ft-ph { background: #E8A317; color: #1a1a1a; padding: 7px 10px; border-radius: 6px; }
body.is-idle .ft-ui, body.hide-ui .ft-ui, body.is-embed .ft-ui { opacity: 0; pointer-events: none; }
body.is-idle { cursor: none; }

.ft-blank { position: fixed; inset: 0; background: #000; z-index: 90; display: none; }
body.is-blank .ft-blank { display: block; }

.ft-overlay { position: fixed; inset: 0; z-index: 80; display: none; overflow: auto; background: rgba(20,18,24,.94); color: #fff;
  font: 400 15px/1.5 system-ui, sans-serif; }
.ft-overlay.is-open { display: block; }
.ft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 22px; padding: 32px; }
.ft-tile { cursor: pointer; }
.ft-tile .ft-thumb { position: relative; width: 288px; height: 162px; overflow: hidden; border-radius: 4px; outline: 2px solid transparent; }
.ft-tile:hover .ft-thumb, .ft-tile.is-current .ft-thumb { outline-color: #88DBBD; }
.ft-tile .ft-thumb > .slide { display: block; width: 1600px; height: 900px; transform: scale(.18); transform-origin: 0 0; pointer-events: none; }
.ft-tile .ft-meta { margin-top: 6px; font-size: 13px; opacity: .8; display: flex; gap: 8px; }
.ft-tile .ft-meta b { color: #88DBBD; font-weight: 600; }
.ft-tile .ft-meta .ft-flag { background: #E8A317; color: #1a1a1a; padding: 0 5px; border-radius: 3px; }

.ft-notes { position: fixed; left: 16px; bottom: 60px; width: min(560px, 90vw); max-height: 45vh; overflow: auto; z-index: 70; display: none;
  background: rgba(20,18,24,.92); color: #eee; padding: 16px 20px; border-radius: 8px; font: 400 16px/1.5 system-ui, sans-serif; }
body.show-notes .ft-notes { display: block; }
.ft-help { padding: 48px; max-width: 640px; }
.ft-help kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border: 1px solid #666; border-radius: 4px; text-align: center; margin-right: 8px; }

/* ---------- Presenter view (?presenter) ---------- */
body.is-presenter { background: #141218; color: #eee; font: 400 17px/1.5 system-ui, sans-serif; overflow: auto; }
body.is-presenter .deck, body.is-presenter .ft-ui { display: none; }
.ft-pv { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto 1fr; gap: 18px; padding: 18px; height: 100vh; box-sizing: border-box; }
.ft-pv-bar { grid-column: 1 / -1; display: flex; gap: 24px; align-items: baseline; }
.ft-pv-bar .ft-clock { font: 600 34px/1 system-ui; color: #88DBBD; font-variant-numeric: tabular-nums; }
.ft-pv-bar .ft-target { opacity: .7; }
.ft-pv-bar button { all: unset; cursor: pointer; padding: 6px 12px; border: 1px solid #555; border-radius: 6px; }
.ft-pv-frames { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ft-pv-frames iframe { border: 0; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 4px; }
.ft-pv-frames .ft-next { width: 60%; opacity: .85; }
.ft-pv-notes { overflow: auto; font-size: 21px; line-height: 1.5; padding-right: 8px; }
.ft-pv-notes h4 { margin: 0 0 8px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.ft-pv-notes .cue { color: #88DBBD; font-weight: 600; }
.ft-pv-notes .src, .ft-pv-notes .asset { font-size: 15px; opacity: .65; }

/* ---------- Print / PDF: one finished slide per page ---------- */
@page { size: 1600px 900px; margin: 0; }
@media print {
  html, body { overflow: visible; height: auto; background: none; }
  .deck { position: static; }
  .deck-canvas { position: static; transform: none; width: auto; height: auto; }
  .slide { display: block !important; position: relative; width: 1600px; height: 900px; page-break-after: always; break-after: page; }
  .slide [data-step] { opacity: 1 !important; visibility: visible !important; }
  .slide *, .slide *::before, .slide *::after { animation: none !important; transition: none !important; }
  .ft-ui, .ft-overlay, .ft-notes, .ft-blank, .ph-dev { display: none !important; }
}
