@font-face {
  font-family: "Geologica";
  src: url("./fonts/geologica-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Geologica";
  src: url("./fonts/geologica-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geologica Light";
  src: url("./fonts/geologica-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Geologica Light";
  src: url("./fonts/geologica-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Unbounded";
  src: url("./fonts/unbounded-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  src: url("./fonts/unbounded-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Unbounded SemiBold";
  src: url("./fonts/unbounded-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded SemiBold";
  src: url("./fonts/unbounded-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #17201f;
  --muted: #66706d;
  --paper: #f3f4ef;
  --surface: #ffffff;
  --line: #d9ded8;
  --accent: #f5a800;
  --accent-soft: #ffd36f;
  --radius: 22px;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
.parsed-page { scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); }
button, input { font: inherit; }

.landing {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(23, 32, 31, .06) 50%, transparent 50.2%),
    linear-gradient(rgba(23, 32, 31, .045) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 100%, 100% 32px, auto;
}

.landing__panel { width: min(1080px, 100%); }
.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .17em;
}
.landing h1 {
  width: min(720px, 100%);
  margin: 0 0 50px;
  font-size: clamp(36px, 6vw, 74px);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: .98;
}
.landing__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mode-card {
  position: relative;
  display: grid;
  min-height: 280px;
  padding: 28px;
  border-radius: var(--radius);
  color: white;
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease;
}
.mode-card:hover { transform: translateY(-5px); box-shadow: 0 24px 50px rgba(23,32,31,.14); }
.mode-card--dark { background: var(--ink); }
.mode-card--accent { color: var(--ink); background: var(--accent); }
.mode-card__index { align-self: start; font-size: 13px; font-weight: 800; opacity: .65; }
.mode-card__title { align-self: end; font-size: clamp(28px, 4vw, 48px); font-weight: 650; letter-spacing: -.04em; }
.mode-card__meta { align-self: end; margin-top: 8px; font-size: 14px; opacity: .65; }

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 96px;
  padding: 20px clamp(20px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(243,244,239,.88);
  backdrop-filter: blur(14px);
}
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.topbar .eyebrow { margin-bottom: 4px; }
.topbar__note { margin: 0; color: var(--muted); font-size: 13px; }
.back-link {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font-size: 22px;
  text-decoration: none;
}

.viewer-shell { width: min(1180px, calc(100% - 40px)); margin: 36px auto 70px; }
.viewer-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 18px 55px rgba(23,32,31,.08); }
.slide-viewport {
  position: relative;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  background: #0f1413;
  transition: opacity .14s ease;
}
.slide-viewport.is-changing { opacity: .55; }
#pptx-player, #parsed-slide {
  position: absolute;
  top: 0;
  left: 50%;
  width: 960px;
  height: 540px;
  transform-origin: top center;
}
#pptx-player { transform: translateX(-50%) scale(var(--player-scale, 1)); }
#parsed-slide { transform: translateX(-50%) scale(var(--slide-scale, 1)); }
#parsed-slide .slide-container,
#parsed-slide .pptx-preview-slide-wrapper { margin: 0 !important; }
#pptx-player .pptx-preview-wrapper { margin: 0 !important; }
#pptx-player .pptx-preview-wrapper-next,
#pptx-player .pptx-preview-wrapper-pagination { display: none !important; }
.loading-indicator { display: none; position: absolute; inset: 0; z-index: 50; place-items: center; background: #0f1413; }
.is-loading .loading-indicator { display: grid; }
.loading-indicator > span,
.loading-spinner { width: 42px; height: 42px; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-progress { display: grid; width: min(420px, calc(100% - 48px)); justify-items: center; gap: 13px; color: white; }
.loading-progress strong { font-size: 15px; letter-spacing: -.01em; }
.loading-progress__track { width: 100%; height: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.14); }
.loading-progress__track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .15s ease; }
.loading-progress__track.is-indeterminate span { width: 35%; animation: loading-slide 1.2s ease-in-out infinite; }
.loading-progress__details { color: rgba(255,255,255,.62); font-size: 12px; font-variant-numeric: tabular-nums; }
@keyframes loading-slide { from { transform: translateX(-110%); } to { transform: translateX(310%); } }

.viewer-controls {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 12px 18px;
}
.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font-size: 22px;
  cursor: pointer;
}
.icon-button:hover:not(:disabled) { border-color: var(--ink); }
.icon-button:disabled { cursor: wait; opacity: .35; }
.slide-counter { justify-self: center; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.status-row { display: flex; justify-content: space-between; gap: 20px; margin: 14px 4px 0; color: var(--muted); font-size: 12px; }
.text-button { border: 0; padding: 0; color: var(--ink); background: transparent; font-weight: 700; cursor: pointer; }
.implementation-note { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; margin-top: 26px; padding: 20px 22px; border: 1px solid #e5c46f; border-radius: 16px; background: #fff7df; }
.implementation-note__label { padding: 7px 9px; border-radius: 7px; color: #684900; background: var(--accent-soft); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.implementation-note p { margin: 0; color: #4f493b; font-size: 14px; line-height: 1.55; }
.implementation-note a { color: var(--ink); font-weight: 750; text-underline-offset: 3px; }
.implementation-note__aside { color: var(--muted); }

.media-section { margin-top: 16px; }
.media-list { display: grid; gap: 12px; }
.wave-player { display: grid; grid-template-columns: 52px minmax(0, 1fr) 48px; align-items: center; gap: 16px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 10px 30px rgba(23,32,31,.06); }
.wave-player audio { display: none; }
.wave-player__play { display: grid; width: 48px; height: 48px; place-items: center; border: 0; border-radius: 50%; color: var(--ink); background: var(--accent); font-size: 17px; font-weight: 900; cursor: pointer; }
.wave-player__body { min-width: 0; }
.wave-player__wave { display: flex; width: 100%; height: 34px; align-items: center; gap: 2px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.wave-player__wave span { flex: 1; min-width: 1px; height: var(--bar-height); border-radius: 4px; background: #ccd2cc; transition: height .2s ease, background .1s ease; }
.wave-player__wave span.is-played { background: var(--accent); }
.wave-player__time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.parsed-video-slide { width: 960px; height: 540px; background: #000; }
.parsed-video-slide .plyr { width: 100%; height: 100%; --plyr-color-main: var(--accent); --plyr-video-control-color-hover: var(--ink); }
.parsed-video-slide .plyr__video-wrapper { height: 100%; }
.parsed-video-slide video { width: 100%; height: 100%; object-fit: contain; }
.slide-notes { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 18px; margin-top: 16px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.slide-notes[hidden] { display: none; }
.slide-notes__label { padding: 7px 9px; border-radius: 7px; color: #684900; background: var(--accent-soft); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.slide-notes p { margin: 2px 0 0; color: #414946; font-size: 14px; line-height: 1.6; white-space: pre-line; }

@media (max-width: 700px) {
  .landing { padding: 20px; }
  .landing__actions { grid-template-columns: 1fr; }
  .mode-card { min-height: 210px; }
  .topbar { grid-template-columns: auto 1fr; padding: 16px 18px; }
  .topbar__note { grid-column: 2; }
  .viewer-shell { width: calc(100% - 20px); margin-top: 20px; }
  .slide-viewport { min-height: 0; }
  .wave-player { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 13px; }
  .wave-player__play { width: 42px; height: 42px; }
  .wave-player__time { grid-column: 2; margin-top: -8px; text-align: left; }
  .slide-notes { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .slide-notes__label { justify-self: start; }
  .implementation-note { grid-template-columns: 1fr; gap: 10px; }
  .implementation-note__label { justify-self: start; }
}
