/* ==========================================================================
   Seaside Games — shared stylesheet
   Palette is sampled from the terrain map plates: near-black brown ground,
   ember-orange roads, cream lettering.
   ========================================================================== */

:root {
  --ink:        #0f0b09;
  --ink-deep:   #080605;
  --surface:    #191211;
  --surface-2:  #221816;
  --surface-3:  #2c1f1b;

  --text:       #f1e7d9;
  --muted:      #b39d86;
  --muted-dim:  #8a7663;

  --ember:      #e2622a;
  --ember-hot:  #ff8347;
  --ember-deep: #9c3d13;
  --cream:      #f2dcae;
  --sea:        #12a0c8;

  --line:       rgba(242, 220, 174, 0.13);
  --line-soft:  rgba(242, 220, 174, 0.07);
  --line-strong:rgba(242, 220, 174, 0.26);

  --radius:     14px;
  --radius-lg:  20px;
  --shadow:     0 18px 50px -18px rgba(0, 0, 0, 0.85);
  --shadow-lift:0 28px 70px -20px rgba(0, 0, 0, 0.95);

  --wrap:       1160px;
  --wrap-narrow: 720px;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(0.4, 0.01, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* a warm glow behind everything, so flat dark areas are not dead flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(226, 98, 42, 0.16), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(156, 61, 19, 0.13), transparent 60%);
  pointer-events: none;
}

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

a { color: var(--cream); text-decoration: none; }
a:hover { color: var(--ember-hot); }

:focus-visible {
  outline: 2px solid var(--ember-hot);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 600; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding: 84px 0; }
.section + .section { padding-top: 0; }
.section-head { margin-bottom: 40px; }
.section-head p { color: var(--muted); max-width: 62ch; margin: 10px 0 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ember);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* --- eyebrow / plate lettering ------------------------------------------ */

.eyebrow {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 700;
  margin: 0 0 14px;
}
.eyebrow--cream { color: var(--cream); }

/* mirrors the map plates: wide-tracked caps over a hairline rule */
.plate {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 400;
  color: var(--cream);
}
.plate::after {
  content: "";
  display: block;
  width: min(320px, 60%);
  height: 1px;
  margin: 18px auto 0;
  background: var(--line-strong);
}

/* --- header / nav ------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(15, 11, 9, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 74px;
  padding: 10px 24px;
  max-width: var(--wrap);
  margin: 0 auto;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
}
.brand:hover { color: var(--text); }
.brand img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line);
}
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name b { font-size: 1.02rem; letter-spacing: 0.02em; }
.brand-name span {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted-dim);
  font-weight: 600;
}
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  position: relative;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: rgba(242, 220, 174, 0.07); }
.nav-links a[aria-current="page"] {
  color: var(--cream);
  background: rgba(226, 98, 42, 0.15);
  box-shadow: inset 0 0 0 1px rgba(226, 98, 42, 0.35);
}

/* --- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
              background 0.18s var(--ease), color 0.18s var(--ease);
}
.btn-primary {
  background: linear-gradient(135deg, var(--ember-hot), var(--ember-deep));
  color: #fff;
  box-shadow: 0 12px 30px -12px rgba(226, 98, 42, 0.9);
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(226, 98, 42, 1); }
.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: rgba(242, 220, 174, 0.08); color: var(--cream); transform: translateY(-2px); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* --- home hero --------------------------------------------------------- */

.hero { position: relative; padding: 96px 0 76px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--cream), var(--ember-hot) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 32px;
}
.hero-logo {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow-lift), 0 0 0 1px var(--line);
  transform: rotate(-2deg);
}
.hero-logo img { width: 100%; }

/* --- cards ------------------------------------------------------------- */

.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease),
              box-shadow 0.22s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 98, 42, 0.4);
  box-shadow: var(--shadow-lift);
}
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { font-size: 1.16rem; margin: 0; letter-spacing: -0.01em; }
.card-body p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-dim);
  font-weight: 600;
}
.card-foot { margin-top: auto; padding-top: 6px; }

.tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(226, 98, 42, 0.14);
  color: var(--cream);
  border: 1px solid rgba(226, 98, 42, 0.28);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

