:root {
  color-scheme: light;
  --ink: #102b2a;
  --ink-soft: #4d5e59;
  --paper: #f7f0df;
  --paper-deep: #e9dfc7;
  --paper-light: #fffaf0;
  --sea: #2f7775;
  --sea-dark: #0b2c32;
  --sea-light: #97c8bd;
  --gold: #c3913f;
  --rust: #b9553d;
  --line: rgba(16, 43, 42, 0.16);
  --line-strong: rgba(16, 43, 42, 0.28);
  --white: #fffdf7;
  --shadow: 0 26px 70px rgba(22, 47, 43, 0.12);
  --serif: "Iowan Old Style", "Baskerville", "Palatino Linotype", Georgia, serif;
  --sans: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 4%, rgba(195, 145, 63, 0.12), transparent 22rem),
    linear-gradient(rgba(16, 43, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 43, 42, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 34px 34px, 34px 34px, auto;
  color: var(--ink);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.17;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

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

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(1240px, calc(100vw - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr minmax(180px, 340px) 1fr;
  gap: 24px;
  align-items: center;
  padding: 10px max(20px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(255, 253, 247, 0.1);
  background: color-mix(in srgb, var(--sea-dark) 91%, transparent);
  color: var(--white);
  backdrop-filter: blur(16px);
}

.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 253, 247, 0.35);
  border-radius: 50%;
  color: #efd397;
  font-family: var(--serif);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--serif);
  font-size: 1.04rem;
  line-height: 1;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 253, 247, 0.6);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-progress {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  color: rgba(255, 253, 247, 0.72);
  font-size: 0.74rem;
}

.progress-rail {
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 253, 247, 0.16);
}

.progress-rail span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #efd397;
  transition: width 150ms linear;
}

.header-link {
  justify-self: end;
  padding: 8px 0;
  color: rgba(255, 253, 247, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
  text-underline-offset: 5px;
}

.header-nav {
  justify-self: end;
  display: flex;
  gap: 18px;
  align-items: center;
}

/* Arabic script needs a little more size than the Latin nav links to stay
   comfortably legible at header scale. */
.language-link {
  font-size: 0.92rem;
}

.header-treasure-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
}

.hero {
  min-height: calc(100svh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(44px, 7vw, 96px);
  align-items: center;
  padding-block: clamp(58px, 9vw, 112px);
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--sea);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 10ch;
  font-family: var(--serif);
  font-size: clamp(4.3rem, 8.7vw, 8.4rem);
  font-weight: 520;
  letter-spacing: -0.065em;
  line-height: 0.82;
  text-wrap: balance;
}

.hero h1::after {
  content: "";
  display: block;
  width: 78px;
  height: 5px;
  margin-top: 32px;
  background: var(--rust);
}

.hero-lead {
  max-width: 58ch;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.16rem, 2vw, 1.42rem);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 30px;
}

.hero-actions-break {
  height: 0;
  flex-basis: 100%;
}

.hero-quiet-link {
  padding: 4px 0;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 760;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--gold) 75%, transparent);
  text-underline-offset: 5px;
}

.hero-quiet-link:hover {
  text-decoration-color: var(--rust);
}

.hero-quiet-link + .hero-quiet-link {
  margin-inline-start: 10px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 780;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  border-color: var(--sea-dark);
  background: var(--sea-dark);
  color: var(--white);
}

.button-secondary,
.button-resume {
  background: rgba(255, 253, 247, 0.54);
}

.button-treasure {
  border-color: color-mix(in srgb, var(--gold) 68%, var(--ink));
  background: #efd397;
  color: var(--sea-dark);
  cursor: pointer;
}

.button-resume {
  border-color: var(--gold);
  color: #735017;
}

.story-stats {
  display: flex;
  gap: 28px;
  margin: 34px 0 0;
}

.story-stats div {
  display: grid;
  gap: 2px;
}

.story-stats dt {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
}

