:root {
  color-scheme: light;
  --parch: #ead9ad;
  --paper: #f5e9c9;
  --ink: #3b2a17;
  --ink-soft: #6a5035;
  --red: #a63a22;
  --red-dark: #6e2212;
  --red-text: #94301a;
  --gold: #c4932d;
  --sea: #5f8f92;
  --sand: #dfc487;
  --font-display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --font-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--ink);
  font: 1.125rem/1.6 var(--font-body);
  background-color: var(--parch);
  background-image:
    radial-gradient(60rem 42rem at 12% 6%, rgba(255, 247, 218, .6), transparent 62%),
    radial-gradient(52rem 38rem at 92% 38%, rgba(150, 100, 40, .2), transparent 66%),
    radial-gradient(44rem 32rem at 6% 72%, rgba(150, 100, 40, .17), transparent 66%),
    radial-gradient(50rem 36rem at 88% 96%, rgba(120, 70, 25, .22), transparent 66%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .08 0 0 0 .6 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  -webkit-font-smoothing: antialiased;
}

/* worn edges of the sheet, fixed to the viewport */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: radial-gradient(ellipse 125% 115% at 50% 50%, transparent 56%, rgba(92, 52, 16, .26) 80%, rgba(92, 52, 16, .5) 100%);
}

h1, h2, .island-tag, .scroll-hint { font-family: var(--font-display); font-weight: 400; }
h1 { margin: 0; font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1; letter-spacing: .01em; }
h2 { margin: 0 0 .25rem; font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15; }
p { margin: 0 0 1rem; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--paper); padding: .5rem 1rem; border: 2px solid var(--ink); }
.skip:focus { top: 1rem; }


.wrap { max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- map & route ---------- */
#map { position: relative; }
#route { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; overflow: visible; }
#route-base, #route-done { fill: none; stroke-linecap: round; stroke-dasharray: 1 11; }
#route-base { stroke: var(--ink); stroke-opacity: .38; stroke-width: 3; }
#route-done { stroke: var(--red); stroke-width: 3.6; }
#waves use { fill: none; stroke: var(--ink); stroke-opacity: .2; stroke-width: 1.4; stroke-linecap: round; }

#ship { position: absolute; left: 0; top: 0; z-index: 3; width: 64px; height: 64px; margin: -52px 0 0 -32px; pointer-events: none; will-change: transform; }
.ship-tilt { transform: rotate(var(--tilt, 0deg)); transition: transform .35s ease-out; }
.ship-flip { transform: scaleX(var(--face, 1)); transition: transform .35s ease-out; }
#ship svg { display: block; overflow: visible; filter: drop-shadow(0 4px 3px rgba(60, 35, 10, .35)); }
.wake { fill: none; stroke: var(--sea); stroke-width: 2.4; stroke-linecap: round; }
.ship-body { transform-origin: 50% 90%; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(2px) rotate(-2.5deg); } }

/* ---------- stops ---------- */
.stop {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(2rem, 7vw, 7rem);
  align-items: center;
  padding-block: clamp(5rem, 13vh, 8rem);
}
.side-l .island { grid-column: 1; grid-row: 1; }
.side-l .note { grid-column: 2; grid-row: 1; }
.side-r .island { grid-column: 2; grid-row: 1; }
.side-r .note, .side-r .hero-copy { grid-column: 1; grid-row: 1; }

.island {
  position: relative; justify-self: center;
  width: min(100%, 300px); aspect-ratio: 6 / 5;
  display: block; text-decoration: none;
}
.island svg { display: block; width: 100%; height: 100%; overflow: visible; transition: filter .9s ease; }
.island-tag {
  position: absolute; left: 50%; top: calc(100% - .3rem); transform: translateX(-50%);
  white-space: nowrap; font-size: 1.25rem; font-style: italic; line-height: 1.3; color: var(--ink);
  paint-order: stroke fill; -webkit-text-stroke: 5px var(--parch);
}

.js .island svg { filter: saturate(.25) sepia(.25); }
.js .reached .island svg { filter: none; }

/* ---------- hero ---------- */
.hero { min-height: min(92vh, 860px); padding-top: clamp(6rem, 14vh, 9rem); }
.lede { margin: 1rem 0 1rem; font-size: clamp(1.3rem, 2.4vw, 1.65rem); line-height: 1.35; font-weight: 500; }
.hero-copy { max-width: 32rem; }
.scroll-hint { margin-top: 2rem; font-size: 1.2rem; font-style: italic; color: var(--ink-soft); }
.scroll-hint .ico { vertical-align: -2px; color: var(--red); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }
.compass { position: absolute; left: -1.5rem; bottom: .5rem; width: 150px; opacity: .8; pointer-events: none; }