/* --- video thumbnail / facade player ----------------------------------- */

/* A "facade": we show a poster and only load the YouTube/Vimeo iframe on click,
   so the page stays fast and no third-party cookies are set until you press play. */
.vthumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  background: var(--surface-3);
  cursor: pointer;
  overflow: hidden;
}
.vthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), opacity 0.3s var(--ease);
}
.card:hover .vthumb img { transform: scale(1.045); }
.vthumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(8, 6, 5, 0.65));
  pointer-events: none;
}
.vthumb-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 11, 9, 0.6);
  border: 1.5px solid rgba(242, 220, 174, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease), border-color 0.22s var(--ease);
}
.vthumb-play svg { width: 22px; height: 22px; fill: var(--cream); margin-left: 3px; }
.vthumb:hover .vthumb-play,
.card:hover .vthumb-play {
  background: var(--ember);
  border-color: var(--ember-hot);
  transform: translate(-50%, -50%) scale(1.09);
}
.vthumb:hover .vthumb-play svg, .card:hover .vthumb-play svg { fill: #fff; }
.vthumb-dur {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(8, 6, 5, 0.8);
  color: var(--text);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* placeholder poster used until a real video id is filled in */
.vthumb--empty {
  background:
    radial-gradient(600px 200px at 30% 0%, rgba(226, 98, 42, 0.3), transparent 70%),
    linear-gradient(150deg, var(--surface-3), var(--ink-deep));
  cursor: default;
}
.vthumb--empty .vthumb-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 22px;
  color: var(--muted);
  font-size: 0.85rem;
}
.vthumb--empty .vthumb-hint strong {
  display: block;
  color: var(--cream);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.vthumb--empty .vthumb-hint code {
  color: var(--ember-hot);
  font-size: 0.8rem;
  word-break: break-all;
}
.card--placeholder { border-style: dashed; border-color: var(--line); }

/* inline embed (used inside a trip post) */
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}
.embed iframe, .embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
figure.video-figure { margin: 38px 0; }
figure.video-figure figcaption {
  margin-top: 12px;
  color: var(--muted-dim);
  font-size: 0.88rem;
  text-align: center;
}

/* --- filter bar -------------------------------------------------------- */

.filters {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}
.filter {
  padding: 8px 17px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--line-strong); }
.filter[aria-pressed="true"] {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff;
}

.empty-note {
  padding: 46px 30px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(34, 24, 22, 0.5);
}
.empty-note code { color: var(--ember-hot); }

/* --- lightbox ---------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  padding: 4vmin;
  background: rgba(6, 4, 4, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox[open], .lightbox.is-open { display: grid; }

/* The stage sets the player width explicitly. It has to: the lightbox centres its
   grid item, so the item shrinks to fit its contents — and a percentage width on
   the player would then resolve against the width of the caption text under it.
   The third term keeps the 16:9 box inside a short window without needing a
   max-height, which would otherwise fight the aspect-ratio and letterbox it. */
.lightbox-stage {
  width: min(1180px, 100%, calc((100vh - 8vmin - 70px) * 16 / 9));
}
.lightbox-inner {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lift);
  position: relative;
}
.lightbox-inner iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox-title {
  margin: 16px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 70ch;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 130;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(25, 18, 17, 0.85);
  border: 1px solid var(--line-strong);
  color: var(--cream);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: var(--ember); color: #fff; border-color: var(--ember-hot); }

/* --- map plate (trip hero + cards) ------------------------------------- */

.map-plate {
  position: relative;
  width: 100%;
  aspect-ratio: 2.4 / 1;
  overflow: hidden;
  background: var(--ink-deep);
}
.map-plate img { width: 100%; height: 100%; object-fit: cover; }

.trip-hero {
  position: relative;
  margin-bottom: 54px;
  border-bottom: 1px solid var(--line-soft);
}
.trip-hero .map-plate {
  aspect-ratio: 2.4 / 1;
  max-height: 62vh;
}
/* fade the plate into the page so it does not end on a hard edge */
.trip-hero .map-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 11, 9, 0.5) 0%, transparent 26%, transparent 62%, var(--ink) 100%);
  pointer-events: none;
}
.trip-hero-meta {
  position: relative;
  margin-top: -34px;
  text-align: center;
  padding: 0 24px 8px;
  z-index: 2;
}
.trip-hero-meta h1 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.coords {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--muted-dim);
  letter-spacing: 0.06em;
}
/* only spaced off from the coordinates once you have actually typed dates in */
.trip-dates:not(:empty)::before { content: " · "; color: var(--ember); }

