/* St. John Almanac: Experiences. Tokens only, so day and night both work. Classes under xp-.

   The stage: the living island and, beside it, a small set of cards. On a phone the picture stands at the top with
   nothing laid over it and stays there while the page is scrolled; the bar is under it, and the cards under that, one
   swipe a card. On a desk the cards stand in a
   column beside the picture. With scripts off, plain.css lays the same cards out as a page to read. */

.xp { --xp-top: 0px; --xp-pic: max(13rem, 41svh); display: block; min-height: 100svh; background: var(--sheet); color: var(--ink); }
/* on a phone the picture keeps its place at the top while the card under it is read, and the bar keeps its place under the picture */
.xp-pic { position: sticky; top: 0; z-index: 3; height: var(--xp-pic); background: var(--forest); }
.xp-box { position: absolute; inset: 0; }
.xp-still { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.xp-box canvas { touch-action: pan-y; }
.xp-side { display: flex; flex-direction: column; }

/* the bar: back, where you are, on, play, fill the screen */
.xp-bar { order: -2; position: sticky; top: var(--xp-pic); z-index: 2; flex: none; display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem var(--gutter-r) 0.4rem var(--gutter-l); border-bottom: 1px solid var(--rule); background: var(--sheet); }
.xp-bar[hidden] { display: none; }
.xp-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); cursor: pointer; }
.xp-btn:hover { border-color: var(--ink); }
.xp-btn:disabled { opacity: 0.35; cursor: default; border-color: var(--rule); }
.xp-btn:focus-visible, .xp-dot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.xp-btn[hidden] { display: none; }
.xp-btn--play { background: var(--press); color: var(--on-press); border-color: var(--press); }
.xp-btn--play:hover { filter: brightness(1.12); border-color: var(--press); }
.xp-dots { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 0.15rem; list-style: none; margin: 0; padding: 0; }
.xp-dots li { display: flex; flex: 0 1 1.5rem; min-width: 0.6rem; }      /* the dots give way evenly, so a tour of many stops still stands between the buttons */
.xp-dot { position: relative; width: 100%; height: 2.75rem; padding: 0; border: 0; background: none; cursor: pointer; }
.xp-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 0.55rem; height: 0.55rem; margin: -0.275rem 0 0 -0.275rem; border-radius: 50%; background: var(--rule); transition: transform 0.2s ease, background-color 0.2s ease; }
.xp-dot:hover::before { background: var(--ink-soft); }
.xp-dot[aria-current="true"]::before { background: var(--accent); transform: scale(1.5); }
@media (max-width: 22.5rem) { .xp-bar { gap: 0.25rem; } .xp-dots { gap: 0; } .xp-dots li { flex-basis: 1.05rem; } }      /* the narrowest phones: the dots draw together so six of them and four buttons stand in one row */
.xp-where { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }

