/* ============================================================================
   Sea Cross V2: Ports
   The coast, unrolled. A strip chart of the served coast cut into the five
   verified regions. Every strip is drawn at one scale and turned so the
   passage runs down the page; its own arrow points north.

   Its grammar is orientation: the chart turns where the coast turns. Type
   never turns with it; names and positions stay upright while the geography
   moves around them.

   Build order: the static strips below are the page (phones, reduced motion,
   no JS), each sheet already turned. ports.js adds .pt-on-live on wide, tall
   screens with motion: two pinned scenes (the turn at Port Said, the fork at
   Sinai) drawn live from the same geometry, at the same scale.
   ========================================================================== */

.page-ports {
  --pt-table: #e4dfd3;          /* the chart table: page ground                 */
  --pt-paper: #f4f1e9;          /* chart paper; open water on the sheets        */
  --pt-land: #e3d7ba;           /* land tint, buff                               */
  --pt-shoal: #cddfdb;          /* the coastal ribbon on the water side          */
  --pt-ink: #1d252c;
  --pt-coast: #27323a;
  --pt-steel: #56626a;          /* secondary type on paper (5.6:1)              */
  --pt-teal: #2e6a64;           /* water names (5.1:1)                           */
  --pt-rust: #9e4a2c;           /* head office (5.0:1)                           */
  --pt-grat: rgba(46, 106, 100, .32);
  --pt-hair: rgba(29, 37, 44, .2);
  --pt-w: clamp(300px, 34vw, 540px);   /* one sheet width: one scale everywhere   */
  background: var(--pt-table);
  color: var(--pt-ink);
}
html:has(.page-ports) { background: var(--pt-table); }
.page-ports main { overflow-x: clip; }

/* ------------------------------------------------------------- geometry
   Shared by every sheet, the index and the live scenes (one <g>, many <use>). */
.pt-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.pt-water { fill: var(--pt-paper); }
.pt-shoal { fill: none; stroke: var(--pt-shoal); stroke-width: 3.2; stroke-linejoin: round; }
.pt-ground { fill: var(--pt-land); }
.pt-lake { fill: var(--pt-shoal); stroke: var(--pt-coast); stroke-width: .7; vector-effect: non-scaling-stroke; }
.pt-canal-bank { fill: none; stroke: var(--pt-coast); stroke-width: 3.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pt-canal { fill: none; stroke: var(--pt-shoal); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pt-coast { fill: none; stroke: var(--pt-coast); stroke-width: .8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pt-grat { fill: none; stroke: var(--pt-grat); stroke-width: .6; vector-effect: non-scaling-stroke; }

/* ----------------------------------------------------------- shared type */
.pt-crumbs { font-family: var(--sx-mono); font-size: .76rem; letter-spacing: .02em; color: var(--pt-steel); }
.pt-crumbs ol { display: flex; gap: .5rem; }
.pt-crumbs li + li::before { content: "/"; margin-right: .5rem; opacity: .5; }
.pt-crumbs a { text-decoration: none; }
.pt-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pt-h1 {
  margin-top: 1.4rem;
  font-size: clamp(2.6rem, 1.2rem + 4.2vw, 5.6rem); font-weight: 650; font-stretch: 118%;
  letter-spacing: -.045em; line-height: .92; text-wrap: balance; max-width: 11ch;
}
.pt-h2 { font-size: var(--sx-t-1); font-weight: 650; font-stretch: 118%; letter-spacing: -.04em; line-height: .96; text-wrap: balance; }
.pt-lede { max-width: 42ch; margin-top: 1.4rem; font-size: var(--sx-t-lede); line-height: 1.45; color: var(--pt-ink); }
.pt-nfn {
  font-family: var(--sx-mono); font-size: .72rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--pt-rust);
}

/* ============================================================ TITLE BLOCK
   One desktop view under the header: the words and the index as equal halves. */
.pt-title {
  --pt-open-pad: clamp(1rem, 3.2svh, 2.6rem);
  padding-top: calc(var(--header-h) + var(--pt-open-pad)); padding-bottom: var(--pt-open-pad);
}
.pt-title__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 4.5vw, 5rem); align-items: center; }
.pt-title .pt-h1 { margin-top: clamp(.8rem, 2.2svh, 1.4rem); font-size: min(clamp(2.6rem, 1.2rem + 4.2vw, 5.6rem), 10.5svh); }
.pt-title .pt-lede { margin-top: clamp(.9rem, 2.2svh, 1.4rem); max-width: 44ch; }
.pt-key { margin-top: clamp(1.4rem, 3.4svh, 2.6rem); }
.pt-key__title { font-family: var(--sx-mono); font-size: .76rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.pt-key__text { margin-top: .5rem; color: var(--pt-steel); line-height: 1.5; max-width: 60ch; }
/* The five regions in passage order, read down the first column and on into the second. */
.pt-key__list { margin-top: 1rem; columns: 2; column-gap: clamp(1.5rem, 3vw, 2.5rem); border-top: 1px solid var(--pt-hair); }
.pt-key__list li { break-inside: avoid; }
.pt-key__list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  min-height: 44px; padding: .62rem 0; border-bottom: 1px solid var(--pt-hair); text-decoration: none;
  transition: color .2s var(--sx-ease);
}
.pt-key__name { font-weight: 600; font-stretch: 112%; font-size: 1.04rem; letter-spacing: -.01em; }
.pt-key__count { font-family: var(--sx-mono); font-size: .74rem; color: var(--pt-steel); white-space: nowrap; }
@media (hover: hover) { .pt-key__list a:hover .pt-key__name { color: var(--pt-teal); } }