.stop-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(226, 98, 42, 0.16);
  border: 1px solid rgba(226, 98, 42, 0.38);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* --- article prose ----------------------------------------------------- */

.prose { font-size: 1.06rem; }
.prose > * + * { margin-top: 1.35em; }
.prose h2 {
  margin-top: 2.4em;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--line-soft);
}
.prose h3 { margin-top: 2em; font-size: 1.18rem; color: var(--cream); }
.prose p { color: #ded2c2; }
.prose a { text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; color: #ded2c2; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--ember); }
.prose blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 26px;
  border-left: 2px solid var(--ember);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.16rem;
  font-style: italic;
}
.prose blockquote p { color: inherit; }
.prose img { border-radius: var(--radius); box-shadow: var(--shadow); }
.prose figure { margin: 2em 0; }
.prose figcaption { margin-top: 10px; color: var(--muted-dim); font-size: 0.88rem; text-align: center; }
.prose hr { border: 0; border-top: 1px solid var(--line-soft); margin: 2.6em 0; }
.prose code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  color: var(--cream);
}

/* --- a day's journal entry ----------------------------------------------
   Set the way the written-up days are: a big day title, the date under it,
   heavy section headings, and paragraphs packed close together so a day
   reads as one run of thought rather than a list of separate notes.

   To write up another day, copy this shape into the article:

     <section class="journal">
       <h3 class="journal-title">Day 3 — a day in Turin</h3>
       <p class="journal-date">Friday 21 August</p>
       <p>The first paragraph.</p>
       <h4 class="journal-head">A section heading</h4>
       <p>More of the day. <em>Italics</em> and <strong>bold</strong> both
          pick up the cream lettering.</p>
     </section>
   ---------------------------------------------------------------------- */

.prose .journal { margin-top: 2.6em; }
/* zero the browsers' own paragraph margins first, so the rule below is the
   only thing setting the rhythm — otherwise they collapse into it and the
   day reads looser than it should */
.journal > * { margin-bottom: 0; }
.journal > * + * { margin-top: 0.78em; }        /* the close-set look of the page */

.prose .journal-title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: 0;
  font-size: 1.9rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}
.prose .journal-date {
  margin-top: 0.55em;
  color: var(--cream);
  font-size: 0.95rem;
  font-weight: 700;
}
.prose .journal-head {
  margin: 1.7em 0 0;
  padding-bottom: 0;
  border-bottom: 0;
  font-size: 1.3rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--text);
}
.journal em { color: var(--cream); }
.journal strong { color: var(--cream); font-weight: 700; }

/* the closing line of a day, pointing at the next one */
.prose .journal-next {
  margin-top: 1.5em;
  padding-top: 1.1em;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}

@media (max-width: 640px) {
  .prose .journal-title { font-size: 1.6rem; }
  .prose .journal-head { font-size: 1.16rem; }
}

/* --- the extra furniture some days carry ---------------------------------
   A day that opens with an itinerary, sets a line apart, or signs off with
   the weather uses these. All three are optional — a day made only of
   headings and paragraphs (as day one is) needs none of them.

     <div class="journal-moves">
       <p class="eyebrow">The day, in four moves</p>
       <ul>
         <li>
           <span class="move-when">12:44</span>
           <span><b class="move-where">Chambery</b>
                 <span class="move-note">a morning off, then out</span></span>
         </li>
       </ul>
     </div>

     <blockquote><p>A line worth setting apart.</p></blockquote>
     <p class="journal-conditions">Conditions — what the weather did.</p>
   ---------------------------------------------------------------------- */

.prose .journal-moves {
  margin-top: 1.7em;
  padding: 20px 22px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}
