:root {
  color-scheme: dark;
  --navy: #0b1f3a;
  --navy-2: #132b4d;
  --navy-3: #1b365e;
  --gold: #b98a2b;
  --gold-light: #e3bd65;
  --terracotta: #ad5038;
  --cream: #f4f0e7;
  --white: #ffffff;
  --muted: #afbbcb;
  --line: rgba(255, 255, 255, 0.17);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(185, 138, 43, 0.12), transparent 30%),
    linear-gradient(145deg, #071526, #0b1f3a 58%, #071728);
  color: var(--white);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

.deck-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 58px;
}

.topbar,
.controlbar {
  width: min(1500px, calc(100% - 34px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 20;
}

.topbar { justify-content: space-between; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  padding: 6px 0;
}

.brand-word {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  letter-spacing: 0.15em;
}

.brand-word span { color: var(--gold-light); }

.brand-sub {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

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

.text-button,
.icon-button,
.nav-button,
.dialog-close {
  border: 1px solid var(--line);
  background: rgba(15, 38, 67, 0.7);
  color: var(--white);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.text-button:hover,
.icon-button:hover,
.nav-button:hover,
.dialog-close:hover {
  background: var(--navy-3);
  border-color: rgba(227, 189, 101, 0.62);
}

.text-button { border-radius: 999px; padding: 8px 14px; font-size: 0.82rem; }

.icon-button,
.dialog-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.icon-button svg,
.nav-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stage-wrap {
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
  position: relative;
  padding: 0 68px;
}

.stage {
  position: relative;
  width: min(100%, calc((100vh - 132px) * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 132px);
  background: var(--navy);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(3.5%, 0, 0) scale(0.992);
  transition: opacity 260ms ease, transform 300ms ease, visibility 300ms;
  pointer-events: none;
  background: var(--navy);
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
  z-index: 3;
}

.slide.is-before { transform: translate3d(-3.5%, 0, 0) scale(0.992); }

.slide-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.video-launch {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 18px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(5, 17, 33, 0.86);
  color: var(--white);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  text-align: left;
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease;
}

.video-launch:hover { transform: translateY(-2px); background: rgba(11, 31, 58, 0.96); }

.video-launch.family { left: 4.5%; bottom: 5.5%; }
.video-launch.competition { right: 3.5%; bottom: 5.5%; }

.play-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.95rem;
  padding-left: 2px;
}

.video-launch strong,
.video-launch small { display: block; }
.video-launch strong { font-size: 0.8rem; letter-spacing: 0.06em; }
.video-launch small { margin-top: 2px; color: var(--muted); font-size: 0.7rem; }

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 66px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  z-index: 10;
}

.nav-button:disabled { opacity: 0.2; cursor: default; }
.nav-prev { left: 14px; }
.nav-next { right: 14px; }

.controlbar { gap: 18px; }

.page-meta {
  width: 330px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-count { color: var(--gold-light); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.1em; }
.page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.76rem; }

.progress-track {
  height: 3px;
  flex: 1;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 220ms ease;
}

.keyboard-hint { color: #75849a; font-size: 0.7rem; white-space: nowrap; }
kbd { font-family: inherit; border: 1px solid rgba(255,255,255,.24); border-radius: 4px; padding: 1px 5px; }

.outline-dialog,
.video-dialog {
  border: 1px solid var(--line);
  color: var(--white);
  background: linear-gradient(160deg, #0b1f3a, #071525);
  box-shadow: var(--shadow);
}

.outline-dialog::backdrop,
.video-dialog::backdrop { background: rgba(2, 8, 18, 0.82); backdrop-filter: blur(8px); }

.outline-dialog {
  width: min(960px, calc(100% - 32px));
  max-height: min(820px, calc(100% - 32px));
  border-radius: 22px;
  padding: 0;
}

.dialog-header,
.video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2,
.video-header h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; }
.eyebrow { margin: 0; color: var(--gold-light); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.11em; }
.dialog-close { font-size: 1.5rem; line-height: 1; }

.outline-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.outline-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 18px;
  border: 0;
  color: var(--white);
  background: #0b1f3a;
  cursor: pointer;
  text-align: left;
}

.outline-item:hover,
.outline-item.is-current { background: var(--navy-3); }
.outline-item.is-current { box-shadow: inset 4px 0 0 var(--gold); }
.outline-number { color: var(--gold-light); font-size: 0.72rem; font-weight: 800; }
.outline-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; }

.video-dialog {
  width: min(1160px, calc(100% - 28px));
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
}

.video-dialog video {
  display: block;
  width: 100%;
  max-height: calc(100vh - 150px);
  background: #000;
}

.custom-slide {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 5.8% 6.2% 4.5%;
  background:
    linear-gradient(90deg, transparent 0 64%, rgba(185, 138, 43, 0.08) 64% 100%),
    var(--navy);
}

.custom-slide.light {
  color: var(--navy);
  background: var(--cream);
}

.custom-kicker {
  margin: 0 0 3.2%;
  color: var(--gold-light);
  font-size: clamp(0.64rem, 0.86vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.custom-slide.light .custom-kicker { color: #966d1c; }

.custom-title {
  max-width: 86%;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.15vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.harbour-name {
  margin: 1.6% 0 3.2%;
  color: var(--terracotta);
  font-size: clamp(1.5rem, 2.65vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 2.6%;
}

.comparison-panel {
  min-height: 245px;
  padding: 3.2%;
  border: 1px solid rgba(11, 31, 58, 0.17);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.comparison-panel.accent {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.comparison-panel h3 {
  margin: 0 0 14px;
  color: var(--terracotta);
  font-size: clamp(0.8rem, 1.15vw, 1.18rem);
  letter-spacing: 0.05em;
}

.comparison-panel.accent h3 { color: var(--gold-light); }
.comparison-panel ul { margin: 0; padding-left: 1.1em; }
.comparison-panel li { margin: 0.46em 0; font-size: clamp(0.78rem, 1.13vw, 1.12rem); line-height: 1.25; }

.custom-punch {
  margin: 2.8% auto 0;
  max-width: 94%;
  color: var(--terracotta);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.65vw, 1.7rem);
  font-weight: 800;
  line-height: 1.18;
  text-align: center;
}

.custom-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 2.2%;
}

.custom-links a {
  border-bottom: 1px solid currentColor;
  color: var(--navy);
  font-size: clamp(0.68rem, 0.85vw, 0.82rem);
  font-weight: 750;
  text-decoration: none;
}

.custom-source {
  margin: 1.4% 0 0;
  color: #68768a;
  font-size: clamp(0.58rem, 0.72vw, 0.7rem);
  text-align: center;
}

.return-slide {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 78% 28%, rgba(185, 138, 43, 0.2), transparent 28%),
    var(--navy);
}

.return-quote {
  align-self: center;
  max-width: 1080px;
  margin: 0;
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3.45vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.022em;
}

.return-quote strong { color: var(--gold-light); }

.return-footer {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
}

.return-badge {
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--terracotta);
  color: var(--white);
  font-size: clamp(0.62rem, 0.8vw, 0.76rem);
  font-weight: 850;
  letter-spacing: 0.04em;
}

.return-line {
  color: var(--gold-light);
  font-size: clamp(0.8rem, 1.42vw, 1.38rem);
  font-weight: 850;
  text-align: right;
}

@media (max-width: 850px) {
  .deck-shell { grid-template-rows: 48px minmax(0, 1fr) 54px; }
  .brand-sub, .keyboard-hint { display: none; }
  .stage-wrap { padding: 0 8px; }
  .stage { width: 100%; max-height: calc(100vh - 110px); }
  .nav-button { top: auto; bottom: 8px; width: 42px; height: 42px; border-radius: 50%; }
  .nav-prev { left: 16px; }
  .nav-next { right: 16px; }
  .controlbar { width: calc(100% - 32px); gap: 10px; }
  .page-meta { width: min(58%, 330px); }
  .outline-list { grid-template-columns: 1fr; }
  .video-launch { min-height: 42px; padding: 6px 12px 6px 7px; }
  .play-icon { width: 28px; height: 28px; }
  .video-launch strong { font-size: 0.65rem; }
  .video-launch small { display: none; }
}

@media (max-aspect-ratio: 3/4) {
  .custom-slide { padding: 6.5% 5.5%; }
  .comparison-grid { grid-template-columns: 1fr; }
  .comparison-panel { min-height: auto; }
  .custom-title { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