/* ---------- note cards ---------- */
.note {
  position: relative;
  padding: clamp(1.4rem, 2.6vw, 2.1rem);
  background: linear-gradient(180deg, #f7edd0, #f1e3bd);
  border: 1px solid rgba(59, 42, 23, .38);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 8px 10px -8px rgba(70, 40, 10, .5), 0 2px 5px rgba(70, 40, 10, .25);
}
.note::before {
  content: ""; position: absolute; top: -9px; left: 50%; width: 17px; height: 17px; margin-left: -8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #dc6a4e, var(--red) 58%, var(--red-dark));
  box-shadow: 0 3px 4px rgba(40, 20, 5, .4);
}
.side-l .note { rotate: .4deg; }
.side-r .note { rotate: -.4deg; }
.note .role { margin: 0 0 1rem; font-weight: 700; color: var(--red-text); }
.role .when { margin-left: .35rem; font-weight: 500; color: var(--ink-soft); }
.role .when::before { content: "\00b7"; margin-right: .5rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.chips li { padding: .1rem .7rem; font-size: 1rem; font-weight: 500; border: 1px solid rgba(59, 42, 23, .45); border-radius: 999px; background: rgba(59, 42, 23, .05); }
.feature-list { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.feature-list li { position: relative; margin-bottom: .4rem; padding-left: 1.5rem; }
.feature-list li::before {
  content: ""; position: absolute; left: .1rem; top: .5em; width: .8em; height: .8em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0l1.2 3.8L10 5 6.2 6.2 5 10 3.8 6.2 0 5l3.8-1.2z' fill='%23a63a22'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- galleries ---------- */
.gallery { margin-top: 1.25rem; }
.shot { margin: 0 0 1.25rem; }
.shot:last-child { margin-bottom: 0; }
.frame {
  display: block; width: 100%; margin: 0; padding: 6px; text-align: center;
  background: rgba(59, 42, 23, .09); border: 1px solid rgba(59, 42, 23, .45); border-radius: 4px;
}
button.frame { cursor: zoom-in; font: inherit; color: inherit; }
button.frame:hover { background: rgba(59, 42, 23, .15); }
.frame img, .frame video { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 2px; }
.frame-video video { width: 100%; background: #1c1a17; }
figcaption { margin-top: .5rem; font-size: .95rem; font-style: italic; color: var(--ink-soft); }

.gallery.is-ready .shot[hidden] { display: none; }
.gallery.is-ready .shot { margin-bottom: 0; }
.thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .85rem; }
.thumbs-count { margin-left: .35rem; font-size: .95rem; font-style: italic; color: var(--ink-soft); }
.thumb {
  width: 80px; height: 50px; padding: 0; overflow: hidden; cursor: pointer;
  background: rgba(59, 42, 23, .15); border: 2px solid transparent; border-radius: 4px; opacity: .7;
  transition: opacity .2s, border-color .2s;
}
.thumb:hover { opacity: 1; }
.thumb[aria-pressed="true"] { opacity: 1; border-color: var(--red); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.vault-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-top: 1.25rem; }
.vault-slot {
  display: grid; place-items: center; min-height: 110px; padding: .75rem; text-align: center;
  font-size: .95rem; font-style: italic; color: var(--ink-soft);
  border: 2px dashed rgba(59, 42, 23, .4); border-radius: 4px;
}

/* ---------- contact ---------- */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.btn {
  display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.15rem;
  font: 700 1.05rem/1.3 var(--font-body); color: var(--ink); text-decoration: none; cursor: pointer;
  background: transparent; border: 2px solid var(--ink); border-radius: 6px;
  transition: transform .15s, box-shadow .15s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(59, 42, 23, .3); }
.btn:active { transform: none; box-shadow: none; }
.btn-primary { color: #fff6e0; background: var(--red); border-color: var(--red-dark); }
.copy-label { padding: .05rem .55rem; font-size: .85rem; font-weight: 500; border: 1px solid currentColor; border-radius: 999px; }
.ico { flex: none; }
.copy-status { min-height: 1.6em; margin: .75rem 0 0; font-style: italic; color: var(--ink-soft); }

.foot { padding-block: 3rem 4rem; text-align: center; font-size: .9rem; color: var(--ink-soft); }
.foot p { margin: 0; }
.foot .provided { margin-bottom: .5rem; font-size: 1.05rem; color: var(--ink); }
.foot .provided a { font-weight: 700; text-underline-offset: .2em; }
.foot .provided a:hover { color: var(--red-text); }

/* ---------- lightbox ---------- */
dialog { max-width: min(96vw, 1200px); max-height: 94vh; padding: 0; overflow: visible; background: transparent; border: 0; color: #fff6e0; }
dialog::backdrop { background: rgba(30, 18, 6, .82); }
dialog img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; background: var(--paper); border: 6px solid var(--paper); border-radius: 4px; }
.lb-caption { margin: .75rem 0 0; text-align: center; font-style: italic; }
.lb-close { position: absolute; top: -2.6rem; right: 0; width: 2.2rem; height: 2.2rem; font-size: 1.6rem; line-height: 1; color: #fff6e0; cursor: pointer; background: var(--red); border: 2px solid #fff6e0; border-radius: 50%; }

/* ---------- reveal ---------- */
.js .note, .js .hero-copy { opacity: 0; translate: 0 26px; transition: opacity .7s ease, translate .7s ease; }
.js .island { opacity: 0; scale: .85; transition: opacity .7s ease, scale .7s cubic-bezier(.3, 1.4, .5, 1); }
.js .in .note, .js .in .hero-copy { opacity: 1; translate: 0 0; }
.js .in .island { opacity: 1; scale: 1; }

@media (prefers-reduced-motion: reduce) {
  .ship-body, .scroll-hint .ico { animation: none; }
  .js .note, .js .hero-copy, .js .island { opacity: 1; translate: 0 0; scale: 1; transition: none; }
  .ship-tilt, .ship-flip { transition: none; }
}

/* ---------- phones: route runs down the left edge ---------- */
@media (max-width: 720px) {
  body { font-size: 1.06rem; }
  .wrap { padding-inline: 12px; }

  .stop { grid-template-columns: 80px minmax(0, 1fr); column-gap: 8px; align-items: start; padding-block: 3.25rem; }
  .side-l .island, .side-r .island { grid-column: 1; grid-row: 1; width: 80px; margin-top: 1.1rem; }
  .side-l .note, .side-r .note, .side-r .hero-copy { grid-column: 2; grid-row: 1; rotate: 0deg; }

  .island-tag { top: calc(100% + .1rem); width: 84px; font-size: .85rem; line-height: 1.3; white-space: normal; text-align: center; -webkit-text-stroke-width: 4px; }
  .note { padding: 1.1rem 1rem 1.2rem; }
  .note::before { left: 28px; }

  .hero { min-height: 0; padding-top: 5rem; }
  .hero .island { margin-top: .4rem; }
  .compass { display: none; }
  .scroll-hint { margin-top: 1.5rem; }
  .thumb { width: 72px; height: 48px; }
  .role .when { display: block; margin: 0; }
  .role .when::before { content: none; }
  .actions .btn { width: 100%; justify-content: center; }
}

/* ---------- video pause control ---------- */
.frame-video { position: relative; }
.vid-toggle {
  position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  color: #fff6e0; cursor: pointer; background: rgba(28, 20, 10, .72); border: 1.5px solid rgba(255, 246, 224, .8); border-radius: 50%;
}
.vid-toggle:hover { background: var(--red); }
.vid-toggle svg { display: block; }
.vid-toggle .i-play { display: none; }
.vid-toggle[aria-pressed="true"] .i-play { display: block; }
.vid-toggle[aria-pressed="true"] .i-pause { display: none; }

/* ---------- jump nav ---------- */
.stops-nav {
  position: fixed; z-index: 60; top: 12px; left: 50%; translate: -50% 0;
  max-width: calc(100vw - 24px);
  background: rgba(245, 233, 201, .94); border: 1.5px solid var(--ink); border-radius: 999px;
  transition: translate .35s cubic-bezier(.2, .8, .2, 1);
}
.stops-nav.away:not(:focus-within) { translate: -50% -140%; }
.stops-nav ul { display: flex; gap: .15rem; margin: 0; padding: 3px; list-style: none; }
.stops-nav a {
  display: flex; align-items: center; min-height: 40px; padding: 0 .95rem;
  font: 500 1rem/1.3 var(--font-body); color: var(--ink); text-decoration: none; white-space: nowrap; border-radius: 999px;
  transition: background .2s, color .2s;
}
.stops-nav a:hover { background: rgba(59, 42, 23, .12); }
.stops-nav a[aria-current="true"] { background: rgba(166, 58, 34, .16); font-weight: 700; }
.stops-nav a.nav-contact { color: #fff6e0; background: var(--red); font-weight: 700; }
.stops-nav a.nav-contact:hover { background: var(--red-dark); }
@media (prefers-reduced-motion: reduce) { .stops-nav { transition: none; } }

@media (max-width: 720px) {
  .stops-nav { top: auto; bottom: 10px; max-width: calc(100vw - 20px); padding-bottom: env(safe-area-inset-bottom); }
  .stops-nav.away:not(:focus-within) { translate: -50% 0; }
  .stops-nav ul { overflow-x: auto; scrollbar-width: none; }
  .stops-nav ul::-webkit-scrollbar { display: none; }
  .stops-nav a { min-height: 44px; padding: 0 .75rem; font-size: .95rem; }
  .stops-nav .x { display: none; }
  body { padding-bottom: 72px; }
  #ship { width: 44px; height: 44px; margin: -36px 0 0 -22px; }
  #ship svg { width: 44px; height: 44px; }
}
