:root {
  --navy: #0b1f3a;
  --teal: #149d94;
  --cyan: #c9f2ef;
  --ink: #14213d;
  --muted: #586779;
  --pale: #f3f8fa;
  --white: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--pale);
  color: var(--ink);
  font: 16px/1.5 Arial, Helvetica, sans-serif;
}

.deck-header,
.deck-footer {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 60px);
  background: var(--navy);
  color: var(--white);
}

.deck-header { position: sticky; top: 0; z-index: 20; box-shadow: 0 8px 30px rgba(11,31,58,.22); }
.brand img { display: block; width: min(220px, 28vw); height: auto; }
.deck-heading p { margin: 0; color: var(--cyan); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.deck-heading h1 { margin: 2px 0 0; font-size: clamp(18px, 2vw, 28px); line-height: 1.2; }
.header-actions,.footer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: var(--teal);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.button-secondary { background: transparent; border-color: #79d8d1; }
.button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

main { width: min(1320px, 100%); margin: 0 auto; padding: 24px clamp(12px, 3vw, 36px) 50px; }
.viewer-intro { margin-bottom: 22px; color: var(--muted); font-size: 14px; }
.viewer-intro > div:first-child { display: flex; gap: 8px; justify-content: space-between; }
.progress-track { height: 8px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #dfeaed; }
#progress-bar { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--teal), #36cbc0); transition: width .25s ease; }

.deck-pages { display: grid; gap: 34px; }
.deck-page { position: relative; overflow: hidden; border-radius: 16px; background: var(--white); box-shadow: 0 16px 50px rgba(11,31,58,.14); }
.deck-page canvas { display: block; width: 100%; height: auto; }
.slide-number { position: absolute; right: 12px; bottom: 10px; min-width: 34px; padding: 5px 8px; border-radius: 999px; background: rgba(11,31,58,.78); color: white; font-size: 12px; text-align: center; }
.page-loading { aspect-ratio: 16/9; display: grid; place-items: center; color: var(--muted); }
.viewer-error { padding: 60px 24px; border-radius: 16px; background: var(--white); text-align: center; }

.deck-footer { grid-template-columns: 1fr auto; }
.deck-footer strong,.deck-footer span { display: block; }
.deck-footer span { color: var(--cyan); }

@media (max-width: 900px) {
  .deck-header { position: static; grid-template-columns: 1fr; }
  .deck-heading { order: 2; }
  .header-actions { order: 3; justify-content: flex-start; }
  .deck-footer { grid-template-columns: 1fr; }
  .footer-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .deck-header,.deck-footer { padding: 16px; }
  .brand img { width: 190px; }
  .header-actions .button,.footer-actions .button { width: 100%; }
  .deck-pages { gap: 20px; }
  .deck-page { border-radius: 10px; }
}