.story-stats dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-visual {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border-radius: 220px 220px 16px 16px;
  background: var(--sea-dark);
  box-shadow: var(--shadow);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(7, 30, 35, 0.76));
  pointer-events: none;
}

.hero-visual > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* Marks the boundaries between the stacked triptych panels so the seams read
   as a deliberate film-strip, not a rendering accident. The image is cover-fit
   and width-driven (2:3 source), so each panel is exactly half the container
   width tall — padding-top percentages resolve against width. */
.hero-seam {
  position: absolute;
  inset-inline: 0;
  top: 0;
  padding-top: 50%;
  border-bottom: 3px solid var(--paper);
  pointer-events: none;
}

.hero-seam::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 100%;
  padding-top: 50%;
  border-bottom: 3px solid var(--paper);
}

.hero-stamp {
  position: absolute;
  z-index: 2;
  left: 28px;
  bottom: 28px;
  display: grid;
  gap: 2px;
  color: var(--white);
}

.hero-stamp span {
  color: rgba(255, 253, 247, 0.7);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-stamp strong {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 520;
}

.compass {
  position: absolute;
  z-index: 2;
  right: 24px;
  top: 56%;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: start center;
  border: 1px solid rgba(255, 253, 247, 0.46);
  border-radius: 50%;
  color: var(--white);
}

.compass::before,
.compass::after {
  content: "";
  position: absolute;
  background: rgba(255, 253, 247, 0.46);
}

.compass::before {
  width: 1px;
  height: 90px;
  top: -8px;
}

.compass::after {
  width: 90px;
  height: 1px;
  left: -8px;
  top: 37px;
}

.compass span {
  position: relative;
  z-index: 1;
  padding: 7px;
  font-size: 0.65rem;
  font-weight: 800;
}

.journey {
  padding-block: 100px 76px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
  gap: 56px;
  align-items: end;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.section-heading > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.7;
}

.route-frame {
  position: relative;
}

.route-scroll {
  overflow-x: auto;
  border-radius: 18px;
  background: var(--sea-dark);
  box-shadow: var(--shadow);
  scrollbar-color: rgba(239, 211, 151, 0.7) transparent;
}

.route-hint {
  position: absolute;
  right: 14px;
  bottom: 16px;
  z-index: 3;
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 253, 247, 0.35);
  border-radius: 50%;
  background: rgba(11, 44, 50, 0.85);
  color: #efd397;
  font-size: 1.05rem;
  pointer-events: none;
  animation: route-hint-nudge 1.6s ease-in-out infinite;
  transition: opacity 300ms ease;
}

.route-hint-hidden {
  opacity: 0;
}

@keyframes route-hint-nudge {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(6px);
  }
}

.story-route {
  position: relative;
  min-width: 1060px;
  height: 500px;
  overflow: hidden;
  background:
    radial-gradient(circle at 46% 18%, rgba(151, 200, 189, 0.12), transparent 26%),
    linear-gradient(rgba(255, 253, 247, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 253, 247, 0.035) 1px, transparent 1px),
    #0b2c32;
  background-size: auto, 35px 35px, 35px 35px, auto;
}

.route-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-land {
  fill: rgba(195, 145, 63, 0.11);
  stroke: rgba(239, 211, 151, 0.18);
  stroke-width: 2;
}

.route-glow {
  fill: none;
  stroke: url(#seaGlow);
  stroke-width: 24;
  filter: url(#softGlow);
}

.route-line {
  fill: none;
  stroke: rgba(239, 211, 151, 0.72);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 0.006 0.014;
  animation: route-line-sail 26s linear infinite;
}

@keyframes route-line-sail {
  to {
    stroke-dashoffset: -0.1;
  }
}

.route-waves path {
  fill: none;
  stroke: rgba(151, 200, 189, 0.22);
  stroke-width: 2;
}

.route-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--white);
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.node-dot {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 253, 247, 0.48);
  border-radius: 50%;
  background: #123e44;
  color: #efd397;
  font-family: var(--serif);
  font-size: 1.05rem;
  box-shadow: 0 0 0 7px rgba(11, 44, 50, 0.72);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.node-label {
  width: max-content;
  display: grid;
  gap: 1px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 253, 247, 0.12);
  border-radius: 8px;
  background: rgba(11, 44, 50, 0.82);
}