/* A TOUR. With scripts on only the list or the stop in front is laid out; with scripts off all of them are, one after another. */
.xp--run .xp-cards:not(.xp-cards--on), .xp--run .xp-cover:not(.xp-cover--on) { display: none; }
/* the tour's list: its name and a way to start, then a row for each stop; the row whose place is glowing on the island is lit */
.xp-cover { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.9rem var(--gutter-r) 1.2rem var(--gutter-l); }
.xp-cover-in { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 0.7rem; }
.xp-cover-in > * { margin: 0; }
.xp-cover h1 { font-size: clamp(1.9rem, 4.6vw + 0.8rem, 2.6rem); line-height: 1.05; text-wrap: balance; }
.xp-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.xp-others { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); }      /* (the way to the other tours, under a tour's own stops) */
.xp-others > .eyebrow { margin: 0; }
.xp-up, .xp-all { margin: 0; font-size: 0.82rem; font-weight: 700; }      /* (the way back to the chooser of every tour) */
.xp-up a, .xp-all a { color: var(--accent); text-underline-offset: 0.15em; }
.xp-up a::before, .xp-all a::before { content: "\2039\00a0"; }
.xp-all { margin-top: 0.6rem; }
.xp-row-n { display: block; margin-top: 0.12rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-soft); }      /* (on the chooser: what kind of tour, and how many stops) */
.xp-row { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 0.8rem; align-items: center; padding: 0.5rem 0.4rem; margin-inline: -0.4rem; border-top: 1px solid var(--rule); border-radius: 10px; color: inherit; text-decoration: none; transition: background-color 0.3s ease; }
.xp-row img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; background: var(--land); }
.xp-row-in { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.xp-row-in b { font-family: var(--display); font-weight: 400; font-size: 1.22rem; line-height: 1.15; }
.xp-row-in i { font-style: normal; font-size: 0.9rem; line-height: 1.35; color: var(--ink-soft); }
.xp-row:hover, .xp-row:focus-visible, .xp-row--lit { background: color-mix(in srgb, var(--gold-bright) 26%, var(--sheet)); }
.xp-row--lit b { color: var(--accent); }
.xp-row:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
/* where in the tour this is, and the way back to the list; during a leg, the leg's own line */
.xp-stop { order: -1; flex: none; display: flex; align-items: center; gap: 0.7rem; margin: 0; padding: 0.3rem var(--gutter-r) 0.3rem var(--gutter-l); font-size: 0.8rem; line-height: 1.3; color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
.xp-stop[hidden] { display: none; }
.xp-stop-back { flex: none; font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 0.35rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }
.xp-stop-back::before { content: "\2039\00a0"; }
.xp--opening .xp-stop-back { display: none; }      /* (the tour's opening: the line says what is being shown; there is nowhere to go back to yet) */
.xp--opening .xp-stop-say { font-weight: 600; color: var(--ink); }
.xp--opening .xp-spot { animation-duration: 0.1s; }      /* (a name is in full at once: each stands only half a second) */
.xp-stop-back:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.xp-stop-say { min-width: 0; font-weight: 600; color: var(--ink); }
.xp-dots--many { gap: 0; }
.xp-dots--many li { flex-basis: 1rem; min-width: 0.45rem; }      /* a tour of more than eight stops: smaller marks, so a dozen stand between the buttons on the narrowest phone */
.xp-dots--many .xp-dot::before { width: 0.4rem; height: 0.4rem; margin: -0.2rem 0 0 -0.2rem; }
.xp-sources-h { margin: 0.6rem 0 0; font-size: 0.95rem; }

/* what a card points out on the model: a name beside each gold ring (the rings themselves are the model's own marks) */
.xp-spots { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.xp-spot { position: absolute; left: 0; top: 0; white-space: nowrap; font: 600 0.72rem/1 var(--text); letter-spacing: 0.01em; color: var(--on-forest); background: color-mix(in srgb, var(--forest) 88%, transparent); border: 1px solid color-mix(in srgb, var(--gold-bright) 70%, transparent); padding: 0.26rem 0.55rem; border-radius: 999px; box-shadow: 0 2px 10px rgba(var(--photo-shade), 0.45); animation: xp-spot-in 0.5s ease both; will-change: transform; }
.xp-spot--far { font: 400 1.2rem/1 var(--display); letter-spacing: 0; padding: 0.4rem 0.85rem 0.45rem; border-color: var(--gold-bright); transition: opacity 0.25s linear; }
@keyframes xp-spot-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 56rem) { .xp-spot { font-size: 0.8rem; padding: 0.3rem 0.65rem; } .xp-spot--far { font-size: 1.5rem; padding: 0.45rem 1rem 0.5rem; } }

/* by night: what hour the picture shows, and the way to the other */
.xp-hour { order: -1; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0; padding: 0.3rem var(--gutter-r) 0.3rem var(--gutter-l); font-size: 0.78rem; line-height: 1.3; color: var(--ink-soft); background: var(--land); border-bottom: 1px solid var(--land-edge); }
.xp-hour[hidden] { display: none; }
.xp-hour-btn { flex: none; font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 0.35rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }
.xp-hour-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* the cards: a rail across on a phone, one card to the width, as tall as the card in front */
.xp-cards { position: relative; display: flex; flex-direction: row; align-items: flex-start; list-style: none; margin: 0; padding: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; transition: height 0.25s ease; }
.xp-cards::-webkit-scrollbar { display: none; }
.xp-card { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; background: var(--sheet); scroll-margin-top: calc(var(--xp-pic) + 3.7rem); }      /* a link that names a card brings the stage to the top of the window, the card's head under the bar and not behind the picture */
/* a card's photographs: all in one place, the one whose turn it is in view, each with its own credit under it */
.xp-spool { position: relative; display: grid; }
.xp-fig { grid-area: 1 / 1; margin: 0; min-width: 0; pointer-events: none; }
.xp-fig--on { pointer-events: auto; }
/* (one photograph fades into the next; the credit under it changes at once, so two are never read through each other) */
.xp-fig img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; opacity: 0; transition: opacity 0.9s ease; }
.xp-fig--on img { opacity: 1; }
.xp-fig .xp-credit { visibility: hidden; }
.xp-fig--on .xp-credit { visibility: visible; }
.xp-spool { background: var(--land); }
.xp-spool--many { cursor: pointer; }
/* a picture card's name stands on its photograph, over a shade at the photograph's foot */
.xp-on { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 2 / 1; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.2rem; padding: 0 var(--gutter-r) 0.6rem var(--gutter-l); color: var(--on-photo); background: linear-gradient(180deg, rgba(var(--photo-shade), 0) 45%, rgba(var(--photo-shade), 0.72)); pointer-events: none; }
.xp-on > * { margin: 0; }
.xp-on .eyebrow { color: var(--gold-bright); text-shadow: 0 1px 8px rgba(var(--photo-shade), 0.7); }
.xp-on h1, .xp-on h2 { color: var(--on-photo); text-shadow: 0 1px 16px rgba(var(--photo-shade), 0.6); }
.xp-pips { position: absolute; z-index: 2; top: 0.55rem; right: 0.6rem; display: flex; gap: 0.28rem; pointer-events: none; }
.xp-pips > i { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--on-photo); opacity: 0.45; box-shadow: 0 0 4px rgba(var(--photo-shade), 0.8); transition: opacity 0.3s ease, transform 0.3s ease; }
.xp-pips > i.on { opacity: 1; transform: scale(1.25); }
.xp-credit { display: block; padding: 0.28rem var(--gutter-r) 0 var(--gutter-l); font-size: 0.66rem; line-height: 1.35; color: var(--ink-soft); }
.xp-credit a { color: inherit; }
.xp-cap { font-weight: 600; color: var(--ink); }
.xp-card-in { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem var(--gutter-r) 1.1rem var(--gutter-l); }
.xp-card-in > * { margin: 0; }
.xp-card h1 { font-size: clamp(1.9rem, 5vw + 0.8rem, 2.5rem); line-height: 1.05; }
.xp-card h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.45rem, 2.4vw + 0.9rem, 1.8rem); line-height: 1.1; letter-spacing: -0.01em; }
.xp-say { font-size: 1.04rem; line-height: 1.45; max-width: 34rem; }
.xp-src { white-space: nowrap; }
.xp-src a { display: inline-block; margin-left: 0.2rem; font-size: 0.68rem; font-weight: 700; line-height: 1; vertical-align: super; color: var(--accent); text-decoration: none; }
.xp-src a:hover { text-decoration: underline; }
.xp-facts { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; }
.xp-facts > div { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 0.5rem; align-items: baseline; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
.xp-facts > div:first-child { border-top: 0; padding-top: 0; }
.xp-facts dt { display: flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.xp-facts dt .sym, .xp-facts dt almanac-symbol { flex: none; width: 1.2rem; height: 1.2rem; color: var(--accent); }
.xp-facts dd { margin: 0; font-size: 0.95rem; line-height: 1.38; }
/* a walk in figures: the profile of its heights (drawn by the build, no script) and the numbers under it */
.xp-profile { margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.xp-prof { display: block; width: 100%; height: auto; }
.xp-prof-trees { fill: color-mix(in srgb, var(--accent) 22%, var(--sheet)); }
.xp-prof-ground { fill: color-mix(in srgb, var(--gold-bright) 34%, var(--sheet)); }
.xp-prof-line { fill: none; stroke: var(--gold-bright); stroke-width: 2.4; stroke-linejoin: round; }
.xp-prof-grid { stroke: var(--rule); stroke-width: 1; }
.xp-prof-t { font: 600 11px/1 var(--text); fill: var(--ink-soft); }
.xp-prof-mark circle { fill: var(--sheet); stroke: var(--ink); stroke-width: 2; }
.xp-prof-mark text { font: 700 11px/1 var(--text); fill: var(--ink); }
.xp-prof-mark--on circle { fill: var(--accent); stroke: var(--accent); }
.xp-prof-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 0.8rem; font-size: 0.78rem; line-height: 1.35; color: var(--ink-soft); }
.xp-prof-key b { color: var(--ink); }
.xp-prof-key .on { color: var(--ink); font-weight: 600; }
.xp-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 0.9rem; margin: 0; }
.xp-nums > div { display: flex; flex-direction: column; gap: 0.05rem; padding-top: 0.4rem; border-top: 1px solid var(--rule); min-width: 0; }
.xp-nums dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.xp-nums dd { margin: 0; font-family: var(--display); font-size: 1.3rem; line-height: 1.15; }
.xp-nums dd small { display: block; font-family: var(--text); font-size: 0.76rem; line-height: 1.3; color: var(--ink-soft); }
.xp-nums-how, .xp-nums-src { margin: 0; }
/* where to go, as links to a map: each spot's name, a Directions button and the same spot in Apple Maps */
.xp-go { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.xp-go li { display: grid; gap: 0.3rem; padding-top: 0.55rem; border-top: 1px solid var(--rule); }
.xp-go-n { font-size: 0.9rem; line-height: 1.3; }
.xp-go-n b { display: block; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.xp-go-a { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; font-size: 0.84rem; }
.xp-go-a .button { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.36rem 0.8rem; font-size: 0.84rem; }
.xp-go-a .button .sym, .xp-go-a .button almanac-symbol { flex: none; width: 1rem; height: 1rem; }
/* (on a tour's list they stand only at its end, under the wrap-up's words; each stop's own card has them all along) */
.xp-go--end { display: none; margin-top: 0.2rem; }
.xp-cover--end .xp-go--end { display: grid; }
/* a tour's own call to action under its Start button: whose day it is, with the way to them */
.xp-call { margin: 0; font-size: 0.86rem; color: var(--ink-soft, var(--ink)); }
.xp-call a { font-weight: 600; }
.xp-more { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.xp-more a { display: inline-block; padding: 0.34rem 0.75rem; border-radius: 999px; border: 1px solid var(--rule); font-size: 0.84rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.xp-more a::after { content: " \2192"; color: var(--accent); }
.xp-more a:hover { border-color: var(--ink); }

/* the Today card's figures: each a tile, and each a way in to the Almanac's own tool for more */
.xp-today { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.xp-today:empty { display: none; }
.xp-today-wait:empty { display: none; }
.xp-tile.tile--go > a { padding: 0.65rem 0.8rem 0.7rem; gap: 0.18rem; }
.xp-tile .tile-top { font-size: 0.66rem; letter-spacing: 0.07em; }
.xp-tile .tile-top .sym { width: 1.45rem; height: 1.45rem; }
.xp-sym { display: inline-flex; }
.xp-tile .tile-n { font-size: clamp(1.7rem, 3.6vw + 0.8rem, 2.15rem); white-space: nowrap; }
.xp-tile .tile-n small { font-size: 0.46em; }
.xp-tile .tile-say { font-size: 0.76rem; line-height: 1.3; }
.xp-word { font-weight: 700; color: var(--ink); }

.xp-foot { padding-block: 1rem 2.5rem; }
.xp-keys { margin: 0 0 0.8rem; }
.xp-sources { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.45rem; }
.xp-sources li:target { background: color-mix(in srgb, var(--gold-bright) 28%, transparent); }

/* a desk: the picture, and the cards in a column beside it; the whole stage in view under the bar */
@media (min-width: 56rem) {
  .xp { display: grid; grid-template-columns: minmax(0, 1fr) clamp(22rem, 31vw, 30rem); height: calc(100svh - var(--xp-top)); min-height: 30rem; }
  .xp-pic { position: relative; top: auto; height: auto; min-height: 0; }
  .xp-side { border-left: 1px solid var(--rule); min-width: 0; min-height: 0; }
  .xp-hour, .xp-stop { order: 0; padding-inline: 1rem; }
  .xp-cover { order: 0; flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 1rem 1rem 1.2rem; }
  .xp-bar { order: 1; position: static; border-bottom: 0; border-top: 1px solid var(--rule); padding: 0.55rem 0.9rem; }
  .xp-cards { order: 0; flex: 1 1 0; min-height: 0; flex-direction: column; align-items: stretch; gap: 0.9rem; padding: 0.9rem 0.9rem 0; overflow-x: hidden; overflow-y: auto; scroll-snap-type: y proximity; scroll-padding-top: 0.9rem; overscroll-behavior-x: auto; scrollbar-width: thin; }
  .xp-cards::-webkit-scrollbar { display: block; width: 8px; }
  .xp-cards::after { content: ""; flex: 0 0 72%; }      /* room under the last card, so that it too can come to the top */
  .xp-card { flex: none; overflow: hidden; scroll-margin-top: 0; border: 1px solid var(--rule); border-radius: 14px; opacity: 0.5; transition: opacity 0.35s ease, box-shadow 0.35s ease; cursor: pointer; }
  .xp-card--on { opacity: 1; cursor: auto; box-shadow: 0 6px 22px -12px color-mix(in srgb, var(--ink) 55%, transparent); }
  .xp-card:hover { opacity: 1; }
  .xp-fig img, .xp-on { aspect-ratio: 3 / 2; }
  .xp-on { padding: 0 1rem 0.7rem; }
  .xp-credit { padding-inline: 1rem; }
  .xp-card-in { padding: 0.75rem 1rem 1.1rem; }
  .xp-card h1 { font-size: clamp(2.1rem, 1.4vw + 1.4rem, 2.9rem); }
  /* the screen filled: the same stage, larger, for a big screen across a room */
  .xp--full { height: 100vh; grid-template-columns: minmax(0, 1fr) clamp(26rem, 33vw, 40rem); font-size: 1.14rem; }
  .xp--full .xp-say { font-size: 1.22rem; }
  .xp--full .xp-facts dd { font-size: 1.12rem; }
  .xp--full .xp-facts > div { grid-template-columns: 7.4rem minmax(0, 1fr); }
  .xp--full .xp-facts dt { font-size: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) { .xp-row, .xp-card, .xp-cards, .xp-dot::before, .xp-fig img, .xp-pips > i { transition: none; } .xp-spot { animation: none; } }
