/* About: the Path drawn on a globe, in the garden plan's hand (D038). Tokens, masthead, the title,
   the lede, labels and the drawing's roles (.dw) come from site.css. Blue is for data only: here
   the Path, which is what moves. */

:root {
  --slot-h: clamp(250px, 40svh, 330px);
  --gutter: 112px;
  --col: 100%;
  --row-h: 60svh;
}
/* Each stop holds the screen for about two thirds of its height: long enough for the globe's flight, short
   enough that the Path does not outstay the reader (was 88svh, 2026-11-06). */
@media (min-width: 900px) { :root { --col: min(580px, 42vw); --row-h: 64svh; } }

/* layout: one column; on desktop the globe's stage sticks beside all of it */
.col { padding: var(--page-top) var(--margin) 120px; }
@media (min-width: 900px) {
  .about {
    display: grid;
    grid-template-columns: calc(var(--col) + var(--margin)) minmax(0, 1fr);
    column-gap: 32px;
  }
  .col { padding: var(--page-top) 0 160px var(--margin); }
  .about > .stage { position: sticky; top: 0; height: 100svh; align-self: start; }
}

/* blocks: a mono label, then the content; on desktop the label takes a gutter */
.block { margin-top: 64px; }
.block > .label { margin-bottom: 14px; }
@media (min-width: 900px) {
  .block { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); column-gap: 24px; margin-top: 88px; }
  .block > .label { margin: 6px 0 0; }
}

.lines { display: grid; gap: 14px; }
.lines > * { margin: 0; font-size: 17px; line-height: 1.45; text-wrap: pretty; }
@media (min-width: 900px) { .lines > * { font-size: 19px; } }

/* path: rows newest first, each a chapter of the globe's story (a flight at every boundary) */
.timeline { position: relative; display: grid; grid-template-columns: 9px minmax(0, 1fr); column-gap: 16px; }
@media (min-width: 900px) {
  .path .timeline { grid-column: 1 / -1; grid-template-columns: var(--gutter) minmax(0, 1fr); column-gap: 24px; margin-top: 18px; }
}
.rail { position: relative; grid-column: 1; grid-row: 1; justify-self: end; width: 1px; height: 100%; }
.rail-line, .rail-fill { position: absolute; inset: 0; }
.rail-line { background: var(--hair); }
.rail-fill { background: var(--line); opacity: 0.55; transform-origin: top; transform: scaleY(0); will-change: transform; }
.rail-ticks .tick-start { position: absolute; left: 0; width: 13px; height: 1px; background: rgba(var(--line-rgb), 0.5); }
.rail-head { position: absolute; left: 0; top: 0; will-change: transform; }
.rail-head::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 6px 1px var(--glow), 0 0 18px 2px color-mix(in srgb, var(--glow) 40%, transparent);
}
/* On the light page a glow of ink reads as a smudge: the dot takes its weight by size and Ink, and a
   ring of the page parts it from the rail, a bead on its thread. */