/* The index: the whole coast, north up, with the five sheet limits. As tall as the view
   allows (header, padding and caption taken off), never wider than its half. */
.pt-index { margin: 0; container-type: inline-size; --pt-ix-w: min(100cqi, calc((100svh - var(--header-h) - 2 * var(--pt-open-pad, 2rem) - 4.6rem) * var(--ar-index, 1))); }
.pt-index__chart {
  position: relative; aspect-ratio: var(--ar); margin-inline: auto; width: var(--pt-ix-w);
  background: var(--pt-paper);
  box-shadow: 0 0 0 1px rgba(29, 37, 44, .55), 0 0 0 5px var(--pt-paper), 0 0 0 6px rgba(29, 37, 44, .3), 0 26px 40px -30px rgba(21, 27, 33, .5);
}
.pt-index__chart svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pt-index .pt-shoal { stroke-width: 3; }
.pt-index__limit { fill: rgba(46, 106, 100, .05); stroke: var(--pt-teal); stroke-width: 1.2; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; transition: fill .3s var(--sx-ease); }
.pt-index__limit.is-lit { fill: rgba(46, 106, 100, .16); stroke-dasharray: none; }
.pt-index__port { fill: var(--pt-ink); }
.pt-index__port.is-hq { fill: var(--pt-rust); }
.pt-index__label {
  position: absolute; left: var(--lx); top: var(--ly); transform: translate(-50%, -50%);
  font-family: var(--sx-mono); font-size: .7rem; letter-spacing: .06em; white-space: nowrap; color: var(--pt-teal);
  text-shadow: 0 0 3px var(--pt-paper), 0 0 3px var(--pt-paper), 0 0 6px var(--pt-paper);
}
.pt-index__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; width: var(--pt-ix-w); margin: 1.1rem auto 0; font-size: .82rem; line-height: 1.45; color: var(--pt-steel); }
.pt-index__cap > span:first-child { max-width: 46ch; }
.pt-index__cap .pt-nfn { white-space: nowrap; }

