/* World in Motion — engraved plates on paper (Day edition) or ink (Night edition). */

@font-face { font-family: Go; src: url(fonts/Go-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Go; src: url(fonts/Go-Italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Go; src: url(fonts/Go-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Go; src: url(fonts/Go-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Go Smallcaps"; src: url(fonts/Go-Smallcaps.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Go Mono"; src: url(fonts/Go-Mono.woff2) format("woff2"); font-display: swap; }

:root {
  --paper: #efe9dc; --paper-2: #e6dfcd; --ink: #1b1a17; --ink-2: #47433b; --muted: #736c5e;
  --rule: rgba(27, 26, 23, .82); --hair: rgba(27, 26, 23, .16); --accent: #b5361d;
  --grain: .55;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  --sans: Go, "Segoe UI", system-ui, sans-serif;
  --caps: "Go Smallcaps", Go, system-ui, sans-serif;
  --mono: "Go Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: clamp(16px, 3.4vw, 44px);
  --max: 1360px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-edition="day"]) {
    --paper: #111214; --paper-2: #18191c; --ink: #e9e2d2; --ink-2: #c3bba9; --muted: #8d8778;
    --rule: rgba(233, 226, 210, .7); --hair: rgba(233, 226, 210, .13); --accent: #ff7a57; --grain: .25; color-scheme: dark;
  }
}
:root[data-edition="night"] {
  --paper: #111214; --paper-2: #18191c; --ink: #e9e2d2; --ink-2: #c3bba9; --muted: #8d8778;
  --rule: rgba(233, 226, 210, .7); --hair: rgba(233, 226, 210, .13); --accent: #ff7a57; --grain: .25; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before { /* paper grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: var(--grain); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-edition="night"] body::before { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-edition="day"]) body::before { mix-blend-mode: screen; } }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--paper); }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.smallcaps { font-family: var(--caps); font-weight: 400; letter-spacing: .07em; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ink); color: var(--paper); padding: 8px 14px; }
.skip:focus { left: 8px; }

/* ---------- Masthead ---------- */
.masthead { padding-top: clamp(12px, 2vw, 22px); }
.folio {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--caps); font-size: 13px; letter-spacing: .08em; color: var(--ink-2);
  border-bottom: 1px solid var(--rule); padding-bottom: 9px;
}
.folio__live .mono { font-size: 12.5px; letter-spacing: 0; color: var(--ink); }
.edition { font: inherit; letter-spacing: inherit; color: var(--muted); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.edition span { transition: color .2s; }
.edition__sep { margin: 0 .4em; opacity: .5; }
.edition__day { color: var(--ink); }
:root[data-edition="night"] .edition__day { color: var(--muted); }
:root[data-edition="night"] .edition__night { color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-edition]) .edition__day { color: var(--muted); }
  :root:not([data-edition]) .edition__night { color: var(--ink); }
}
.edition:hover span { color: var(--accent); }
.wordmark {
  margin: clamp(8px, 1.6vw, 18px) 0 0; text-align: center;
  font: 400 clamp(36px, 8.4vw, 118px)/.9 var(--serif); letter-spacing: -.025em; padding-bottom: .08em;
}
.wordmark__in { font-style: italic; font-size: .5em; margin: 0 .04em; letter-spacing: 0; color: var(--accent); }
.dek {
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  margin-top: clamp(10px, 1.4vw, 16px); padding: 8px 0 7px;
  border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--caps); font-size: 13px; letter-spacing: .07em; color: var(--ink-2);
}
.dek p { margin: 0; }

/* ---------- Stage: the Earth now, beside the instruments ---------- */
.stage {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 3.4vw, 56px);
  padding-block: clamp(22px, 3vw, 40px) clamp(48px, 6vw, 88px); align-items: start;
}
.stage__globe { margin: 0; position: sticky; top: 12px; }
.globe-canvas { display: block; width: 100%; aspect-ratio: 1; cursor: grab; touch-action: pan-y; }
.globe-canvas:active { cursor: grabbing; }
.readout {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 6px;
  font-size: 12.5px; color: var(--ink-2); text-align: center;
}

.atlas { display: grid; gap: clamp(28px, 3.4vw, 48px); }
.chapter__h {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
  font: italic 400 clamp(24px, 2.4vw, 32px)/1.1 var(--serif); letter-spacing: -.01em;
}
.chapter__n { font: 400 .62em/1 var(--caps); font-style: normal; letter-spacing: .1em; color: var(--accent); }
.plates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 24px); }
.card__a {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "plate plate" "n t" ". l" ". live";
  gap: 0 10px; padding: 10px 10px 14px; text-decoration: none; color: inherit; height: 100%;
  border: 1px solid var(--hair); outline: 1px solid var(--hair); outline-offset: -5px; /* a double plate border */
  transition: border-color .3s, background-color .3s;
}
.card__a:hover { color: inherit; border-color: var(--rule); background: color-mix(in srgb, var(--paper-2) 55%, transparent); }
.card__plate { grid-area: plate; display: block; aspect-ratio: 5 / 4; margin-bottom: 8px; }
.card__plate canvas { display: block; width: 100%; height: 100%; }
.card__n { grid-area: n; font-family: var(--caps); font-size: 12.5px; letter-spacing: .06em; color: var(--accent); align-self: baseline; }
.card__t { grid-area: t; font: 400 clamp(19px, 1.6vw, 23px)/1.15 var(--serif); letter-spacing: -.005em; align-self: baseline; transition: color .2s; }
.card__l { grid-area: l; font-size: 14px; color: var(--ink-2); margin-top: 3px; }
.card__live { grid-area: live; font-size: 12px; color: var(--muted); margin-top: 6px; }
.card__a:hover .card__t, .card__a:focus-visible .card__t { color: var(--accent); font-style: italic; }
.card--tool .card__plate { aspect-ratio: 5 / 3; }
.card--feature { grid-column: 1 / -1; }
.card--feature .card__a { grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1fr); grid-template-areas: "plate n t" "plate . l" "plate . live"; grid-template-rows: auto auto 1fr; align-items: start; column-gap: 12px; }
.card--feature .card__plate { margin: 0 12px 0 0; }
.card--feature .card__n { margin-top: 22%; }
.card--feature .card__t { margin-top: 22%; font-size: clamp(26px, 2.6vw, 36px); }
.card--feature .card__l { font-size: 16px; }
@media (max-width: 620px) {
  .card--feature .card__a { grid-template-columns: 1fr; grid-template-areas: "plate" "n" "t" "l" "live"; }
  .card--feature .card__n, .card--feature .card__t { margin-top: 0; }
}
.card--soon .card__a { cursor: default; border-style: dashed; outline-style: dashed; }
.card--soon .card__a:hover { background: none; border-color: var(--hair); }
.card--soon .card__a:hover .card__t { color: inherit; font-style: normal; }
.card--soon .card__plate { opacity: .82; }
.card--soon .card__n { color: var(--muted); }
.card__soon { grid-column: 2; justify-self: start; margin-top: 8px; font: 400 11.5px/1 var(--caps); letter-spacing: .1em; color: var(--accent); border: 1px solid currentColor; padding: 4px 7px 3px; }
@media (max-width: 620px) { .card__soon { grid-column: 1; } }