.node-label b {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 650;
}

.node-label small {
  color: rgba(255, 253, 247, 0.6);
  font-size: 0.68rem;
}

.route-node:hover .node-dot,
.route-node[aria-current="step"] .node-dot {
  transform: scale(1.12);
  background: #efd397;
  color: var(--sea-dark);
}

/* Flipped nodes anchor the dot itself on (--x, --y) and hang the label to the
   left, so long labels near the map's right edge cannot collide with the next
   dot or clip against the map boundary — in any language. */
.route-node-flip {
  width: 46px;
  height: 46px;
}

.route-node-flip .node-dot {
  width: 100%;
  height: 100%;
}

.route-node-flip .node-label {
  position: absolute;
  right: calc(100% + 9px);
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
}

.story-purpose {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  margin-bottom: 60px;
  padding: 34px 38px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.story-purpose .eyebrow {
  margin-top: 8px;
}

.purpose-treasure-link {
  max-width: 210px;
  margin-top: 22px;
  padding: 0 0 7px;
  border: 0;
  border-bottom: 1px solid var(--gold);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.purpose-treasure-link span {
  color: var(--rust);
}

.story-purpose > p:last-child {
  max-width: 880px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 2.05rem);
  line-height: 1.42;
}

.episode {
  /* Text-safe version of the accent: the raw golds fall below 4.5:1 on the
     cream backgrounds at small sizes, so anything reading-sized uses this. */
  --episode-accent-ink: color-mix(in srgb, var(--episode-accent) 65%, var(--ink));
  position: relative;
  padding-block: clamp(72px, 10vw, 126px);
  border-top: 1px solid var(--line);
}

.episode:nth-child(even) {
  background: rgba(255, 253, 247, 0.46);
}

.episode::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: var(--episode-accent);
}

.episode-heading {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  margin-bottom: 32px;
}

.episode-number {
  display: grid;
  gap: 3px;
  padding-right: 20px;
  border-right: 1px solid var(--line-strong);
}

.episode-number span {
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.episode-number strong {
  color: var(--episode-accent-ink);
  font-family: var(--serif);
  font-size: 3.6rem;
  font-weight: 520;
  line-height: 0.9;
}

.episode-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 5.4rem);
  font-weight: 520;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.episode-heading > div:nth-child(2) > p:last-child {
  max-width: 62ch;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.6;
}

.track-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.track-controls button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.66);
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.track-controls button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--white);
}

.track-controls button:disabled {
  cursor: default;
  opacity: 0.32;
}

.scene-count {
  min-width: 46px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  text-align: center;
}

.scene-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(720px, 86vw);
  gap: 18px;
  overflow-x: auto;
  padding: 5px 2px 30px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 43, 42, 0.22) transparent;
}

.scene-card {
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-light);
  box-shadow: 0 18px 44px rgba(24, 52, 48, 0.09);
}

.scene-visual {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--sea-dark);
}

.scene-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -28px 42px rgba(4, 22, 24, 0.12);
  pointer-events: none;
}

.scene-visual img {
  position: absolute;
  left: 0;
  width: 100%;
  max-width: none;
  height: 300%;
  object-fit: fill;
}

.scene-visual.panel-1 img { top: 0; }
.scene-visual.panel-2 img { top: -100%; }
.scene-visual.panel-3 img { top: -200%; }

.scene-copy {
  min-height: 280px;
  display: grid;
  align-content: start;
  padding: clamp(24px, 3.4vw, 38px);
}