:root[data-theme="light"] .rail-head::before { left: -4px; top: -4px; width: 9px; height: 9px; box-shadow: 0 0 0 2px var(--ground); }
.year-now {
  font-family: var(--font-label);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.rail-head .year-now { position: absolute; right: 14px; top: -8px; display: none; }
@media (min-width: 900px) { .rail-head .year-now { display: block; } }
.stage-year { display: none; }

.rows { grid-column: 2; grid-row: 1; }
.row { position: relative; min-height: var(--row-h); padding-bottom: 36px; }
/* A row's words stay in view while its years scroll past, then the next row takes over. */
.row-in { position: sticky; top: calc(var(--header-h) + var(--slot-h) + 52px); }
@media (min-width: 900px) { .row-in { top: calc(50svh - 72px); } }
.when { display: flex; gap: 14px; font-family: var(--font-label); font-size: 11px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.where { transition: color 400ms var(--ease); }
.value {
  margin-top: 10px;
  max-width: 21em;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 350;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  text-wrap: pretty;
  transition: color 400ms var(--ease);
}
@media (min-width: 900px) { .value { font-size: 23px; font-weight: 330; } }
.who { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }
.row .value { color: color-mix(in oklab, var(--ink) 72%, var(--ground)); }
.row.is-on .where, .row.is-on .value { color: var(--ink); }

/* the replay: the path oldest first, each place lit as the globe's pulse reaches it */
.replay { position: relative; min-height: calc(var(--row-h) * 1.45); padding-bottom: 36px; }
@media (min-width: 900px) { .replay { grid-column: 1 / -1; margin-left: calc(var(--gutter) + 24px); } }
@media (max-width: 899.98px) { .replay { margin-left: 25px; } }
.replay-in { position: sticky; top: calc(var(--header-h) + var(--slot-h) + 52px); }
@media (min-width: 900px) { .replay-in { top: calc(50svh - 72px); } }
.replay-route { margin-top: 10px; display: flex; flex-wrap: wrap; column-gap: 0.5em; row-gap: 2px; max-width: 21em; font-size: 19px; line-height: 1.3; font-weight: 350; letter-spacing: -0.01em; }
@media (min-width: 900px) { .replay-route { font-size: 23px; font-weight: 330; } }
.replay-route li { color: var(--ink-2); transition: color 500ms var(--ease); white-space: nowrap; }
.replay-route li + li::before { content: "→"; margin-right: 0.5em; color: color-mix(in oklab, var(--ink) 30%, var(--ground)); }
.replay-route li.is-on { color: var(--ink); }
.no-js .replay-route li, .no-scene .replay-route li { color: var(--ink); }

/* phone: the globe sits above the rows and stays in view while they scroll */
.slot { display: none; }
@media (max-width: 899.98px) {
  .slot {
    display: block;
    position: sticky;
    top: var(--header-h);
    z-index: 3;
    height: var(--slot-h);
    margin: 0 calc(-1 * var(--margin)) 18px;
    background: var(--ground);
  }
  .slot::after {
    content: "";
    position: absolute;
    inset: 100% 0 auto 0;
    height: 64px;
    background: linear-gradient(var(--ground) 62%, rgba(var(--ground-rgb), 0));
    pointer-events: none;
  }
  .slot > .stage { position: relative; width: 100%; height: 100%; }
}

/* the stage: the globe drawn as a plan (assets/js/about/globe.js), a live SVG that fades within
   34 px of every edge, as the ground does, and the name of the place in view beside it. */
.stage { overflow: hidden; background: var(--ground); }
:is(.no-scene, .no-js) :is(.stage, .slot) { display: none; }
.stage svg.mk-globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 8px, #000 40px, #000 calc(100% - 40px), transparent calc(100% - 8px)), linear-gradient(to bottom, transparent 8px, #000 40px, #000 calc(100% - 40px), transparent calc(100% - 8px));
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 8px, #000 40px, #000 calc(100% - 40px), transparent calc(100% - 8px)), linear-gradient(to bottom, transparent 8px, #000 40px, #000 calc(100% - 40px), transparent calc(100% - 8px));
  mask-composite: intersect;
}
/* once the pen has drawn it, strokes drawn again as the globe turns appear at once */
.js .dw.pen.drawn > * { opacity: 1; transition: none; }
.mk-globe .land { fill: url(#mkHatch); stroke: none; }
.mk-globe .hatch-line { --k: 0.3; stroke-width: 0.6; }
.mk-globe .grid { --k: 0.09; stroke-width: 0.5; }
/* the country in view: a heavier outline and a denser warm hatch (one subject; never blue) */
.mk-globe .here { --k: 0.72; stroke-width: 1.35; }
.mk-globe .here-fill { fill: url(#mkHere); stroke: none; }
.mk-globe .here-line { --k: 0.3; stroke-width: 0.6; }
.mk-globe .mk-patch-warm { fill: url(#mkWarm); stroke: none; }
.mk-globe .warm-line { --k: 0.45; stroke-width: 0.6; }
.mk-globe .mk-patch { fill: url(#mkPatch); stroke: none; }
.mk-globe .patch-line { stroke: var(--accent); --k: 0.3; stroke-width: 0.6; }
/* the Path as a fibre: a faint sheath round a fine core; light runs through it in packets */
.mk-globe .mk-fiber { stroke: var(--accent); stroke-opacity: 0.1; stroke-width: 5; }
.mk-globe .mk-fiber.lead { stroke-opacity: 0.16; stroke-width: 7; }
.mk-globe .mk-path { --k: 0.75; stroke-width: 1.1; }
.mk-globe .mk-path.lead { --k: 0.95; stroke-width: 1.8; }
.mk-globe .mk-light path { stroke: var(--accent); stroke-opacity: 1; }
.mk-globe .mk-light .tail { stroke-width: 2; }
.mk-globe .mk-light .body { stroke-width: 2.6; }
.mk-globe .mk-light .head { stroke: var(--ink); stroke-width: 1.6; }
/* Light: lines of ink on the bone page, one step heavier than the dark's lines of light (site.css,
   --ink-gain). On the globe the blue must stay the strongest thing drawn, and the light blue at its
   full strength stands only 4:1 from bone, so in light the Path is drawn at full strength and wider,
   and the ink it crosses is held back: the countries' outlines below the blue, the graticule at the
   dark's strength (more reads as graph paper) and the land's hatch a little above it. The fibre's
   sheath is added light and has no place on bone. The light running through the core shows by
   weight and by its white: the full blue swells round it as it passes, with a fine head of the
   page's white inside (a pale packet alone reads as a break in the line, a dark one as dirt). The marks of the places are lighter, or the one in view becomes a dark
   knot round its bead. */
:root[data-theme="light"] .mk-globe .outline { --ink-gain: 1; }
:root[data-theme="light"] .mk-globe .here { --ink-gain: 0.8; }
:root[data-theme="light"] .mk-globe .grid { --ink-gain: 1; }
:root[data-theme="light"] .mk-globe .hatch-line { --ink-gain: 1.15; }
:root[data-theme="light"] .mk-globe .warm-line { --k: 0.3; }
:root[data-theme="light"] .mk-globe .mk-fiber { stroke-opacity: 0; }
:root[data-theme="light"] .mk-globe .mk-path { --k: 0.75; stroke-width: 1.5; }
:root[data-theme="light"] .mk-globe .mk-path.lead { --k: 0.95; stroke-width: 2.4; }
:root[data-theme="light"] .mk-globe .mk-light .tail { stroke-width: 2.4; }
:root[data-theme="light"] .mk-globe .mk-light .body { stroke-width: 3.4; }
:root[data-theme="light"] .mk-globe .mk-light .head { stroke: var(--ground); stroke-width: 1.2; }
:root[data-theme="light"] .mk-globe .mk-here > * { --ink-gain: 0.75; }
/* the places: stones in plan (default), stones in raked rings, where the light lands, or a cross */
.mk-globe .mk-stone { fill: var(--line); fill-opacity: 0.6; stroke: none; }
.mk-globe .mk-stone.main { fill-opacity: 0.95; }
.mk-globe .mk-bead { fill: var(--accent); stroke: none; transition: opacity 200ms var(--ease); }
.mk-globe .mk-pulse { stroke: var(--accent); stroke-width: 1; stroke-opacity: 1; fill: none; }

/* the name of the place in view: Plex Mono 11 px, the place in Ink and its years in Ink 2, on a
   soft patch of the ground so the map's lines never cut the letters */
.names { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.mk-name {
  position: absolute;
  left: 0;
  top: 0;
  isolation: isolate;
  display: grid;
  gap: 2px;
  font: 400 11px/1.25 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
  text-shadow: 0 0 1px var(--ground), 0 0 2px var(--ground), 0 0 3px var(--ground), 0 0 6px var(--ground);
  pointer-events: none;
  will-change: transform;
}
.mk-name::before { content: ""; position: absolute; inset: -4px -8px; z-index: -1; background: radial-gradient(closest-side, rgba(var(--ground-rgb), 0.55) 60%, rgba(var(--ground-rgb), 0)); filter: blur(2px); }
/* On bone the map's ink lines show through a patch at the dark's strength, under the years in Ink 2:
   the patch is fuller there, so every name keeps 4.5:1 at its dimmest. */
:root[data-theme="light"] .mk-name::before { background: radial-gradient(closest-side, rgba(var(--ground-rgb), 0.95) 75%, rgba(var(--ground-rgb), 0)); }
.mk-name > span:first-child { color: var(--ink); }
.globe-name { transition: opacity 400ms var(--ease); }
.globe-name.at-right { transform: translate(4px, -50%); text-align: left; justify-items: start; }
.globe-name.at-left { transform: translate(calc(-100% - 4px), -50%); text-align: right; justify-items: end; }

/* desktop: a row points to its place; the pointer says so */
@media (hover: hover) and (min-width: 900px) {
  .row-in { cursor: default; }
  .row:hover .where, .row:hover .value { color: var(--ink); }
}

/* drawn to, contact */
.anchors { border-top: 1px solid var(--hair); }
.anchors li { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 18px; row-gap: 3px; padding: 18px 0 20px; border-bottom: 1px solid var(--hair); }
/* the marks in the garden plan's hand: they draw in the pen's order as the block arrives */
.anchors .glyph { grid-row: 1 / span 2; width: 40px; height: 40px; overflow: visible; }
.anchors .name, .anchors .why { grid-column: 2; }
.js .glyph-plan > * { opacity: 0; }
.js .drawn.is-in .glyph-plan > * { opacity: 1; transition: opacity 600ms var(--ease) calc(300ms + var(--o, 0) * 1400ms); }
.js .drawn.is-in .anchors li:nth-child(2) .glyph-plan > * { transition-delay: calc(500ms + var(--o, 0) * 1400ms); }
.js .drawn.is-in .anchors li:nth-child(3) .glyph-plan > * { transition-delay: calc(700ms + var(--o, 0) * 1400ms); }
.anchors .name { font-size: 18px; line-height: 1.35; font-weight: 420; }
.anchors .why { font-size: 15.5px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
@media (min-width: 900px) { .drawn .label { margin-top: 16px; } .anchors .name { font-size: 19px; } }


@media (min-width: 900px) { .contact { display: block; padding-left: calc(var(--gutter) + 24px); } }

/* Phones: the masthead is solid, so the time rail never shows through it above the globe. */
@media (max-width: 899.98px) { .masthead, .masthead.is-scrolled { background: var(--ground); } }

/* Facts counted from the Path: four numbers under the lede. */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; margin: 48px 0 0; padding: 22px 0 0; border-top: 1px solid var(--hair); }
.facts div { display: flex; flex-direction: column; gap: 8px; }
.facts dd { order: -1; }
.facts dt { min-height: 2.7em; text-wrap: balance; font-family: var(--font-label); font-size: 11px; line-height: 1.35; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.facts dd { margin: 0; font-size: 40px; line-height: 1; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .facts { column-gap: 24px; margin-top: 64px; } .facts dd { font-size: 48px; } }
/* a mark under each number, drawn from it (assets/js/about/marks.js) */
.facts .fact-mark { order: -1; width: 120px; height: 16px; margin: 2px 0 0; overflow: visible; }
.js .facts .fact-mark > * { opacity: 0; }
.js .facts > div.is-in .fact-mark > *, .js .facts.is-in .fact-mark > * { opacity: 1; transition: opacity 500ms var(--ease) calc(200ms + var(--o, 0) * 1200ms); }
@media (prefers-reduced-motion: reduce) { .js .glyph-plan > *, .js .facts .fact-mark > * { opacity: 1; transition: none; } }


/* portrait: the cut-out print beside the introduction. On desktop it shares the globe's stage and
   hands it over as the Path comes up; on a phone it stands above the title. portrait.js draws it,
   crumples it and keeps the still (shown before it is live and with reduced motion) in its place. */
.portrait { position: relative; margin: 0; pointer-events: none; }
.portrait canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.portrait .still {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: var(--sheet, min(94%, 560px));
  height: auto;
  transform: translateX(calc(-50% + var(--dx, 0px)));
}
.portrait.is-live .still { visibility: hidden; }
/* In light the print's foot is its black shirt, so on a phone it cannot stand on the dark title: the
   title sits just below it instead; and its edges show, so it goes to the screen's edges. */
:root[data-theme="light"] { --portrait-foot: 14px; --portrait-w: 100vw; }
@media (max-width: 899px) {
  /* Just under the masthead, its foot tucked 10vw under the title so the print stands on the words. */
  .portrait { height: calc(min(var(--portrait-w, 94vw), 560px) * 0.967 + 8px); margin: calc(var(--header-h) + 12px + env(safe-area-inset-top)) 0 var(--portrait-foot, -10vw); }
  .about.has-portrait > .col { padding-top: 0; }
}
@media (min-width: 900px) {
  .about.has-portrait > .col { grid-column: 1; grid-row: 1; }
  .about.has-portrait > .stage { grid-column: 2; grid-row: 1; }
  .portrait { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100svh; align-self: start; z-index: 1; }
  .portrait .still { width: var(--sheet, min(90%, calc((100svh - 112px) / 0.967))); }
  /* The globe waits for the hand-off; portrait.js sets the stage's opacity as the Path comes up. */
  .js .about.has-portrait > .stage { opacity: 0; }
  /* The introduction fills the first screen, so the crumple has room before the Path begins. */
  .about.has-portrait .practice { margin-top: max(88px, calc(100svh - 560px)); }
  /* and the globe's first turn waits until the ball has grown into it. */
  .about.has-portrait .path { margin-top: 160px; }
}
/* The print rises out of the ground on arrival. */
@media (prefers-reduced-motion: no-preference) {
  .js .portrait { animation: portrait-rise 1.1s var(--ease) both; }
}
@keyframes portrait-rise { from { opacity: 0; transform: translateY(24px); } }

/* Without the globe (no WebGL, no JavaScript) the Path is a plain list: no room is held for flights. */
:is(.no-scene, .no-js) :is(.row, .replay) { min-height: 0; padding-bottom: 28px; }
:is(.no-scene, .no-js) :is(.row-in, .replay-in) { position: static; }