/* ---------- Ledger ---------- */
.ledger { border-top: 3px double var(--rule); padding-block: clamp(32px, 5vw, 64px); }
.ledger__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 32px; flex-wrap: wrap; margin-bottom: 18px; }
.ledger__head h2 { font: italic 400 clamp(28px, 3vw, 40px)/1 var(--serif); margin: 0; letter-spacing: -.01em; }
.ledger__head p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 46em; }
.ledger__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ledger table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--hair); }
.ledger thead th { font-family: var(--caps); font-weight: 400; letter-spacing: .07em; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--rule); }
.ledger tbody th { font: 400 17px/1.3 var(--serif); white-space: nowrap; }
.ledger tbody th a { text-decoration: none; }
.ledger td { color: var(--ink-2); }

/* ---------- Keeper & footer ---------- */
.keeper { padding-bottom: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 8px 32px; }
.keeper h2 { font-size: 13px; color: var(--accent); margin: 4px 0 0; }
.keeper p { margin: 0; font: 400 clamp(18px, 1.6vw, 21px)/1.5 var(--serif); color: var(--ink-2); max-width: 44em; }
.keeper a { white-space: nowrap; }
.disclaimer p { font: 400 15px/1.6 var(--sans); max-width: 60em; }
.footer { border-top: 1px solid var(--rule); padding-block: 18px 40px; text-align: center; }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; font: 400 16px/1.6 var(--serif); }
.footer__nav a { text-decoration: none; color: var(--ink-2); }
.footer__nav a:hover { color: var(--accent); font-style: italic; }
.footer__fine { margin: 12px auto 0; font-size: 12.5px; color: var(--muted); max-width: 60em; }

/* ---------- Portal into an instrument ---------- */
.portal { position: fixed; z-index: 300; overflow: hidden; background: var(--paper); transition: inset .65s cubic-bezier(.7,0,.2,1), background-color .5s .25s; }
.portal.is-open { background: var(--env, #000); }
.portal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.portal__plate { transition: opacity .35s .2s, transform .8s cubic-bezier(.2,.7,.2,1); }
.portal.is-open .portal__plate { opacity: 0; transform: scale(1.3); }
.portal__shot { object-fit: cover !important; opacity: 0; transition: opacity .4s .5s; }
.portal.is-open .portal__shot { opacity: .35; }
.portal__label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%); opacity: 0; text-align: center; white-space: nowrap;
  color: #f1ead9; font: italic 400 clamp(28px, 4vw, 52px)/1.1 var(--serif); transition: opacity .35s .4s, transform .6s .4s cubic-bezier(.2,.7,.2,1);
}
.portal__label small { display: block; font: 400 13px/1.4 var(--caps); letter-spacing: .14em; opacity: .7; margin-top: 10px; font-style: normal; }
.portal.is-open .portal__label { opacity: 1; transform: translate(-50%, -50%); }

@media (prefers-reduced-motion: reduce) { .portal, .portal * { transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stage { grid-template-columns: 1fr; }
  .stage__globe { position: static; max-width: 620px; margin-inline: auto; width: 100%; }
}
@media (max-width: 620px) {
  .folio { font-size: 11px; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
  .folio__vol { display: none; }
  .folio__live { order: 2; width: 100%; text-align: center; }
  .dek { justify-content: center; text-align: center; font-size: 11.5px; }
  .plates { gap: 10px; }
  .card__a { padding: 6px 6px 10px; grid-template-columns: 1fr; grid-template-areas: "plate" "n" "t" "l" "live"; }
  .card__t { font-size: 18px; }
  .card__l { font-size: 12.5px; }
  .keeper { grid-template-columns: 1fr; }
}

/* One-time privacy note: says what the site does not do; never blocks the page */
.notice {
  position: fixed; z-index: 150; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(620px, calc(100vw - 2 * var(--gutter))); display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 16px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45); font-size: 14px; line-height: 1.45;
}
.notice[hidden] { display: none; }
.notice p { margin: 0; flex: 1; }
.notice b { color: var(--ink); font-weight: 600; }
.notice button {
  flex: none; font: 600 14px var(--sans); color: var(--paper); background: var(--ink); border: 0; padding: 8px 16px; min-height: 40px; cursor: pointer;
}
.notice button:hover { background: var(--accent); }
