/* First paint: the harbour poster, the arrival card, and the small-screen gate pages.
   Static, class-only (CSP style-src 'self'); the live harbour crossfades in over the poster.
   The one EB Garamond set (D26): the overlay and the postcard read it through --pv-serif. */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("/harbour/_immutable/15cff476c50daabbc7899de1/fonts/eb-garamond-400-latin.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("/harbour/_immutable/0e917f9620a812f84a97d6de/fonts/eb-garamond-400-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("/harbour/_immutable/449e4c960f1b255ebb47c407/fonts/eb-garamond-600-latin.woff2") format("woff2"); }

:root {
  --pv-night: #0d1b2a;
  --pv-paper: #f4ecda;
  --pv-ink: #23201a;
  --pv-ink-2: #4a4236;
  --pv-brass: #a68242;
  --pv-serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --pv-mark: 19px; /* the wordmark, shared with the live corner mark */
  --pv-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pv-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  background: var(--pv-night);
}
html, body, #root { margin: 0; min-height: 100%; }
body { background: var(--pv-night); color: #eef0ec; font-family: var(--pv-ui); }
button, input, select, textarea { font: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- poster: full-bleed key art, the same framing as the live harbour's first view ----
   E28: as the live harbour takes over, the poster settles onto it (registered on the Pharos, wake.ts) while it fades.
   Its mask rests oversized, the feather outside the window; as the poster settles the mask draws in to a wide feather
   (15 % a side), so the poster dissolves into the live harbour round it, never a picture in a picture. Reduced motion:
   an opacity crossfade, nothing moves. The night key art (data-pv-hour="night", chosen before first paint by
   functions/index.ts) brings its own ground and card.
   B1: a poster that settles well inside the window (registration scale s < 0.85, a portrait tablet) lays its mask on its
   own box at the reveal and grows the feather from nothing to min(40 %, 15 % / s) of the box as it settles (poster.ts),
   so no box edge shows while it shrinks and the edge on screen ends as soft as landscape's. */
@property --pv-feather { syntax: "<percentage>"; inherits: false; initial-value: 15%; }
@keyframes pv-feather-in { from { --pv-feather: 0%; } }
.pv-poster {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: linear-gradient(#8e8991, #96715f 30%, #754e3b 55%, #3e4242); /* the key art's own rows, until it decodes */
  transition: opacity 1100ms var(--pv-ease);
}
.pv-poster img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
:root[data-pv-live] .pv-poster { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .pv-poster {
    mask-image:
      linear-gradient(90deg, transparent, #000 var(--pv-feather, 15%), #000 calc(100% - var(--pv-feather, 15%)), transparent),
      linear-gradient(transparent, #000 var(--pv-feather, 15%), #000 calc(100% - var(--pv-feather, 15%)), transparent);
    mask-composite: intersect;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 145% 145%;
  }
  :root[data-pv-live] .pv-poster { mask-size: 100% 100%; }
}

/* ---- arrival: the corner wordmark (where the live one appears) + one chart-paper card ---- */
.pv-arrival {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
  color: var(--pv-ink); font-family: var(--pv-serif);
  transition: opacity 700ms var(--pv-ease);
}
:root[data-pv-live] .pv-arrival { opacity: 0; }
.pv-arrival a, .pv-arrival nav { pointer-events: auto; }
.pv-arrival__mark,
.pv-arrival__card {
  background-color: var(--pv-paper);
  background-image: radial-gradient(120% 90% at 50% 40%, rgba(255, 252, 240, 0.55), rgba(255, 252, 240, 0) 60%, rgba(150, 118, 64, 0.1) 100%);
  border: 1px solid rgba(110, 84, 40, 0.55);
  border-radius: 1px;
  box-shadow: 0 1px 1px rgba(20, 16, 10, 0.12), 0 10px 30px -6px rgba(8, 14, 24, 0.45);
}
.pv-arrival__mark {
  position: absolute; top: 14px; left: 14px; margin: 0;
  padding: 5px 13px 6px 12px;
  font: 600 var(--pv-mark)/1 var(--pv-serif); letter-spacing: 0.01em;
}
.pv-arrival__mark i { font-weight: 400; font-style: italic; }
.pv-arrival__card {
  position: absolute; left: 50%; bottom: max(28px, 4vh);
  width: min(calc(100% - 32px), 34rem);
  transform: translateX(-50%);
  box-sizing: border-box;
  padding: 18px 24px 16px;
  font-size: 16px; line-height: 1.4;
  /* S08-I4: a card taller than its window (a short window, enlarged text, a terminal failure) scrolls from its own start,
     below the corner mark; where it fits nothing changes. Inert from the reveal on, so it never catches the world's input */
  max-height: calc(100% - max(28px, 4vh) - 72px); overflow-y: auto; pointer-events: auto;
}
.pv-arrival__card::before {
  content: ""; position: absolute; inset: 4px; border: 0.5px solid rgba(166, 130, 66, 0.55); pointer-events: none;
}
.pv-arrival__promise { margin: 0 0 10px; font-size: 1.3125rem; font-style: italic; text-align: center; }
.pv-arrival__guide {
  display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px;
  margin: 0 0 12px; padding: 10px 0 0; border-top: 0.5px solid var(--pv-brass);
}
.pv-arrival__guide > div { display: contents; }
.pv-arrival__guide dt { font-weight: 600; }
.pv-arrival__guide dd { margin: 0; color: var(--pv-ink-2); }
.pv-arrival__stage {
  margin: 0; padding-top: 10px; border-top: 0.5px solid var(--pv-brass);
  font-style: italic; color: var(--pv-ink-2); text-align: center;
}
/* D20: only JavaScript admission writes "Raising the harbour." (main.tsx); its line is held open, so the card never moves */
.pv-arrival__stage:empty::before { content: "\a0"; }
.pv-arrival nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 22px; }
/* the links and a failed arrival's action (Retry harbour, Reload page; drawn in harbour-app.css): 44 px under touch */
.pv-arrival nav :is(a, button) { display: inline-flex; align-items: center; min-height: 36px; }
.pv-arrival nav a { color: #7a5a22; text-underline-offset: 3px; text-decoration-thickness: 0.5px; }
.pv-arrival nav :is(a, button):focus-visible { outline: 2px solid #1668a3; outline-offset: 2px; }
@media (any-pointer: coarse) { .pv-arrival nav :is(a, button) { min-height: 44px; } }
@media (max-width: 640px) {
  .pv-arrival__guide { grid-template-columns: 1fr; }
  .pv-arrival__guide dd { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .pv-poster, .pv-arrival { transition-duration: 400ms; transition-timing-function: linear; }
}

/* ---- the night key art: its ground while the image loads, and the arrival card on the night bridge palette
   (harbour-ui.css), so the card it crossfades into is the same dark chart and the fire keeps the brightest pixels ---- */
:root[data-pv-hour="night"] {
  --pv-paper: #18212b;
  --pv-ink: #a39c8d;
  --pv-ink-2: #9f988a;
  --pv-brass: #a88a52;
}
:root[data-pv-hour="night"] .pv-poster { background: linear-gradient(#282b3c, #182238 30%, #1e2633 55%, #122337); }
:root[data-pv-hour="night"] :is(.pv-arrival__mark, .pv-arrival__card) {
  background-image: radial-gradient(120% 90% at 50% 40%, rgba(207, 174, 110, 0.05), rgba(207, 174, 110, 0) 60%, rgba(0, 0, 0, 0.2) 100%);
  border-color: rgba(207, 174, 110, 0.38);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 14px 34px -10px rgba(0, 0, 0, 0.65);
}
:root[data-pv-hour="night"] .pv-arrival__card::before { border-color: rgba(207, 174, 110, 0.26); }
:root[data-pv-hour="night"] .pv-arrival nav a { color: #ab8e5a; }
:root[data-pv-hour="night"] .pv-arrival nav :is(a, button):focus-visible { outline-color: #6a9cc8; }

/* ---- D20/Q14 the first paint: the window's own size picks the arrival card or the welcome, the sorted 720×600 test as
   two OR'd size queries (never orientation). main.tsx then stamps data-pv-gate and stays the authority (it adds the
   physical-screen half); without JavaScript these rules are the whole gate, and either page is finished. ---- */
:root:not([data-pv-gate]) :is(#root, .pv-poster) { display: none; }
@media (min-width: 720px) and (min-height: 600px), (min-width: 600px) and (min-height: 720px) {
  :root:not([data-pv-gate]) :is(#root, .pv-poster) { display: block; }
  :root:not([data-pv-gate]) .pv-welcome { display: none; }
}
:root[data-pv-gate="arrival"] .pv-welcome { display: none; }

/* ---- the welcome (O8-I5): screens or windows too small to chart, in the harbour's own voice — one chart-paper sheet,
   EB Garamond only, the reason and the action first; the night bridge palette when the edge opens on the night key art ---- */
.pv-welcome, .pharosville-gate {
  --w-paper: #f4ecda; --w-paper-2: #ebe0c6; --w-ink: #23201a; --w-ink-2: #4a4236; --w-ink-3: #6a5e4b;
  --w-brass: #7a5a22; --w-rule: #a68242; --w-link: #1f5873; --w-focus: #1668a3; --w-up: #3f6e52;
  box-sizing: border-box; min-height: 100svh; padding: 16px 12px 40px;
  background: linear-gradient(#0d1b2a, #16222f 45%);
}
:root[data-pv-hour="night"] :is(.pv-welcome, .pharosville-gate) {
  --w-paper: #18212b; --w-paper-2: #1f2a36; --w-ink: #e6dcc6; --w-ink-2: #c8bda5; --w-ink-3: #aba18c;
  --w-brass: #cfae6e; --w-rule: #a88a52; --w-link: #8ec1d9; --w-focus: #7fb8ea; --w-up: #8fc7a0;
  background: linear-gradient(#070d14, #0d1621 45%);
}
.pv-welcome[data-screen-capable="true"] [data-pv-branch="screen"],
.pv-welcome:not([data-screen-capable="true"]) [data-pv-branch="window"] { display: none; }
.pharosville-narrow {
  position: relative; box-sizing: border-box; width: min(100%, 38rem); margin: 0 auto; padding: 24px 20px 22px;
  color: var(--w-ink); font: 400 1rem/1.5 var(--pv-serif);
  background: var(--w-paper) radial-gradient(120% 90% at 50% 40%, rgba(255, 252, 240, 0.55), rgba(255, 252, 240, 0) 60%, rgba(150, 118, 64, 0.1) 100%);
  border: 1px solid rgba(110, 84, 40, 0.55); border-radius: 1px; box-shadow: 0 10px 30px -6px rgba(0, 0, 0, 0.5);
}
.pharosville-narrow::before { content: ""; position: absolute; inset: 4px; border: 0.5px solid rgba(166, 130, 66, 0.55); pointer-events: none; }
:root[data-pv-hour="night"] .pharosville-narrow {
  background-image: radial-gradient(120% 90% at 50% 40%, rgba(207, 174, 110, 0.05), rgba(207, 174, 110, 0) 60%, rgba(0, 0, 0, 0.2) 100%);
  border-color: rgba(207, 174, 110, 0.38);
}
:root[data-pv-hour="night"] .pharosville-narrow::before { border-color: rgba(207, 174, 110, 0.26); }
.pharosville-narrow p { margin: 14px 0 0; text-wrap: pretty; }
.pharosville-narrow__mark { margin: 0; font: 600 2.125rem/1.1 var(--pv-serif); letter-spacing: 0.01em; }
.pharosville-narrow__mark i { font-weight: 400; }
.pharosville-narrow .pharosville-narrow__promise { margin-top: 2px; font-size: 1.1875rem; font-style: italic; color: var(--w-ink-2); }
.pharosville-narrow .pharosville-narrow__subject { padding: 6px 12px; border-left: 2px solid var(--w-rule); background: var(--w-paper-2); }
.pharosville-narrow__gate { margin-top: 16px; padding: 14px 0 16px; border-block: 1px solid var(--w-rule); }
.pharosville-narrow .pharosville-narrow__reason { margin: 0; font-size: 1.09375rem; line-height: 1.45; }
.pharosville-narrow .pharosville-narrow__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.pharosville-narrow__actions > * { min-height: 44px; box-sizing: border-box; border-radius: 2px; font-size: 1rem; }
.pharosville-narrow__primary { display: inline-flex; align-items: center; padding: 0 18px; background: var(--w-ink); color: var(--w-paper); font-weight: 600; text-decoration: none; }
.pharosville-narrow__primary:hover { background: var(--w-ink-2); }
.pharosville-narrow__copy { padding: 0 16px; border: 1px solid var(--w-rule); background: transparent; color: var(--w-ink); cursor: pointer; }
.pharosville-narrow__copy:hover { background: var(--w-paper-2); }
.pharosville-narrow .pharosville-narrow__status { margin-top: 8px; font-style: italic; color: var(--w-ink-2); }
.pharosville-narrow__status:empty { display: none; }
.pharosville-narrow__status label { font-style: normal; }
.pharosville-narrow__status input {
  display: block; box-sizing: border-box; width: 100%; min-height: 44px; margin-top: 6px; padding: 0 10px;
  border: 1px solid var(--w-rule); border-radius: 2px; background: var(--w-paper-2); color: var(--w-ink); font: 0.9375rem var(--pv-serif);
}
.pharosville-gauge { margin-top: 12px; }
.pharosville-narrow .pharosville-gauge__side {
  display: grid; grid-template-columns: 5.5em 1fr auto; align-items: center; gap: 10px; margin: 4px 0 0;
  color: var(--w-ink-2); font-size: 0.9375rem; font-variant-numeric: lining-nums tabular-nums;
}
.pharosville-gauge__bar { height: 6px; border: 1px solid var(--w-rule); background: var(--w-paper-2); }
.pharosville-gauge__bar > span { display: block; width: calc(var(--pv-fill, 0) * 100%); height: 100%; background: var(--w-ink-2); }
.pharosville-gauge__side[data-met="true"] .pharosville-gauge__bar > span { background: var(--w-up); }
.pharosville-gate__illustration { margin: 18px 0 0; }
.pharosville-gate__still { display: block; width: 100%; height: auto; border: 1px solid rgba(110, 84, 40, 0.55); }
.pharosville-gate__illustration figcaption { padding-top: 6px; font-size: 0.84375rem; font-style: italic; color: var(--w-ink-3); }
.pharosville-narrow__guide { margin: 18px 0 0; padding-top: 4px; border-top: 0.5px solid var(--w-rule); }
.pharosville-narrow__guide > div { margin: 10px 0 0; }
.pharosville-narrow__guide dt { font-weight: 600; }
.pharosville-narrow__guide dd { margin: 2px 0 0; color: var(--w-ink-2); }
.pharosville-narrow__more { margin-top: 10px; border-bottom: 0.5px dotted var(--w-rule); }
.pharosville-narrow__more + .pharosville-narrow__more { margin-top: 0; }
.pharosville-narrow__more summary { padding: 10px 0; font-weight: 600; cursor: pointer; }
.pharosville-narrow__more summary::marker { color: var(--w-brass); }
.pharosville-narrow__more p { margin: 0 0 10px; color: var(--w-ink-2); }
.pharosville-narrow__links { display: flex; flex-direction: column; margin-top: 14px; }
.pharosville-narrow__links a { display: flex; align-items: center; min-height: 44px; border-bottom: 0.5px dotted var(--w-rule); }
.pharosville-narrow :is(.pharosville-narrow__more, .pharosville-narrow__links) a { color: var(--w-link); text-underline-offset: 3px; text-decoration-thickness: 0.5px; }
.pharosville-narrow__more a { display: inline-flex; align-items: center; min-height: 44px; }
.pharosville-narrow .pharosville-narrow__size { margin-top: 18px; color: var(--w-ink-3); font-size: 0.875rem; }
.pharosville-narrow :is(a, button, summary, input):focus-visible { outline: 2px solid var(--w-focus); outline-offset: 2px; }
@media (min-width: 480px) { .pv-welcome, .pharosville-gate { padding: 32px 24px 48px; } .pharosville-narrow { padding: 28px 32px 26px; } }
/* a coarse pointer's live mark is 50 px tall: the plaque matches it, so the reveal's crossfade is registered */
@media (any-pointer: coarse) { .pv-arrival__mark { padding-block: 14px 15px; } }