.journal-moves .eyebrow { margin-bottom: 2px; }
.prose .journal-moves ul { margin: 0; padding: 0; list-style: none; }
.prose .journal-moves li {
  display: grid;
  grid-template-columns: 5em 1fr;
  gap: 3px 18px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.prose .journal-moves li:first-child { border-top: 0; }
.move-when {
  padding-top: 0.2em;
  color: var(--ember);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.move-where {
  display: block;
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.move-note { display: block; color: var(--muted); font-size: 0.93rem; }

/* the sign-off: what the weather did, ruled off above and below */
.prose .journal-conditions {
  margin-top: 1.9em;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.93rem;
}
/* ...and when tomorrow's line follows it, one rule between them is plenty */
.prose .journal-conditions + .journal-next { margin-top: 1.5em; padding-top: 0; border-top: 0; }

@media (max-width: 520px) {
  .prose .journal-moves { padding: 18px 16px 6px; }
  .prose .journal-moves li { grid-template-columns: 1fr; gap: 1px; }
  .move-when { padding-top: 0; }
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 2em 0;
}
.gallery-strip img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* --- prev / next -------------------------------------------------------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 72px;
  padding-top: 34px;
  border-top: 1px solid var(--line-soft);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.pager a:hover { border-color: rgba(226, 98, 42, 0.45); transform: translateY(-3px); }
.pager .dir {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 700;
}
.pager .where { color: var(--text); font-weight: 650; font-size: 1.05rem; }
.pager .next { text-align: right; }
.pager .placeholder { opacity: 0.35; pointer-events: none; }

/* --- route list (italy index) ------------------------------------------ */

.route {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.route > li { position: relative; }
.stop {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.stop:hover { transform: translateY(-4px); border-color: rgba(226, 98, 42, 0.4); box-shadow: var(--shadow-lift); }
.stop .map-plate { height: 100%; aspect-ratio: auto; min-height: 176px; }
.stop-body { padding: 26px 30px; display: flex; flex-direction: column; gap: 12px; }
.stop-body h3 { font-size: 1.35rem; margin: 0; }
.stop-body h3 a { color: var(--text); }
.stop-body h3 a:hover { color: var(--ember-hot); }
.stop-body p { margin: 0; color: var(--muted); }

/* marks the turn for home in the middle of the route list */
.route-note {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 34px 0 4px;
  color: var(--cream);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 700;
}
.route-note::before, .route-note::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

/* a side trip hanging off a stop (Pompei off Naples) */
.excursion {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 14px 0 0 34px;
  padding: 14px 20px 14px 14px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ember);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.excursion:hover { transform: translateX(3px); border-color: rgba(226, 98, 42, 0.45); }
.excursion img {
  width: 108px;
  flex: 0 0 auto;
  border-radius: 8px;
  aspect-ratio: 2.4 / 1;
  object-fit: cover;
}
.excursion-text { display: flex; flex-direction: column; gap: 3px; }
.excursion .dir {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 700;
}
.excursion .where { color: var(--text); font-weight: 650; font-size: 1.05rem; }
.excursion p { margin: 0; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 620px) {
  .excursion { margin-left: 0; flex-wrap: wrap; }
  .excursion img { width: 100%; }
}

/* --- journey (home page scroll-drawn route) ----------------------------- */

.journey-track { position: relative; padding: 20px 0 6px; }

.journey-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
/* the faint dotted "planned route" underneath */
.journey-path-base {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 2 10;
}
/* the ember line that journey.js rolls out over it */
.journey-path-draw {
  fill: none;
  stroke: url(#journey-grad);
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 7px rgba(255, 131, 71, 0.45));
  transition: stroke-dashoffset 0.15s linear;
}

/* the glowing tip that rides the end of the line */
.journey-marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd9a8, var(--ember-hot) 55%, var(--ember-deep));
  box-shadow: 0 0 0 4px rgba(255, 131, 71, 0.18), 0 0 20px 5px rgba(255, 131, 71, 0.5);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  transition: transform 0.15s linear, opacity 0.3s var(--ease);
}

.journey-stops {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 84px;
}

/* card | line lane | card — the lane's width is the snake's amplitude */
.journey-stop {
  display: grid;
  grid-template-columns: 1fr 150px 1fr;
  align-items: center;
}

.journey-dot {
  grid-row: 1;
  grid-column: 2;
  justify-self: start;                 /* hugs its card across the lane */
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--line-strong);
  box-shadow: 0 0 0 6px var(--ink);    /* halo so the line dips behind it */
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
}
.journey-stop[data-side="right"] .journey-dot { justify-self: end; }
.journey-stop.is-active .journey-dot {
  background: var(--ember-hot);
  border-color: var(--cream);
  box-shadow: 0 0 0 6px var(--ink), 0 0 18px 3px rgba(255, 131, 71, 0.55);
}

.journey-card {
  grid-row: 1;
  grid-column: 1;
  justify-self: end;
  width: min(100%, 400px);
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
              border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.journey-stop[data-side="right"] .journey-card {
  grid-column: 3;
  justify-self: start;
}
.journey-card:hover {
  border-color: rgba(226, 98, 42, 0.4);
  box-shadow: var(--shadow-lift);
}
.journey-card img {
  width: 100%;
  aspect-ratio: 2.4 / 1;
  object-fit: cover;
}
.journey-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px 20px;
}
.journey-city {
  color: var(--text);
  font-weight: 650;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.journey-card:hover .journey-city { color: var(--ember-hot); }
.journey-blurb { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

/* a side trip hanging off a stop (Pompei off Naples) */
.journey-side {
  grid-row: 2;
  grid-column: 1;
  justify-self: end;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 18px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ember);
  border-radius: var(--radius);
  background: var(--surface);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
              border-color 0.2s var(--ease);
}
.journey-stop[data-side="right"] .journey-side { grid-column: 3; justify-self: start; }
.journey-side:hover { border-color: rgba(226, 98, 42, 0.45); }
.journey-side .dir {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 700;
}
.journey-side .where { color: var(--text); font-weight: 650; }

/* the turn for home, floating on the line */
.journey-note {
  display: flex;
  justify-content: center;
  margin: -20px 0;
}
.journey-note span {
  position: relative;
  z-index: 2;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--cream);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 700;
}

/* cards wait, unlit, until the line reaches their stop (JS adds .is-ready;
   without it — no JS — everything above stays visible as a plain list) */
.is-ready .journey-card,
.is-ready .journey-side {
  opacity: 0;
  transform: translateY(26px);
}
.is-ready .journey-stop.is-active .journey-card,
.is-ready .journey-stop.is-active .journey-side {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .is-ready .journey-card,
  .is-ready .journey-side { opacity: 1; transform: none; }
  .journey-marker { display: none; }
}

@media (max-width: 760px) {
  .journey-stops { gap: 56px; }
  .journey-stop { grid-template-columns: 38px 1fr; column-gap: 16px; }
  .journey-dot,
  .journey-stop[data-side="right"] .journey-dot {
    grid-column: 1;
    justify-self: center;
  }
  /* a gentle wiggle so the line still snakes a little */
  .journey-stop[data-side="left"] .journey-dot  { transform: translateX(-5px); }
  .journey-stop[data-side="right"] .journey-dot { transform: translateX(5px); }
  .journey-card,
  .journey-stop[data-side="right"] .journey-card,
  .journey-side,
  .journey-stop[data-side="right"] .journey-side {
    grid-column: 2;
    justify-self: start;
    width: 100%;
  }
  .journey-note { justify-content: flex-start; margin: -8px 0; }
}

/* --- footer ------------------------------------------------------------ */

.site-footer {
  margin-top: 96px;
  padding: 54px 0 40px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, transparent, rgba(8, 6, 5, 0.7));
  color: var(--muted-dim);
  font-size: 0.9rem;
}
.footer-grid {
  display: flex;
  gap: 30px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.footer-grid nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-grid nav a { color: var(--muted); font-weight: 600; }
.credit { max-width: 46ch; line-height: 1.6; }
.credit a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* --- responsive -------------------------------------------------------- */

@media (max-width: 900px) {
  .hero { padding: 60px 0 50px; }
  .hero-grid { grid-template-columns: 1fr; gap: 38px; }
  .hero-logo { max-width: 340px; transform: none; }
  .stop { grid-template-columns: 1fr; }
  .stop .map-plate { aspect-ratio: 2.4 / 1; min-height: 0; }
  .section { padding: 60px 0; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .nav { min-height: 64px; gap: 10px; padding: 10px 18px; }
  .brand img { width: 40px; height: 40px; }
  .nav-links { width: 100%; gap: 4px; }
  .nav-links a { padding: 8px 12px; font-size: 0.86rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .trip-hero .map-plate { aspect-ratio: 16 / 10; }
  .trip-hero-meta { margin-top: -18px; }
  .vthumb-play { width: 54px; height: 54px; }
  .section { padding: 48px 0; }
}

/* --- leg maps (legmaps.html — animated graphics for the videos) ---------- */

.route-cta { text-align: center; margin-top: 56px; }

.legmap-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  background: #0d0908;
}
.legmap-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* the three background modes — the flat rect behind everything in the SVG */
.lm-bg { fill: #0d0908; }
.legmap-frame[data-bg="black"] .lm-bg { fill: #000; }
.legmap-frame[data-bg="green"] .lm-bg { fill: #00b140; }
/* plate dressing (graticule, glows, vignette, compass, scale bar) only in plate mode */
.legmap-frame[data-bg="black"] .lm-plate-only,
.legmap-frame[data-bg="green"] .lm-plate-only { display: none; }

/* record view: the frame fills the screen, everything else falls away */
.legmap-frame:fullscreen { border: 0; border-radius: 0; background: #0d0908; cursor: none; }
.legmap-frame[data-bg="black"]:fullscreen { background: #000; }
.legmap-frame[data-bg="green"]:fullscreen { background: #00b140; }

/* stand-in for fullscreen while recording, for browsers that refuse or drop
   real fullscreen when their screen-share prompt opens (Firefox) */
.legmap-frame.is-fauxfull {
  position: fixed;
  inset: 0;
  z-index: 300;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #0d0908;
  cursor: none;
}
.legmap-frame.is-fauxfull[data-bg="black"] { background: #000; }
.legmap-frame.is-fauxfull[data-bg="green"] { background: #00b140; }

.lm-hint {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 11, 9, 0.85);
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.lm-hint b { color: var(--cream); }

/* --- the drawing itself -------------------------------------------------- */

.lm-grat-line { stroke: rgba(242, 220, 174, 0.06); stroke-width: 1; }
.lm-grat-label {
  font-family: var(--serif);
  font-size: 21px;
  fill: rgba(138, 118, 99, 0.75);
  letter-spacing: 0.06em;
}

.lm-base {
  fill: none;
  stroke: rgba(242, 220, 174, 0.26);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 3 13;
}
/* the stroke itself is set per-map in legmaps.js (each map carries its own
   gradient, so several can share a page) — no stroke here or it would win */
.lm-draw {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 9px rgba(255, 131, 71, 0.45));
}

.lm-tip-halo { fill: rgba(255, 131, 71, 0.2); }
.lm-tip { filter: drop-shadow(0 0 14px rgba(255, 131, 71, 0.65)); }

/* stations: a faint dot until the line arrives, then it lights and labels */
.lm-st .lm-dot {
  fill: var(--surface-3);
  stroke: rgba(242, 220, 174, 0.35);
  stroke-width: 2;
  transition: fill 0.35s var(--ease), stroke 0.35s var(--ease);
}
.lm-st.is-on .lm-dot { fill: var(--ember-hot); stroke: var(--cream); }
.lm-st.lm-pass.is-on .lm-dot { fill: var(--ember); stroke: rgba(242, 220, 174, 0.6); }

.lm-ring {
  fill: none;
  stroke: var(--cream);
  stroke-width: 1.5;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.lm-st.is-on .lm-ring { opacity: 0.55; }
/* the destination breathes once the journey is done */
.is-done .lm-dest .lm-ring { animation: lm-breathe 1.8s var(--ease) infinite; }
@keyframes lm-breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(1.35); }
}
.lm-dest .lm-ring, .lm-origin .lm-ring { transform-box: fill-box; transform-origin: center; }

.lm-ping {
  fill: none;
  stroke: var(--ember-hot);
  stroke-width: 2.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.lm-st.is-on .lm-ping { animation: lm-ping 0.85s var(--ease) forwards; }
.lm-static .lm-ping { animation: none !important; opacity: 0; }
@keyframes lm-ping {
  0% { transform: scale(0.35); opacity: 0.95; }
  100% { transform: scale(2.7); opacity: 0; }
}

/* a dark halo behind all lettering so it stays legible over anything */
.lm-label, .lm-mark, .lm-eyebrow, .lm-title, .lm-sub,
.lm-info-label, .lm-info-km {
  paint-order: stroke;
  stroke: rgba(8, 6, 5, 0.85);
  stroke-width: 6px;
  stroke-linejoin: round;
}

.lm-label {
  font-family: var(--sans);
  font-size: 29px;
  font-weight: 650;
  fill: var(--cream);
  opacity: 0;
  transition: opacity 0.45s var(--ease) 0.1s;
}
.lm-label--pass { font-size: 23px; font-weight: 500; fill: var(--muted); }
.lm-origin .lm-label, .lm-dest .lm-label { font-size: 34px; font-weight: 700; fill: var(--text); }
.lm-st.is-on .lm-label { opacity: 1; }

.lm-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 27px;
  fill: var(--cream);
}

.lm-eyebrow {
  font-family: var(--sans);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.3em;
  fill: var(--ember-hot);
}
.lm-title {
  font-family: var(--sans);
  font-size: 62px;
  font-weight: 700;
  letter-spacing: -0.01em;
  fill: var(--text);
}
.lm-sub { font-family: var(--serif); font-style: italic; font-size: 30px; fill: var(--muted); }

.lm-info-label {
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.28em;
  fill: var(--ember);
}
.lm-info-km {
  font-family: var(--serif);
  font-size: 42px;
  fill: var(--cream);
  font-variant-numeric: tabular-nums;
}

.lm-compass line, .lm-scale line { stroke: rgba(242, 220, 174, 0.4); stroke-width: 2; }
.lm-compass path { fill: rgba(242, 220, 174, 0.4); }
.lm-compass text, .lm-scale text {
  font-family: var(--serif);
  font-size: 24px;
  fill: var(--muted-dim);
  letter-spacing: 0.08em;
}

/* the title block glides in each time the animation starts */
.lm-anim .lm-titles, .lm-anim .lm-info {
  animation: lm-fadeup 0.9s var(--ease) both;
}
@keyframes lm-fadeup {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* --- page furniture ------------------------------------------------------ */

.lm-picker { border-bottom: 0; padding-bottom: 0; margin-bottom: 22px; }

.legmap-controls {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.legmap-controls .btn { padding: 10px 22px; }
.lm-group { display: flex; align-items: center; gap: 8px; }
.lm-group-label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-dim);
  font-weight: 700;
  margin-right: 4px;
}

/* small embedded players on the trip pages */
figure.legmap-figure { margin: 38px 0; }
.legmap-frame--embed { border-radius: var(--radius); }
.lm-replay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 11, 9, 0.65);
  border: 1px solid var(--line-strong);
  color: var(--cream);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s var(--ease), background 0.2s var(--ease);
}
.legmap-frame--embed:hover .lm-replay,
.legmap-frame--embed:focus-within .lm-replay,
.legmap-frame--embed .legmap-svg.is-done ~ .lm-replay { opacity: 1; }
.lm-replay:hover { background: var(--ember); color: #fff; border-color: var(--ember-hot); }

.lm-status {
  margin: 12px 0 0;
  min-height: 1.5em;
  color: var(--muted);
  font-size: 0.92rem;
}

.lm-help { margin-top: 40px; }
.lm-help summary {
  cursor: pointer;
  color: var(--cream);
  font-weight: 650;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}
.lm-help summary:hover { color: var(--ember-hot); }
.lm-help .prose { padding: 8px 0 10px; font-size: 0.98rem; }

@media (prefers-reduced-motion: reduce) {
  .lm-st.is-on .lm-ping { animation: none; }
  .is-done .lm-dest .lm-ring { animation: none; }
}

@media print {
  .site-header, .site-footer, .pager, .filters { display: none; }
  body { background: #fff; color: #000; }
}