/* ================================================================ SHEETS */
.pt-sheet {
  position: relative; width: var(--pt-w); aspect-ratio: var(--ar);
  background: var(--pt-paper);
  /* A chart's double neatline, and the sheet resting on the table. */
  box-shadow: 0 0 0 1px rgba(29, 37, 44, .6), 0 0 0 5px var(--pt-paper), 0 0 0 6px rgba(29, 37, 44, .28), 0 30px 44px -34px rgba(21, 27, 33, .55);
}
.pt-sheet__chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pt-bar path { fill: none; stroke: var(--pt-ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pt-bar__label { position: absolute; left: var(--bx, 4.7%); bottom: var(--by, 3%); font-family: var(--sx-mono); font-size: .64rem; color: var(--pt-ink); transform: translateY(-3px); }

/* A position fix: a small ring with its dot. The head office is ringed twice. */
.pt-fix {
  position: absolute; left: var(--fx); top: var(--fy); width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  border: 1.5px solid var(--pt-ink); border-radius: 50%;
  background: radial-gradient(circle, var(--pt-ink) 0 1.6px, var(--pt-paper) 2.2px);
}
.pt-fix--hq { width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; border-color: var(--pt-rust); box-shadow: 0 0 0 2.5px var(--pt-paper), 0 0 0 3.6px var(--pt-rust); background: radial-gradient(circle, var(--pt-rust) 0 2.6px, var(--pt-paper) 3.2px); }

/* The north arrow: a half-filled needle, turned by the strip; its N stays upright. */
.pt-north {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px;
  transform: rotate(var(--theta)); transform-origin: 50% 50%;
}
.pt-north::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(29, 37, 44, .35); border-radius: 50%; background: rgba(244, 241, 233, .86); }
.pt-north__needle {
  position: absolute; left: 50%; top: 5px; width: 10px; height: 34px; margin-left: -5px;
  background: linear-gradient(90deg, var(--pt-ink) 50%, rgba(29, 37, 44, .2) 50%);
  clip-path: polygon(50% 0, 100% 100%, 50% 80%, 0 100%);
}
.pt-north__n {
  position: absolute; left: 50%; top: -13px; width: 14px; margin-left: -7px; text-align: center;
  font: 600 .7rem/1 var(--sx-font); font-stretch: 112%; color: var(--pt-ink);
  transform: rotate(calc(-1 * var(--theta)));
}
.pt-north--index { top: 14px; right: 14px; }

/* Graticule values where whole degrees meet the sheet's edge. */
.pt-tick {
  position: absolute; left: 0; top: 0; padding: 1px 3px; transform: translate(4px, -50%);
  font-family: var(--sx-mono); font-size: .6rem; letter-spacing: .02em; line-height: 1.2; white-space: nowrap;
  color: var(--pt-teal); background: rgba(244, 241, 233, .9);
}
.pt-tick::before { content: ""; position: absolute; left: -4px; top: 50%; width: 4px; height: 1px; background: var(--pt-teal); }

/* ===================================================== STRIPS (static) */
.pt-scene, .pt-flow { position: relative; }
.pt-strip {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--pt-w) minmax(0, 1fr); column-gap: clamp(1.5rem, 4vw, 4rem);
  max-width: var(--sx-maxw); margin-inline: auto; padding: clamp(3rem, 6vw, 5.5rem) var(--sx-gutter);
}
.pt-strip__head { grid-column: 1; align-self: start; position: sticky; top: calc(var(--header-h) + 2rem); justify-self: end; max-width: 22rem; text-align: right; }
.pt-strip__name:focus { outline: none; }
.pt-strip__name { font-size: var(--sx-t-2); font-weight: 650; font-stretch: 118%; letter-spacing: -.035em; line-height: 1; }
.pt-strip__note { margin-top: .8rem; color: var(--pt-steel); font-size: .98rem; line-height: 1.5; }
.pt-strip .pt-sheet { grid-column: 2; grid-row: 1; }
.pt-entries { grid-column: 3; grid-row: 1; position: relative; }
.pt-entry {
  position: absolute; left: 0; top: calc(var(--t) * 100%); transform: translateY(calc(var(--dy, 0px) - .9em));
  display: grid; padding-left: 1.4rem; line-height: 1.25; white-space: nowrap;
}
.pt-entry__name { font-size: clamp(1.1rem, .95rem + .45vw, 1.42rem); font-weight: 600; font-stretch: 112%; letter-spacing: -.02em; }
.pt-entry__pos { margin-top: .2rem; font-family: var(--sx-mono); font-size: .74rem; color: var(--pt-steel); font-variant-numeric: tabular-nums; }
.pt-entry__hq { margin-top: .3rem; font-family: var(--sx-mono); font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--pt-rust); }
.pt-entry--hq .pt-entry__name { font-size: clamp(1.3rem, 1rem + .9vw, 1.9rem); }
/* Leader lines from each fix to its entry (drawn by ports.js). */
.pt-leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pt-leaders line { stroke: var(--pt-ink); stroke-width: .75; opacity: .55; }

.pt-credit { font-family: var(--sx-mono); font-size: .66rem; color: var(--pt-steel); }
.pt-credit a { color: inherit; }
.pt-credit--canal { max-width: var(--sx-maxw); margin: -2.5rem auto 0; padding: 0 var(--sx-gutter) 2rem; text-align: center; }

