:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101915;
  color: #f5f8f6;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

button, a { font: inherit; }

button { cursor: pointer; }

button:focus-visible, a:focus-visible {
  outline: 3px solid #85e2ab;
  outline-offset: 3px;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 16px clamp(16px, 3vw, 36px);
}

.identity__eyebrow {
  color: #91d9ab;
  display: block;
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .12em;
}

h1 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 3px 0 0;
}

.topbar__actions { align-items: center; display: flex; gap: 8px; }

.text-button {
  background: transparent;
  border: 1px solid #506457;
  border-radius: 9px;
  color: #f5f8f6;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  min-width: 82px;
  padding: 11px 15px;
  text-decoration: none;
  white-space: nowrap;
}

.text-button:hover { background: #20352a; }

.text-button[hidden] { display: none; }

.main {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 0 12px;
}

.slide-frame {
  align-items: center;
  background: #fff;
  box-shadow: 0 18px 56px #0008;
  display: flex;
  justify-content: center;
  max-height: calc(100dvh - 230px);
  max-width: 100%;
  overflow: hidden;
  width: min(100%, calc((100dvh - 230px) * 16 / 9));
}

.slide {
  aspect-ratio: 16 / 9;
  display: block;
  height: auto;
  max-height: calc(100dvh - 230px);
  object-fit: contain;
  width: 100%;
}

.controls {
  align-items: center;
  display: flex;
  gap: clamp(18px, 5vw, 48px);
  justify-content: center;
  margin-top: 16px;
  width: 100%;
}

.nav-button {
  background: #20352a;
  border: 1px solid #44644f;
  border-radius: 10px;
  color: #f5f8f6;
  min-height: 48px;
  min-width: 112px;
  padding: 9px 14px;
}

.nav-button:hover:not(:disabled) { background: #2b4936; }
.nav-button:active:not(:disabled) { transform: scale(.98); }
.nav-button:disabled { cursor: default; opacity: .42; }

.counter {
  color: #d8e8dd;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: center;
}

.keyboard-hint, .rotate-hint {
  color: #a5b8aa;
  font-size: .78rem;
  text-align: center;
}

.keyboard-hint { margin: 12px 0 0; }
.rotate-hint { display: none; margin: 0 0 10px; }

.footer { padding: 8px 16px 16px; text-align: center; }
.footer a { color: #a8e7bc; font-size: .8rem; }
.noscript { padding: 16px; text-align: center; }

.app:fullscreen { background: #101915; }
.app:fullscreen .slide-frame,
.app:fullscreen .slide { max-height: calc(100dvh - 210px); }
.app:fullscreen .slide-frame { width: min(100%, calc((100dvh - 210px) * 16 / 9)); }

@media (max-width: 640px) {
  .topbar { padding: 12px 14px; }
  .identity__eyebrow { font-size: .57rem; }
  h1 { font-size: 1rem; }
  .text-button { min-width: 70px; padding: 10px; font-size: .8rem; }
  .slide-frame { width: 100%; }
  .controls { gap: 14px; }
  .nav-button { min-width: 92px; }
  .keyboard-hint { display: none; }
}

@media (max-width: 640px) and (orientation: portrait) {
  .main { justify-content: flex-start; padding-top: 18px; }
  .slide-frame { order: 1; }
  .controls { order: 2; }
  .rotate-hint { display: block; margin: 18px 12px 0; order: 3; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .topbar { padding-top: 6px; padding-bottom: 6px; }
  .identity__eyebrow, .footer, .keyboard-hint { display: none; }
  .slide-frame, .slide, .app:fullscreen .slide-frame, .app:fullscreen .slide {
    max-height: calc(100dvh - 130px);
  }
  .slide-frame, .app:fullscreen .slide-frame {
    width: min(100%, calc((100dvh - 130px) * 16 / 9));
  }
  .controls { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-button:active:not(:disabled) { transform: none; }
}
