/* Slide presenter (present.html). Slides are rendered as-is on a 1920×1080 stage and scaled to fit. */

[hidden] { display: none !important; }
html, body.page-present { height: 100%; }
body.page-present { margin: 0; overflow: hidden; background: #000; color: #f2f3f7; }

/* ---------- Slide frames: a box with a scaled 1920×1080 stage inside ---------- */
.frame { position: relative; overflow: hidden; background: #000; }
.stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(0.1); /* real scale is set by present.js */
}

/* What the deck expects of every slide (the slide HTML itself is never changed). */
.stage > section {
  position: absolute; inset: 0;
  width: 1920px; height: 1080px;
  box-sizing: border-box; overflow: hidden;
  /* Defaults for the slides (the design's look; see build/slide-theme.mjs). */
  background: #fcfcfc; color: #151618;
  font-family: var(--font-slide);
  font-size: 32px; line-height: normal;
  text-align: left;
}
.stage > section * { margin: 0; box-sizing: border-box; }
/* Undo the website's own heading/link styles so slides only get what their inline styles say. */
.stage > section :is(h1, h2, h3, h4, h5, h6) { font-family: inherit; font-weight: 700; line-height: inherit; font-size: inherit; color: inherit; letter-spacing: -0.01em; }
.stage > section :is(strong, b) { font-weight: 700; }
.stage > section a { color: inherit; }
.stage aside { display: none !important; } /* speaker notes never show on a slide */

.stage.fade-in { animation: slide-fade 0.35s ease-out; }
@keyframes slide-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Audience view ---------- */
.audience { position: fixed; inset: 0; }
.viewport { position: absolute; inset: 0; padding: 0; }
.frame-main { position: absolute; inset: 0; }
body.notes-open .viewport { bottom: 34vh; }

.ui { position: absolute; inset: 0; pointer-events: none; transition: opacity 0.4s ease; }
.ui > * { pointer-events: auto; }
body.idle .ui { opacity: 0; }
body.idle .ui > * { pointer-events: none; }
body.idle { cursor: none; }
body.notes-open .ui { bottom: 34vh; }

.toolbar {
  position: absolute; top: 12px; right: 12px; left: 12px;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
}
.tb {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 48px; min-width: 48px; padding: 0.4rem 0.9rem;
  border: 0; border-radius: var(--r-pill);
  background: rgba(21, 22, 24, 0.9); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  font: 500 1.125rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
.tb:hover { background: #fff; color: var(--text-heading); }
.tb:active { transform: scale(0.98); }
.tb[aria-pressed="true"] { background: var(--focus-on-dark); color: var(--text-heading); box-shadow: none; }
/* Two-tone ring: visible on dark and on light slides. */
.tb:focus-visible { outline: 3px solid var(--focus-on-dark); outline-offset: 2px; box-shadow: 0 0 0 7px var(--text-heading); }
.tb kbd { font: inherit; font-size: 0.85em; padding: 0 0.35em; border: 1px solid currentColor; border-radius: 6px; opacity: 0.85; }
.tb-small { min-width: 48px; padding: 0.3rem 0.6rem; }

.statusbar {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: space-between; gap: 1rem; padding: 0 16px;
  font-size: 1.125rem; font-weight: 500;
}
.statusbar span { background: rgba(255, 255, 255, 0.94); color: var(--text-meta); padding: 0.25rem 0.875rem; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--ring); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--border); }
/* Slide controls as the design's outline buttons: white pills with a thin ring, readable on light and dark slides. */
.ui .tb { background: #fff; color: var(--text-heading); box-shadow: inset 0 0 0 1px var(--ring), 0 2px 8px rgba(21, 22, 24, 0.12); }
.ui .tb:hover { background: #fff; box-shadow: inset 0 0 0 2px var(--text-faint), 0 2px 8px rgba(21, 22, 24, 0.12); }
.ui .tb[aria-pressed="true"] { background: var(--text-heading); color: #fff; box-shadow: none; }
.ui .tb:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 7px #fff; }
.progress-bar { height: 100%; width: 0; background: var(--brand-orange); transition: width 0.3s ease; }

.notes-panel {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34vh;
  overflow-y: auto; padding: 1rem 1.5rem 1.5rem;
  background: var(--text-heading); color: #f2f3f7; border-top: 4px solid var(--brand-orange);
}
.notes-heading { font-size: 1.125rem; font-weight: 600; color: var(--focus-on-dark); margin: 0 0 0.5rem; }
.notes-text { font-size: 1.6rem; line-height: 1.5; }
.notes-text p { margin: 0 0 0.8em; max-width: 70ch; }
.notes-text .none { color: var(--ring); font-style: italic; }

/* ---------- Overlays (overview grid, help) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto;
  background: var(--text-heading); color: #f2f3f7;
}
.overlay-inner { max-width: 110rem; margin: 0 auto; padding: 1.5rem; }
.overlay-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; position: sticky; top: 0; padding: 0.5rem 0; background: var(--text-heading); z-index: 1; }
.overlay-head h2 { color: #fff; margin: 0; font-size: 2.25rem; }
.grid-section > h3 { display: flex; align-items: center; gap: 0.75rem; color: #fff; font-size: 1.5rem; margin: 2rem 0 1rem; }
.grid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr)); }
.thumb { position: relative; display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; }
.thumb .frame { width: 100%; aspect-ratio: 16 / 9; }
.thumb .thumb-label { display: block; }

/* "All slides" page (SlideGrid board): light background, numbered block headers, white slide cards. */
.overlay-grid { background: var(--page-bg); color: var(--text-body); }
.overlay-grid .overlay-inner { max-width: 1440px; padding: 0 2.5rem 3rem; }
@media (max-width: 760px) { .overlay-grid .overlay-inner { padding: 0 1.25rem 2rem; } }
.grid-head { align-items: flex-end; flex-wrap: wrap; padding: 2rem 0 1.25rem; background: var(--page-bg); border-bottom: 1px solid var(--border); }
.grid-eyebrow { margin: 0; font-size: 1.125rem; font-weight: 500; color: var(--text-faint); }
.overlay-grid .overlay-head h2 { color: var(--text-heading); font-size: 2.5rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0.25rem 0 0; }
.tb-light { background: #fff; color: var(--text-heading); box-shadow: inset 0 0 0 1px var(--ring); min-height: 52px; padding: 0 1.5rem; }
.tb-light:hover { background: #fff; color: var(--text-heading); box-shadow: inset 0 0 0 2px var(--text-faint); }
.overlay-grid .tb-light:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: inset 0 0 0 1px var(--ring); }
.expand-icon {
  width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: var(--expand) center / contain no-repeat; mask: var(--expand) center / contain no-repeat;
  --expand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15'/%3E%3C/svg%3E");
}
.overlay-grid .grid-section { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-top: 2.25rem; }
.overlay-grid .grid-section > h3 { margin: 0; color: var(--text-heading); font-size: 1.5rem; line-height: 1.3; font-weight: 600; }
.overlay-grid .grid-section > h3::before {
  content: attr(data-n); flex: none; width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--brand-orange); color: var(--text-heading); font-size: 1.125rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.grid-range { font-size: 1.125rem; color: var(--text-faint); }
.overlay-grid .grid-list { flex: 1 1 100%; margin-top: 0.4rem; }
.overlay-grid .thumb {
  padding: 3px; border: 0; border-radius: var(--r-panel); background: #fff; color: var(--text-heading);
  box-shadow: inset 0 0 0 1px var(--border); transition: box-shadow var(--dur) var(--ease);
}
.overlay-grid .thumb .frame { border-radius: 13px; background: var(--page-bg); }
.overlay-grid .thumb .thumb-label { padding: 0.6rem 0.6rem 0.5rem; font-size: 1.125rem; line-height: 1.3; font-weight: 600; }
.thumb-num { color: var(--text-faint); font-weight: 600; }
.overlay-grid .thumb:hover { box-shadow: inset 0 0 0 2px var(--focus); }
.overlay-grid .thumb[aria-current="true"] { box-shadow: inset 0 0 0 3px var(--btn-primary); }
.overlay-grid .thumb:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.thumb-now {
  display: none; position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 0 0.6rem; border-radius: var(--r-pill); background: var(--btn-primary); color: var(--btn-primary-fg);
  font-size: 1rem; font-weight: 600; line-height: 1.6;
}
.thumb[aria-current="true"] .thumb-now { display: block; }

.help-inner { max-width: 46rem; }
.keys { border-collapse: collapse; margin: 1rem 0 1.5rem; width: 100%; }
.keys th, .keys td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.2); vertical-align: top; }
.keys th { white-space: nowrap; }
kbd { font-family: var(--font-body); }
.keys kbd { display: inline-block; min-width: 2em; text-align: center; padding: 0.05em 0.4em; border: 2px solid #f2f3f7; border-radius: 8px; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 3rem; transform: translateX(-50%); z-index: 30;
  max-width: 90vw; padding: 0.9rem 1.5rem; border-radius: var(--r-pill);
  background: #fff; color: var(--text-heading); font-weight: 500; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* ---------- Presenter view (Presenter board) ---------- */
body.mode-presenter { background: #101113; color: #f2f3f7; overflow: auto; }
body.mode-presenter :focus-visible { outline-color: var(--focus-on-dark); }
.presenter { min-height: 100vh; display: flex; flex-direction: column; }
.pv-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem;
  min-height: 80px; padding: 0.5rem 2.5rem; border-bottom: 1px solid var(--text-meta);
}
.pv-title { font-size: 1.375rem; font-weight: 700; margin: 0; color: #fff; }
.pv-title-sub { font-weight: 400; color: #a0a1a5; }
.pv-count { margin: 0; font-size: 1.5rem; font-weight: 600; color: #fff; }
.pv-timer { display: flex; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; }
.pv-clock, .pv-used { margin: 0; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.pv-small { font-size: 1rem; color: #a0a1a5; }
.pv-clock span:last-child { font-size: 1.5rem; font-weight: 500; color: #d2d4d8; font-variant-numeric: tabular-nums; }
.pv-time { font-size: 2.125rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; min-width: 4.5ch; text-align: right; }
.pv-timer .tb { background: #252629; box-shadow: none; }
.pv-timer .tb:hover { background: var(--text-meta); color: #fff; }
.pv-main {
  flex: 1; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; min-height: 0;
  padding: 1.75rem 2.5rem;
}
.pv-current { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.pv-current .frame { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-panel); }
.pv-label { font-size: 1.125rem; font-weight: 600; margin: 0; color: #a0a1a5; }
.pv-section { font-weight: 500; }
.pv-nav { display: flex; gap: 1rem; }
.pv-nav .tb { min-height: 72px; justify-content: center; font-size: 1.375rem; box-shadow: none; }
.pv-prev { flex: 1; background: #252629; }
.pv-prev:hover { background: var(--text-meta); color: #fff; }
.pv-next { flex: 2; background: var(--btn-primary); color: var(--btn-primary-fg); }
.pv-next:hover { background: #1176f6; color: #fff; }
.pv-nav .arrow { font-size: 1.5rem; line-height: 1; }
.pv-side { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; min-height: 0; }
.frame-next { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-field); }
.pv-end { margin: 0; color: var(--ring); }
.pv-notes-box {
  flex: 1; display: flex; flex-direction: column; gap: 0.6rem; min-height: 14rem; margin-top: 0.75rem;
  background: var(--text-heading); border-radius: var(--r-card); padding: 1.5rem 1.75rem;
}
.pv-notes-head { display: flex; align-items: center; gap: 0.5rem; }
.pv-notes-head .pv-label { margin-right: auto; }
.pv-notes-head .tb { background: #252629; box-shadow: none; }
.pv-notes-head .tb:hover { background: var(--text-meta); color: #fff; }
.pv-notes {
  flex: 1; max-height: 60vh; overflow-y: auto; color: #fff; line-height: 1.55;
  font-size: var(--notes-size, 1.5rem);
}
.notes-text:focus-visible { outline: 3px solid var(--focus-on-dark); outline-offset: 2px; }

@media (max-width: 900px) {
  .pv-main { grid-template-columns: 1fr; padding: 1.25rem; }
  .pv-header { padding: 0.5rem 1.25rem; }
  .frame-next { width: 60%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .stage.fade-in { animation: none; }
  .ui, .progress-bar { transition: none; }
}

@media print {
  .ui, .notes-panel, .overlay, .toast { display: none !important; }
}