/* The fork, before the two strips. */
.pt-forkhead {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--pt-w) minmax(0, 1fr); column-gap: clamp(1.5rem, 4vw, 4rem);
  max-width: var(--sx-maxw); margin-inline: auto; padding: clamp(3rem, 6vw, 5.5rem) var(--sx-gutter) 0;
}
.pt-forknote { grid-column: 1; justify-self: end; align-self: center; max-width: 22rem; text-align: right; font-size: var(--sx-t-3); line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.pt-forkhead .pt-sheet { grid-column: 2; }
.pt-sea {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  font-family: var(--sx-mono); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; color: var(--pt-teal);
  text-shadow: 0 0 3px var(--pt-paper), 0 0 3px var(--pt-paper), 0 0 6px var(--pt-paper);
  transition: opacity .25s linear;
}

/* ================================================================== PHONES
   The same chart, simplified: a coastline column with its arrow, entries beside. */
@media (max-width: 760px) {
  .page-ports { --pt-w: 50vw; }
  .pt-title { padding-bottom: 2.5rem; }
  .pt-title__grid { grid-template-columns: 1fr; }
  .pt-title .pt-h1 { font-size: clamp(2.6rem, 1.2rem + 4.2vw, 5.6rem); }
  .pt-key__list { columns: 1; }
  .pt-index { --pt-ix-w: min(100%, 26rem); }
  .pt-index__cap { flex-direction: column; gap: .6rem; }
  .pt-strip, .pt-forkhead { grid-template-columns: var(--pt-w) minmax(0, 1fr); column-gap: 1rem; padding-block: 2.5rem; }
  .pt-strip__head { grid-column: 1 / -1; grid-row: 1; position: static; justify-self: start; text-align: left; margin-bottom: 1.6rem; max-width: 30rem; }
  .pt-strip .pt-sheet { grid-column: 1; grid-row: 2; }
  .pt-entries { grid-column: 2; grid-row: 2; }
  .pt-entry { padding-left: .8rem; white-space: normal; }
  .pt-entry__name { font-size: 1.08rem; }
  .pt-entry--hq .pt-entry__name { font-size: 1.25rem; }
  .pt-entry__pos { font-size: .68rem; }
  .pt-forknote { grid-column: 1 / -1; justify-self: start; text-align: left; margin-bottom: 1.6rem; font-size: 1.08rem; }
  .pt-forkhead .pt-sheet { grid-column: 1; }
  /* The branch: Aqaba's strip sits to the right of the Red Sea's, as the gulf does. */
  .pt-strip--aqaba { grid-template-columns: minmax(0, 1fr) var(--pt-w); }
  .pt-strip--aqaba .pt-sheet { grid-column: 2; }
  .pt-strip--aqaba .pt-entries { grid-column: 1; }
  .pt-strip--aqaba .pt-entry { left: auto; right: 0; padding: 0 .8rem 0 0; text-align: right; }
  .pt-north { width: 38px; height: 38px; top: 8px; right: 8px; }
  .pt-north__needle { height: 28px; }
  .pt-credit--canal { margin-top: 1.5rem; text-align: left; }
}

/* Arrows swing in from the previous strip's north as each sheet arrives. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    html.pt-on-flow .pt-sheet .pt-north { animation: pt-swing linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
  }
}
@property --theta { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
@keyframes pt-swing { from { --theta: var(--theta-from, 0deg); } }

/* =========================================================== LIVE SCENES
   Wide, tall screens with motion. The stage pins; ports.js draws the windows,
   turns the chart, and places every label upright on top of it. */
.pt-live { display: none; }
html.pt-on-live .pt-scene { height: var(--scene-h, 400svh); }
html.pt-on-live .pt-stage { position: sticky; top: 0; height: 100svh; overflow: clip; }
html.pt-on-live .pt-live { display: block; position: absolute; inset: 0; }
html.pt-on-live .pt-scene .pt-sheet,
html.pt-on-live .pt-scene .pt-leaders { display: none; }
html.pt-on-live .pt-scene .pt-strip { position: absolute; inset: 0; display: block; padding: 0; max-width: none; pointer-events: none; }
html.pt-on-live .pt-scene .pt-strip__head { position: absolute; top: 0; left: 0; width: var(--hw, 20rem); transform: translate(var(--hx, 0px), var(--hy, 0px)); opacity: var(--ho, 1); text-align: left; justify-self: auto; max-width: none; }
html.pt-on-live .pt-scene .pt-strip__head.is-right { text-align: left; }
html.pt-on-live .pt-scene .pt-strip__head.is-end { text-align: right; }
html.pt-on-live .pt-scene .pt-entries { position: absolute; inset: 0; }
html.pt-on-live .pt-scene .pt-entry { top: 0; transform: translate(var(--ex, 0px), var(--ey, 0px)); opacity: var(--eo, 0); padding-left: 0; }
html.pt-on-live .pt-scene .pt-entry.is-end { text-align: right; }
html.pt-on-live .pt-scene .pt-forkhead { position: absolute; inset: 0; display: block; padding: 0; max-width: none; pointer-events: none; }
html.pt-on-live .pt-scene .pt-forknote { position: absolute; top: 0; left: 0; width: var(--hw, 20rem); transform: translate(var(--hx, 0px), var(--hy, 0px)); opacity: var(--ho, 0); text-align: left; }
html.pt-on-live .pt-credit--canal:focus-within { --co: 1; }
html.pt-on-live .pt-credit--canal { position: absolute; left: var(--sx-gutter); bottom: 1.1rem; margin: 0; padding: 0; text-align: left; opacity: var(--co, 0); pointer-events: auto; }

.pt-win {
  position: absolute; left: 0; top: 0; overflow: hidden;
  background: var(--pt-paper);
  box-shadow: 0 0 0 1px rgba(29, 37, 44, .6), 0 0 0 5px var(--pt-paper), 0 0 0 6px rgba(29, 37, 44, .28), 0 30px 44px -34px rgba(21, 27, 33, .55);
}
.pt-win svg { position: absolute; left: 0; top: 0; overflow: visible; }
.pt-win .pt-north { width: 58px; height: 58px; top: 14px; right: 14px; }
.pt-win .pt-north__needle { height: 46px; width: 13px; margin-left: -6.5px; top: 6px; }
.pt-win .pt-north__n { top: -15px; font-size: .78rem; }
.pt-win .pt-fix { left: 0; top: 0; transform: translate(var(--fx), var(--fy)); opacity: var(--fo, 1); }
.pt-win .pt-sea { transform: translate(var(--sx), var(--sy)) translate(-50%, -50%); }
.pt-win .pt-tick { transform: translate(4px, var(--ty)) translateY(-50%); }
.pt-overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pt-overlay line { stroke: var(--pt-ink); stroke-width: .75; }
.pt-overlay .pt-cut { stroke: var(--pt-rust); stroke-width: 1.2; stroke-dasharray: 6 5; }

/* ================================================================ LAND SIDE
   A quiet reading frame after the chart: the words in one column, the photograph
   beside them, the whole section within one desktop view. */
.pt-land { padding-block: clamp(3rem, 8svh, 5.5rem); background: var(--sx-paper); border-top: 1px solid var(--pt-hair); }
.pt-land__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 4.5vw, 5rem); align-items: stretch; }
.pt-land__title { font-size: clamp(2rem, 1.2rem + 1.9vw, 3.3rem); font-weight: 650; font-stretch: 118%; letter-spacing: -.04em; line-height: .98; text-wrap: balance; max-width: 16ch; }
.pt-land__lede { max-width: 48ch; margin-top: 1rem; font-size: var(--sx-t-lede); line-height: 1.45; }
.pt-land__list { margin-top: clamp(1.4rem, 3.5svh, 2.2rem); border-top: 1px solid var(--pt-hair); }
.pt-land__list li { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: .3rem 1.6rem; padding-block: .95rem; border-bottom: 1px solid var(--pt-hair); }
.pt-land__list h3 { font-size: 1.12rem; font-weight: 600; font-stretch: 112%; letter-spacing: -.015em; line-height: 1.25; }
.pt-land__where { margin-top: .2rem; font-family: var(--sx-mono); font-size: .72rem; color: var(--pt-steel); }
.pt-land__list li > p { line-height: 1.5; }
.pt-land__end { margin-top: 1.2rem; max-width: 60ch; color: var(--pt-steel); }
.pt-land__end a { color: var(--pt-ink); text-underline-offset: 3px; }
.pt-land__photo { display: flex; flex-direction: column; margin: 0; min-height: 0; }
.pt-land__photo picture { flex: 1; min-height: 18rem; }
.pt-land__photo img { width: 100%; height: 100%; object-fit: cover; filter: var(--sx-grade); }
.pt-land__photo figcaption { margin-top: .7rem; font-family: var(--sx-mono); font-size: .7rem; color: var(--pt-steel); }
@media (max-width: 1080px) { .pt-land__list li { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .pt-land { padding-block: 3.5rem; }
  .pt-land__grid { grid-template-columns: 1fr; }
  .pt-land__photo picture { flex: none; min-height: 0; }
  .pt-land__photo img { height: auto; aspect-ratio: 4 / 3; }
}

/* ================================================================ SOURCES
   The chart's sources, quietly, where the chart ends. Never inside the motion. */
.pt-sources {
  display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 2rem; flex-wrap: wrap;
  max-width: var(--sx-maxw); margin-inline: auto; padding: 0 var(--sx-gutter) 2.5rem;
  font-size: .76rem; line-height: 1.5; color: var(--pt-steel);
}
.pt-sources p:first-child { max-width: 78ch; }
.pt-sources a { color: inherit; text-underline-offset: 2px; }
html.pt-on-live .pt-sources { padding-top: 1.2rem; }