.scene-label {
  color: var(--episode-accent-ink);
  font-size: 0.7rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scene-copy h3 {
  margin: 10px 0 15px;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  font-weight: 560;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.scene-copy p {
  max-width: 62ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.72;
}

.episode-next {
  width: fit-content;
  display: grid;
  gap: 3px;
  margin: 22px 0 0 auto;
  padding: 12px 0;
  color: var(--ink);
  text-align: right;
  text-decoration: none;
}

.episode-next span {
  color: var(--ink-soft);
  font-size: 0.67rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.episode-next strong {
  color: var(--episode-accent-ink);
  font-family: var(--serif);
  font-size: 1.22rem;
}

body:has(.treasure-dialog[open]) {
  overflow: hidden;
}

.treasure-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}

.treasure-dialog::backdrop {
  background: rgba(4, 22, 24, 0.78);
  backdrop-filter: blur(8px);
}

.treasure-sheet {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  padding: clamp(34px, 6vw, 78px) 0 50px;
}

.treasure-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line-strong);
}

.treasure-header h2 {
  max-width: 850px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 6.6rem);
  font-weight: 520;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.treasure-header > div > p:last-child {
  max-width: 680px;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.treasure-close {
  position: sticky;
  top: 20px;
  z-index: 2;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper-light);
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(16, 43, 42, 0.1);
}

.treasure-object-key {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 34px 0 72px;
}

.treasure-object-key article {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-light);
  box-shadow: 0 14px 36px rgba(16, 43, 42, 0.08);
}

.object-photo {
  position: relative;
  aspect-ratio: 3 / 2;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--sea-dark);
}

.object-photo::after,
.step-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -24px 34px rgba(4, 22, 24, 0.1);
  pointer-events: none;
}

.object-photo img,
.step-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.treasure-object-key article > div {
  padding: 19px 20px 22px;
}

.treasure-object-key strong,
.treasure-object-key small {
  display: block;
}

.treasure-object-key strong {
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.treasure-object-key small {
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.45;
}

.treasure-chain {
  position: relative;
  display: grid;
  gap: 18px;
}

.treasure-chain::before {
  content: "";
  position: absolute;
  top: 46px;
  bottom: 46px;
  left: 43px;
  width: 2px;
  background: linear-gradient(var(--rust), var(--gold), var(--sea));
}

.treasure-step {
  position: relative;
  min-height: 244px;
  display: grid;
  grid-template-columns: 88px minmax(260px, 320px) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding: 24px 36px 24px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-light);
  box-shadow: 0 12px 35px rgba(16, 43, 42, 0.07);
}

.step-number {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(255, 253, 247, 0.28);
  border-radius: 50%;
  background: var(--sea-dark);
  color: #efd397;
  font-family: var(--serif);
  font-size: 0.85rem;
  box-shadow: 0 0 0 7px var(--paper-light);
}

.step-kicker {
  margin: 0 0 6px;
  color: var(--rust);
  font-size: 0.67rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.treasure-step h3 {
  margin: 0 0 9px;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  font-weight: 560;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.treasure-step > div:last-child > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.step-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  margin: 0;
  overflow: hidden;
  border-radius: 9px;
  background: var(--sea-dark);
}

.treasure-answer {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-top: 42px;
  padding: 32px 36px;
  border-radius: 14px;
  background: var(--sea-dark);
  color: var(--white);
}

.treasure-answer > span {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 211, 151, 0.42);
  border-radius: 50%;
  color: #efd397;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
}

.treasure-answer p {
  max-width: 900px;
  margin: 0;
  color: rgba(255, 253, 247, 0.75);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  line-height: 1.5;
}

.treasure-answer strong {
  color: var(--white);
}

.treasure-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  padding-top: 34px;
}

.treasure-footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.treasure-footer p span {
  padding-inline: 5px;
  color: var(--rust);
}

.treasure-footer .button {
  flex: 0 0 auto;
  cursor: pointer;
}

.site-footer {
  padding-block: 54px;
  background: var(--sea-dark);
  color: var(--white);
}

.footer-inner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.footer-inner p {
  margin: 0;
  color: rgba(255, 253, 247, 0.68);
  line-height: 1.6;
}

.footer-inner strong {
  color: var(--white);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.footer-inner a {
  color: #efd397;
  font-weight: 760;
  text-underline-offset: 5px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 22px;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 70%, transparent);
  outline-offset: 4px;
}

@media (min-width: 701px) and (max-width: 1120px) {
  .route-hint {
    display: grid;
  }
}

/* Below 700px the horizontal sea chart becomes a vertical voyage: same DOM,
   same localized labels, no sideways scrolling. The SVG art is hidden and the
   absolutely-positioned stops reflow into a top-to-bottom list joined by a
   dashed gold line. */
@media (max-width: 700px) {
  .route-art {
    display: none;
  }

  .route-scroll {
    overflow: visible;
    border-radius: 16px;
  }

  .story-route {
    position: relative;
    min-width: 0;
    height: auto;
    display: grid;
    gap: 38px;
    padding: 26px 14px 28px;
  }

  /* The voyage keeps winding on phones: stops alternate shores and each pair
     is joined by a dashed S-curve drawn from two quarter-arcs — a route, not
     a queue. Logical properties keep the curve correct in both directions. */
  .route-node {
    position: relative;
    left: auto;
    top: auto;
    z-index: 1;
    transform: none;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 86%;
    padding: 0;
  }

  .route-node:nth-of-type(even) {
    margin-inline-start: auto;
    flex-direction: row-reverse;
  }

  .route-node:nth-of-type(even) .node-label {
    text-align: end;
  }

  .route-node:not(:last-of-type)::before,
  .route-node:not(:last-of-type)::after {
    content: "";
    position: absolute;
    height: 24px;
    border: 2px dashed rgba(239, 211, 151, 0.55);
    pointer-events: none;
  }

  /* arc one: drop from this stop's circle, sweep toward midstream */
  .route-node:not(:last-of-type)::before {
    top: calc(100% + 2px);
    inset-inline-start: 21px;
    inset-inline-end: 45%;
    border-block-start: 0;
    border-inline-end: 0;
    border-end-start-radius: 24px;
  }

  /* arc two: continue past the node's edge onto the next, alternated stop */
  .route-node:not(:last-of-type)::after {
    top: calc(100% + 24px);
    inset-inline-start: 55%;
    inset-inline-end: calc(21px - 16.28%);
    border-block-end: 0;
    border-inline-start: 0;
    border-start-end-radius: 24px;
  }

  .route-node:nth-of-type(even):not(:last-of-type)::before {
    inset-inline-start: 45%;
    inset-inline-end: 21px;
    border-inline-start: 0;
    border-inline-end: 2px dashed rgba(239, 211, 151, 0.55);
    border-end-start-radius: 0;
    border-end-end-radius: 24px;
  }

  .route-node:nth-of-type(even):not(:last-of-type)::after {
    inset-inline-start: calc(21px - 16.28%);
    inset-inline-end: 55%;
    border-inline-start: 2px dashed rgba(239, 211, 151, 0.55);
    border-inline-end: 0;
    border-start-end-radius: 0;
    border-start-start-radius: 24px;
  }

  .route-node-flip {
    width: auto;
    height: auto;
  }

  .route-node-flip .node-dot {
    width: 46px;
    height: 46px;
  }

  .route-node-flip .node-label {
    position: static;
    transform: none;
    text-align: start;
  }

  .route-node:nth-of-type(even).route-node-flip .node-label {
    text-align: end;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .header-progress {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    padding-top: 26px;
  }

  .hero-visual {
    min-height: 560px;
  }

  .section-heading,
  .story-purpose {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .episode-heading {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .track-controls {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .scene-track {
    grid-auto-columns: minmax(390px, 76%);
  }

  .treasure-object-key {
    grid-template-columns: 1fr;
  }

  .treasure-step {
    grid-template-columns: 70px 220px minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  html {
    scroll-padding-top: 64px;
  }

  .page-shell {
    width: min(100% - 24px, 1240px);
  }

  .site-header {
    min-height: 56px;
    padding: 8px 10px;
    gap: 12px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  /* One row on phones: the Poli 21 logo anchors the corner, so the TI
     monogram would say the same thing twice at a width that has no room
     to say anything twice. */
  .brand-mark {
    display: none;
  }

  .brand small {
    display: none;
  }

  .brand strong {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-link {
    font-size: 0.7rem;
  }

  .language-link {
    font-size: 0.8rem;
  }

  .header-link {
    max-width: 74px;
    text-align: right;
  }

  .header-nav {
    gap: 8px;
  }

  .header-nav a,
  .header-nav .header-treasure-button {
    font-size: 0.72rem;
  }

  .language-link {
    font-size: 0.78rem;
  }

  .hero {
    gap: 44px;
    padding-block: 52px 70px;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 18vw, 5rem);
    line-height: 0.86;
  }

  .hero-lead {
    font-size: 1.08rem;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions-break {
    display: none;
  }

  .hero-quiet-link {
    text-align: center;
  }

  .button {
    width: 100%;
  }

  .story-stats {
    gap: 20px;
  }

  .story-stats dt {
    font-size: 1.2rem;
  }

  .hero-visual {
    min-height: 470px;
    border-radius: 150px 150px 12px 12px;
  }

  .journey {
    padding-block: 72px 56px;
  }

  .story-purpose {
    padding: 28px 14px;
  }

  .purpose-treasure-link {
    max-width: none;
    margin-top: 10px;
  }

  .episode {
    padding-block: 72px;
  }

  .episode::before {
    width: 3px;
  }

  .episode-heading {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 16px;
  }

  .episode-number {
    padding-right: 12px;
  }

  .episode-number strong {
    font-size: 2.7rem;
  }

  .episode-heading h2 {
    font-size: clamp(2.45rem, 13vw, 3.8rem);
  }

  .episode-heading > div:nth-child(2) > p:last-child {
    font-size: 0.9rem;
  }

  .track-controls {
    justify-content: space-between;
  }

  .scene-track {
    grid-auto-columns: 90%;
    gap: 12px;
    margin-right: -12px;
    padding-right: 12px;
  }

  .scene-card {
    border-radius: 11px;
  }

  .scene-copy {
    min-height: 310px;
    padding: 24px 22px 28px;
  }

  .scene-copy p {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .episode-next {
    margin-top: 12px;
  }

  .treasure-sheet {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }

  .treasure-header {
    gap: 12px;
    padding-bottom: 26px;
  }

  .treasure-header h2 {
    font-size: clamp(2.7rem, 14vw, 4rem);
  }

  .treasure-header > div > p:last-child {
    margin-top: 20px;
    font-size: 0.94rem;
  }

  .treasure-close {
    top: 12px;
    width: 44px;
    height: 44px;
  }

  .treasure-object-key {
    margin: 24px 0 42px;
  }

  .treasure-object-key article {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 14px 16px;
  }

  .treasure-object-key .object-photo {
    aspect-ratio: 1;
    border-bottom: 0;
    border-radius: 9px;
  }

  .treasure-object-key article > div {
    padding: 0;
  }

  .treasure-chain {
    gap: 14px;
  }

  .treasure-chain::before {
    left: 24px;
  }

  .treasure-step {
    min-height: auto;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 13px;
    padding: 14px 16px 22px 0;
  }

  .step-number {
    width: 34px;
    height: 34px;
    font-size: 0.7rem;
    box-shadow: 0 0 0 5px var(--paper-light);
  }

  .step-photo {
    grid-column: 2;
    width: 100%;
  }

  .treasure-step > div:last-child {
    grid-column: 2;
  }

  .treasure-step h3 {
    font-size: 1.55rem;
  }

  .treasure-step > div:last-child > p:last-child {
    font-size: 0.91rem;
  }

  .treasure-answer {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 26px 22px;
  }

  .treasure-answer > span {
    width: 52px;
    height: 52px;
    font-size: 1rem;
  }

  .treasure-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .treasure-footer p {
    line-height: 1.7;
  }

  .footer-inner {
    align-items: start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
