/* Seorang Indonesia, staged site (#17).
   Visual direction: a statistical atlas sheet, not a dashboard. Sharp corners,
   hairline rules, one vermilion accent, data in mono, the Story in a reading serif.
   The map plate and the chart are the two images; everything else is typography. */

:root {
  --paper: #f2f0e9;
  --sheet: #eae7dc;
  --ink: #171a18;
  --muted: #5b605a;
  --faint: #676c64;
  --rule: #d3d0c5;
  --rule-soft: #e2dfd4;
  --accent: #b7351f;
  --accent-ink: #fffaf4;
  --accent-soft: #e7c9bf;
  --map-0: #d8d2c1;
  --map-1: #bcb6a7;
  --map-2: #a29c8d;
  --map-3: #888275;
  --map-4: #6e695d;
  --shadow: 0 18px 50px rgb(20 22 20 / 0.08);
  --avatar-skin: #d7ad85;
  --avatar-skin-shadow: #b98762;
  --avatar-hair-old: #736e64;
  --avatar-hair: #171a18;
  --avatar-shirt: #171a18;
  --avatar-detail: #f2f0e9;
  --avatar-streak: #f2f0e9;
  --avatar-face-line: #4a2e1e;
  --avatar-shadow: rgb(23 26 24 / 0.2);
  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101311;
    --sheet: #171b18;
    --ink: #ece9df;
    --muted: #a6aba3;
    --faint: #8a9088;
    --rule: #2c312c;
    --rule-soft: #232823;
    --accent: #ff7455;
    --accent-ink: #101311;
    --accent-soft: #5b2c22;
    --map-0: #1c211d;
    --map-1: #2a302a;
    --map-2: #3a4038;
    --map-3: #4d5349;
    --map-4: #646a5f;
    --shadow: 0 18px 50px rgb(0 0 0 / 0.35);
    --avatar-skin: #c0926c;
    --avatar-skin-shadow: #986b4c;
    --avatar-hair-old: #b3ada0;
    --avatar-hair: #8c877b;
    --avatar-shirt: #343a34;
    --avatar-detail: #cfc9bb;
    --avatar-streak: #e6e1d4;
    --avatar-face-line: #4a2e1e;
    --avatar-shadow: rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; }

button, input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

img, svg { max-width: 100%; }

.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;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  font-size: 13px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(100% - 48px, 1280px);
  margin-inline: auto;
}

/* Header ------------------------------------------------------------------ */

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, 1280px);
  margin-inline: auto;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.brand-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 2px 5px;
  line-height: 1.2;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.lang {
  display: flex;
  align-items: center;
  border-left: 1px solid var(--rule);
  padding-left: 14px;
}

.lang button {
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 4px 6px;
  min-height: 32px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--ink);
}

.gallery-btn {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  padding: 5px 0;
  min-height: 32px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.gallery-btn:hover { border-color: var(--accent); color: var(--accent); }
.gallery-btn .count { color: var(--muted); margin-left: 3px; }
.gallery-label.short { display: none; }

/* Type -------------------------------------------------------------------- */

.kicker {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.97;
  text-wrap: balance;
}

.hero h1 { font-size: clamp(46px, 6.6vw, 88px); }

.hero-sub {
  font-size: 17px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 31ch;
  margin: 0 0 22px;
  text-wrap: pretty;
}

#hero-method { display: none; }
@media (max-width: 720px) {
  #hero-method { display: inline; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.ghost { border-color: var(--rule); }

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.btn:disabled:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

.btn:focus-visible,
.link:focus-visible,
.gallery-btn:focus-visible,
.lang button:focus-visible,
.progress button:focus-visible,
.close:focus-visible,
.province:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--rule);
  cursor: pointer;
}
.link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Hero -------------------------------------------------------------------- */

.hero {
  min-height: calc(100dvh - 65px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 38px;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 4fr);
  gap: 48px;
  align-items: end;
}

.hero-copy { animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }

.hero-side {
  padding-bottom: 8px;
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.hero-plate {
  margin: 36px 0 0;
  animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}

.plate-map {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 8px 0 4px;
  height: min(38vh, 410px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.plate-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.plate-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.plate-credit { text-transform: none; letter-spacing: 0; }

.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  border-top: 1px solid var(--rule);
  padding: 13px 0 17px;
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--muted);
}
.chain b { color: var(--ink); font-weight: 500; }
.chain-step { white-space: nowrap; }
.chain .arrow { color: var(--accent); }
.chain-note {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Map --------------------------------------------------------------------- */

.province {
  fill: var(--map-0);
  stroke: var(--paper);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
  transition: fill 0.2s ease;
}
.province[data-step="1"] { fill: var(--map-1); }
.province[data-step="2"] { fill: var(--map-2); }
.province[data-step="3"] { fill: var(--map-3); }
.province[data-step="4"] { fill: var(--map-4); }
.province.is-on {
  fill: var(--accent);
  stroke: var(--ink);
  stroke-width: 1.4;
}
.province:hover { fill: var(--map-2); }
.province.is-on:hover { fill: var(--accent); }
.graticule line {
  stroke: var(--rule);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
  opacity: 0.65;
}

.map-sheet {
  border: 1px solid var(--rule);
  background: var(--sheet);
  padding: 16px 16px 10px;
}
.map-sheet svg { display: block; width: 100%; height: auto; }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  border-top: 1px solid var(--rule);
  margin-top: 8px;
  padding-top: 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.legend-scale { display: flex; align-items: center; gap: 4px; }
.legend-scale i {
  display: block;
  width: 18px;
  height: 8px;
  border: 1px solid var(--rule);
  background: var(--map-0);
}
.legend-scale i[data-step="1"] { background: var(--map-1); }
.legend-scale i[data-step="2"] { background: var(--map-2); }
.legend-scale i[data-step="3"] { background: var(--map-3); }
.legend-scale i[data-step="4"] { background: var(--map-4); }
.legend-scale span { margin: 0 3px; }
.legend-pick { display: inline-flex; align-items: center; gap: 5px; }
.legend-pick i {
  display: block;
  width: 10px;
  height: 8px;
  background: var(--accent);
}

/* Progress ---------------------------------------------------------------- */

.draw { padding-top: 26px; }

.progress {
  list-style: none;
  display: flex;
  margin: 0 0 28px;
  padding: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.progress li {
  flex: 1;
  min-width: 0;
  position: relative;
}
.progress li + li {
  border-left: 1px solid var(--rule);
  padding-left: 14px;
}

.progress button {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--faint);
  padding: 11px 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  cursor: default;
}
.progress .n { font-size: 9px; opacity: 0.7; }
.progress .done button { color: var(--ink); cursor: pointer; }
.progress .done button:hover .lbl { text-decoration: underline; text-underline-offset: 4px; }
.progress .active button { color: var(--accent); }
.progress .active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.progress .active::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 2px;
  width: 28px;
  background: var(--accent);
}

/* Stage ------------------------------------------------------------------- */

.stage-grid {
  display: grid;
  grid-template-columns: minmax(270px, 4fr) minmax(0, 8fr);
  gap: 56px;
  align-items: start;
}

.stage-rail {
  position: sticky;
  top: 88px;
  align-self: start;
  padding-bottom: 24px;
}

.stage-body { min-width: 0; }

.stage-body.enter { animation: stage-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

.big-year {
  font-size: clamp(88px, 11.6vw, 166px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.82;
  font-variant-numeric: tabular-nums;
  margin: 0 0 18px;
  white-space: nowrap;
}

.big-place {
  font-size: clamp(44px, 5.2vw, 76px);
  letter-spacing: -0.045em;
  line-height: 0.94;
  margin: 0 0 16px;
  text-wrap: balance;
}

.rail-lede {
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 28ch;
  margin: 0 0 18px;
  text-wrap: pretty;
}

.rail-note {
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  margin: 18px 0 22px;
  max-width: 34ch;
}

.rail-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-width: 300px;
}
.rail-actions .btn { width: 100%; }

/* Life mark --------------------------------------------------------------- */

.rail-mark {
  margin-bottom: 20px;
}
.rail-mark .mark-age,
.rail-mark .mark-age-cap,
.rail-mark .mark-edu,
.rail-mark .mark-occ,
.rail-mark .mark-labour,
.rail-mark .mark-province {
  transition: opacity 0.35s ease;
}
.rail-mark.focus-person .mark-occ,
.rail-mark.focus-person .mark-labour { opacity: 0.22; }
.rail-mark.focus-work .mark-age,
.rail-mark.focus-work .mark-age-cap,
.rail-mark.focus-work .mark-edu { opacity: 0.22; }
.rail-mark.focus-position .mark-age,
.rail-mark.focus-position .mark-age-cap,
.rail-mark.focus-position .mark-edu { opacity: 0.22; }
.rail-mark.focus-position .mark-year-dot { animation: mark-pulse 2.2s ease-in-out infinite; }
.rail-mark .life-mark-svg {
  width: 116px;
  height: 116px;
  display: block;
  overflow: visible;
}
.rail-mark-life .life-mark-svg { width: 128px; height: 128px; }
.rail-mark-story .life-mark-svg { width: 150px; height: 150px; }
.mark-caption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.mark-caption .link { font-size: 9px; }

.life-mark-svg { overflow: visible; }
.mark-ring { fill: none; stroke: var(--muted); stroke-opacity: 0.35; stroke-width: 0.8; }
.mark-tick {
  stroke: var(--muted);
  stroke-opacity: 0.45;
  stroke-width: 1;
  animation: mark-fade 0.35s both;
  animation-delay: 0s;
}
.mark-ticks .mark-tick:nth-child(3n) { animation-delay: 60ms; }
.mark-ticks .mark-tick:nth-child(3n + 1) { animation-delay: 120ms; }
.mark-tick.on { stroke: var(--accent); stroke-opacity: 1; stroke-width: 2.2; }
.mark-year-dot {
  fill: var(--accent);
  stroke: var(--paper);
  stroke-width: 1.2;
}
.mark-year {
  fill: var(--accent);
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.02em;
}
.mark-province { animation: mark-fade 0.5s 0.08s both; }
.mark-province path {
  fill: var(--map-1);
  stroke: var(--ink);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}
.mark-age {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: mark-draw 0.6s 0.12s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.mark-age-cap {
  stroke: var(--ink);
  stroke-width: 1.5;
  animation: mark-fade 0.3s 0.55s both;
}
.mark-edu rect {
  fill: var(--rule);
  animation: mark-fade 0.3s both;
  animation-delay: 0.22s;
}
.mark-edu rect:nth-child(2) { animation-delay: 0.26s; }
.mark-edu rect:nth-child(3) { animation-delay: 0.3s; }
.mark-edu rect:nth-child(4) { animation-delay: 0.34s; }
.mark-edu rect.on { fill: var(--ink); }
.mark-occ circle {
  fill: var(--map-3);
  opacity: 0.8;
  stroke: var(--paper);
  stroke-width: 1;
  animation: mark-fade 0.3s both;
  animation-delay: 0.3s;
}
.mark-occ circle:nth-child(3) { animation-delay: 0.33s; }
.mark-occ circle:nth-child(4) { animation-delay: 0.36s; }
.mark-occ circle:nth-child(5) { animation-delay: 0.39s; }
.mark-occ circle:nth-child(6) { animation-delay: 0.42s; }
.mark-occ circle:nth-child(7) { animation-delay: 0.45s; }
.mark-occ circle.on { fill: var(--accent); opacity: 1; }
.mark-occ .mark-occ-ring {
  fill: none;
  stroke: var(--rule);
  stroke-width: 0.7;
  stroke-dasharray: 1.5 3;
  opacity: 1;
  animation: mark-fade 0.4s 0.2s both;
}
.mark-labour-halo { fill: var(--paper); }
.mark-labour { animation: mark-fade 0.35s 0.45s both; }
.mark-labour.employed { fill: var(--accent); }
.mark-labour.unemployed { fill: none; stroke: var(--accent); stroke-width: 2; }
.mark-labour.outside { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }

@keyframes mark-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }

/* Mark dialog ------------------------------------------------------------- */

.mark-dialog { width: min(760px, calc(100vw - 32px)); }
#mark-body {
  padding: 22px 24px 26px;
  overflow: auto;
  max-height: calc(86dvh - 78px);
}
.mark-dialog-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.mark-large svg {
  width: 220px;
  height: 220px;
  display: block;
  overflow: visible;
}
.mark-lede {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.mark-legend { margin: 0; }
.mark-legend > div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
}
.mark-legend dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.mark-legend dd { margin: 0; font-size: 13px; line-height: 1.45; }
.mark-note {
  border-top: 1px solid var(--rule);
  margin: 18px 0 0;
  padding-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 54ch;
}

.life-head {
  font-size: clamp(38px, 4.7vw, 64px);
  letter-spacing: -0.045em;
  line-height: 0.98;
  margin: 0 0 12px;
}
.life-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}

/* Chart ------------------------------------------------------------------- */

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-top: 1px solid var(--ink);
  padding-top: 10px;
  margin-bottom: 4px;
}
.chart-title {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.chart-unit {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
}
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg .grid { stroke: var(--rule); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.chart-svg .axis { stroke: var(--ink); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.chart-svg .tick { fill: var(--muted); font-family: var(--mono); font-size: 9px; }
.chart-svg .stem { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-svg .dot { fill: var(--muted); }
.chart-svg .dot-on { fill: var(--accent); }
.chart-svg .ring { fill: none; stroke: var(--accent); stroke-width: 1; opacity: 0.45; }
.chart-svg .year-label {
  fill: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.source-line {
  border-top: 1px solid var(--rule);
  margin-top: 12px;
  padding-top: 9px;
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 78ch;
}
.source-line a { text-decoration: underline; text-underline-offset: 3px; }

/* Facts ------------------------------------------------------------------- */

.facts-lead {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 10px;
}

.fact-section h3 {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 26px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}

.facts { margin: 0; }

.fact {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 22px;
  padding: 13px 0 12px;
  border-bottom: 1px solid var(--rule-soft);
}

.fact dt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

.fact dd { margin: 0; min-width: 0; }

.fact-v {
  display: block;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.35;
}
.fact-v.long { font-weight: 400; max-width: 56ch; }

.fact-fig {
  display: block;
  margin-top: 5px;
  max-width: 58ch;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

.fig-label {
  border-top: 1px solid var(--rule);
  margin: 22px 0 0;
  padding-top: 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 62ch;
}

/* Life chapters ----------------------------------------------------------- */

.life-chapters {
  display: flex;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin: 0 0 24px;
}

.life-chapters button {
  appearance: none;
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.life-chapters button:last-child { border-right: 0; }
.life-chapters button:hover { color: var(--ink); background: var(--sheet); }
.life-chapters button.active {
  color: var(--ink);
  background: var(--sheet);
  box-shadow: inset 0 -3px 0 var(--accent);
}
.life-chapters .n {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
}
.life-chapters .l {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.life-panel { animation: life-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.life-view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 30px;
  align-items: start;
}

.life-visual {
  background: none;
  border: 0;
  padding: 0;
}
.life-visual svg { display: block; width: 100%; height: auto; }

.life-avatar {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--sheet);
}
.life-avatar .avatar-svg { display: block; width: 100%; height: auto; }
.life-avatar .avatar-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--sheet);
  animation: avatar-photo-in 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.avatar-caption {
  display: grid;
  gap: 3px;
  padding: 10px 12px 11px;
  border-top: 1px solid var(--rule);
}
.avatar-caption-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.avatar-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.avatar-title {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}
.avatar-title b { font-weight: 600; }
.avatar-role {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}
.avatar-note {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.45;
}

.position-stamp {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.position-stamp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.position-stamp-kicker {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.position-stamp-value {
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.9;
}
.position-stamp-note {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}
.position-stamp-group {
  margin: 5px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.4;
}
.position-stamp.is-empty .position-stamp-value { color: var(--muted); }

.life-copy { padding-top: 2px; }
.life-lead {
  margin: 0 0 12px;
  max-width: 54ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}
.life-note {
  margin: 16px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  max-width: 54ch;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.55;
}

.life-fact-list .fact {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  animation: plate-fade 0.4s both;
}
.life-fact-list .fact:nth-child(2) { animation-delay: 0.04s; }
.life-fact-list .fact:nth-child(3) { animation-delay: 0.08s; }
.life-fact-list .fact:nth-child(4) { animation-delay: 0.12s; }
.life-fact-list .fact:nth-child(5) { animation-delay: 0.16s; }
.life-fact-list .fact:nth-child(6) { animation-delay: 0.2s; }
.life-fact-list .fact dt { font-size: 9px; }
.life-fact-list .fact-v { font-size: 14px; }
.life-fact-list .fact-fig { margin-top: 3px; font-size: 11.5px; }

/* Avatar ------------------------------------------------------------------ */

.avatar-bg { fill: var(--sheet); }
.avatar-grid line {
  stroke: var(--rule);
  stroke-width: 0.8;
  opacity: 0.55;
}
.avatar-field path {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1;
  opacity: 0.6;
}
.avatar-province path {
  fill: var(--map-3);
  opacity: 0.28;
}
.avatar-halo {
  fill: var(--map-1);
  opacity: 0.55;
}
.avatar-figure {
  animation: avatar-rise 0.55s 0.18s both;
  transform-origin: center bottom;
}
.avatar-torso { fill: var(--avatar-shirt); }
.avatar-torso.is-idle { fill: var(--map-3); }
.avatar-seam {
  fill: none;
  stroke: var(--avatar-detail);
  stroke-width: 1;
  opacity: 0.18;
}
.avatar-shoulder-seam {
  fill: none;
  stroke: var(--avatar-detail);
  stroke-width: 1;
  opacity: 0.2;
}
.avatar-neckline {
  fill: none;
  stroke: var(--avatar-detail);
  stroke-width: 3;
  stroke-linecap: round;
}
.avatar-placket-line {
  fill: none;
  stroke: var(--avatar-detail);
  stroke-width: 1;
  opacity: 0.28;
}
.avatar-shirt-shade { fill: var(--map-4); opacity: 0.35; }
.avatar-collar { fill: var(--paper); }
.avatar-neck { fill: var(--avatar-skin-shadow); }
.avatar-face, .avatar-ear { fill: var(--avatar-skin); }
.avatar-ear { fill: var(--avatar-skin-shadow); }
.avatar-hair-back,
.avatar-hair-front,
.avatar-hair-side,
.avatar-bun { fill: var(--avatar-hair); }
.avatar-hair-old { fill: var(--avatar-hair-old); }
.avatar-hair-part {
  fill: none;
  stroke: var(--avatar-detail);
  stroke-width: 1.2;
  opacity: 0.45;
}
.avatar-bun-tie {
  fill: none;
  stroke: var(--avatar-detail);
  stroke-width: 2;
  opacity: 0.7;
}
.avatar-hair-streak {
  fill: none;
  stroke: var(--avatar-streak);
  stroke-width: 1.4;
  opacity: 0.35;
}
.avatar-brow,
.avatar-nose,
.avatar-mouth,
.avatar-line {
  fill: none;
  stroke: var(--avatar-face-line);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.avatar-line { stroke-width: 1.1; opacity: 0.65; }
.avatar-eye { fill: var(--avatar-face-line); }
.avatar-lapel {
  fill: var(--map-2);
  stroke: var(--avatar-detail);
  stroke-width: 1;
}
.avatar-tie { fill: var(--accent); }
.avatar-pin { fill: var(--accent); }
.avatar-pocket-line,
.avatar-pen-clip {
  fill: none;
  stroke: var(--avatar-detail);
  stroke-width: 1.2;
  stroke-linecap: round;
}
.avatar-neck-line {
  fill: none;
  stroke: var(--avatar-skin-shadow);
  stroke-width: 1;
  opacity: 0.45;
}
.avatar-pocket,
.avatar-patch {
  fill: none;
  stroke: var(--avatar-detail);
  stroke-width: 1.2;
}
.avatar-pen { fill: var(--accent); }
.avatar-apron { fill: var(--avatar-detail); }
.avatar-apron-strap,
.avatar-apron-line {
  fill: none;
  stroke: var(--avatar-shirt);
  stroke-width: 1.2;
}
.avatar-strap {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  opacity: 0.85;
}
.avatar-field-line {
  stroke: var(--avatar-detail);
  stroke-width: 1.2;
  opacity: 0.5;
}
.avatar-jacket { fill: var(--map-4); }
.avatar-zip { stroke: var(--avatar-detail); stroke-width: 1.2; }
.avatar-band { stroke: var(--accent); stroke-width: 6; }
.avatar-badge-bg {
  fill: var(--avatar-detail);
  stroke: var(--rule);
  stroke-width: 1;
}
.avatar-cell { fill: var(--rule); }
.avatar-cell.on { fill: var(--accent); }
.avatar-badge.is-empty { opacity: 0.5; }
.avatar-badge.is-empty .avatar-badge-bg { stroke-dasharray: 2 2; }
.avatar-frame {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1;
}
.avatar-grid,
.avatar-field,
.avatar-province,
.avatar-hair-back {
  animation: avatar-fade 0.55s 0.08s both;
}
.avatar-head {
  animation: avatar-pop 0.45s 0.3s both;
  transform-origin: center;
}
.avatar-hair-front,
.avatar-hair-side,
.avatar-bun {
  animation: avatar-fade 0.35s 0.4s both;
}
.avatar-features,
.avatar-hair-streak {
  animation: avatar-fade 0.35s 0.5s both;
}
.avatar-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: avatar-blink 7s 3s infinite;
}
.avatar-badge { animation: avatar-pop 0.45s 0.62s both; }

/* The old person plate, fan and ribbon styles remain for the prototype
   fallback; the executed Life now uses the portrait above. */

/* Person plate ------------------------------------------------------------ */

.person-plate .plate-arc-bg {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1.5;
}
.person-plate .plate-arc-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: butt;
  stroke-dashoffset: 1;
  animation: plate-draw 1.15s 0.05s ease-out forwards;
}
.person-plate .plate-tick { stroke: var(--muted); stroke-width: 1; }
.plate-tick-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}
.plate-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
}
.plate-age {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 78px;
  font-weight: 600;
  letter-spacing: -0.05em;
}
.plate-unit {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.plate-sub {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
}
.plate-edu-label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
}
.plate-year {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}
.plate-edu rect {
  fill: var(--rule);
  animation: plate-fade 0.35s 0.55s both;
}
.plate-edu rect.on { fill: var(--ink); }
.plate-edu-step {
  fill: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
}
.plate-edu-step.on { fill: var(--ink); font-weight: 500; }
.plate-age-marker {
  fill: var(--accent);
  stroke: var(--paper);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: plate-pop 0.5s 0.9s both;
}
.plate-edu rect:nth-child(2) { animation-delay: 0.6s; }
.plate-edu rect:nth-child(3) { animation-delay: 0.65s; }
.plate-edu rect:nth-child(4) { animation-delay: 0.7s; }

/* Work rosette ------------------------------------------------------------ */

.work-rose .work-sector {
  fill: var(--map-1);
  stroke: var(--paper);
  stroke-width: 1.5;
  opacity: 0.9;
  animation: plate-fade 0.45s both;
}
.work-rose .work-sector.on { fill: var(--accent); opacity: 1; }
.work-rose.is-idle .work-sector { fill: var(--rule); opacity: 0.45; }
.work-rose .work-sector-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  animation: plate-fade 0.3s 0.3s both;
}
.work-rose .work-sector-label.on { fill: var(--paper); }
.work-rose .work-sector:nth-child(2) { animation-delay: 0.03s; }
.work-rose .work-sector:nth-child(3) { animation-delay: 0.06s; }
.work-rose .work-sector:nth-child(4) { animation-delay: 0.09s; }
.work-rose .work-sector:nth-child(5) { animation-delay: 0.12s; }
.work-rose .work-sector:nth-child(6) { animation-delay: 0.15s; }
.work-rose .work-sector:nth-child(7) { animation-delay: 0.18s; }
.work-rose .work-sector:nth-child(8) { animation-delay: 0.21s; }
.work-rose .work-sector:nth-child(9) { animation-delay: 0.24s; }
.work-rose .work-dot {
  fill: var(--ink);
  opacity: 0.45;
  stroke: var(--paper);
  stroke-width: 1.2;
  transform-box: fill-box;
  transform-origin: center;
  animation: plate-pop 0.4s 0.3s both;
}
.work-rose .work-dot.on { fill: var(--ink); opacity: 1; stroke-width: 2; }
.work-rose .work-occ-ring {
  fill: none;
  stroke: var(--rule);
  stroke-width: 0.8;
  stroke-dasharray: 1 3;
}
.work-rose .work-type {
  fill: none;
  stroke: var(--rule);
  stroke-width: 3;
}
.work-rose .work-type.on { stroke: var(--ink); }
.work-rose .work-hours {
  fill: none;
  stroke: var(--rule);
  stroke-width: 6;
}
.work-rose .work-hours.on { stroke: var(--accent); }
.work-rose .work-away {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}
.work-rose .work-status-halo { fill: var(--accent); opacity: 0.12; }
.work-rose .work-status.employed { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.work-rose .work-status.unemployed { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.work-rose .work-status.outside {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 3 3;
}
.work-rose.is-idle .work-status-halo { opacity: 0.04; }

.work-ring-title {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
}
.work-center { fill: var(--sheet); stroke: var(--rule); stroke-width: 1; }
.work-center-number {
  fill: var(--accent);
  font-family: var(--sans);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.work-center-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.work-key {
  margin-top: 10px;
  border-top: 1px solid var(--rule);
}
.work-key-row {
  display: grid;
  grid-template-columns: 64px 76px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule-soft);
  animation: plate-fade 0.35s both;
}
.work-key-row:nth-child(2) { animation-delay: 0.04s; }
.work-key-row:nth-child(3) { animation-delay: 0.08s; }
.work-key-row:nth-child(4) { animation-delay: 0.12s; }
.work-key-row:nth-child(5) { animation-delay: 0.16s; }
.work-key-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.work-key-number {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}
.work-key-row b {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
}
.work-dot-strip,
.work-bar-strip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.work-dot-strip i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
}
.work-dot-strip i.on {
  background: var(--accent);
  transform: scale(1.35);
  box-shadow: 0 0 0 1px var(--paper);
  animation: plate-pop 0.35s 0.2s both;
}
.work-bar-strip { gap: 3px; }
.work-bar-strip i {
  display: block;
  width: 11px;
  height: 6px;
  background: var(--rule);
}
.work-bar-strip i.on { background: var(--accent); }
.work-key-empty {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}
.work-status-key {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.work-status-key.employed { background: var(--ink); }
.work-status-key.unemployed { border: 2px solid var(--ink); }
.work-status-key.outside { border: 1px dashed var(--muted); }
.work-key-idle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.work-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
}
.work-legend .key {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  vertical-align: middle;
}
.work-legend .key.sector { background: var(--accent); }
.work-legend .key.dot {
  border-radius: 50%;
  border: 1px solid var(--paper);
  background: var(--ink);
}
.work-legend .key.hours {
  height: 0;
  border-top: 3px solid var(--accent);
}
.work-legend .key.type {
  height: 0;
  border-top: 3px solid var(--ink);
}
.work-legend .key.status {
  border-radius: 50%;
  background: var(--ink);
}
.work-legend .key.status.unemployed {
  background: var(--paper);
  border: 1.5px solid var(--ink);
}
.work-legend .key.status.outside {
  background: transparent;
  border: 1px dashed var(--muted);
}
.work-legend b { color: var(--ink); font-weight: 500; }
.work-legend.idle {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
}

/* Earnings ribbon --------------------------------------------------------- */

.earnings-ribbon .ribbon-base { stroke: var(--ink); stroke-width: 2; }
.earnings-ribbon .ribbon-base.dashed {
  stroke: var(--rule);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}
.ribbon-tick { stroke: var(--rule); stroke-width: 1; }
.ribbon-tick-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}
.ribbon-axis {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}
.ribbon-marker-label {
  fill: var(--accent);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}
.earnings-ribbon .ribbon-fill {
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: butt;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: plate-draw 1s 0.1s ease-out forwards;
}
.earnings-ribbon .ribbon-marker {
  fill: var(--accent);
  stroke: var(--paper);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: plate-pop 0.5s 0.7s both;
}
.ribbon-value {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.ribbon-sub {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}
.ribbon-group {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.ribbon-empty {
  fill: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes life-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes plate-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes plate-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes plate-pop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes avatar-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes avatar-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes avatar-pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes avatar-photo-in {
  from { opacity: 0; transform: scale(1.015); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes avatar-blink {
  0%, 91%, 100% { transform: scaleY(1); }
  93%, 95% { transform: scaleY(0.08); }
}
@keyframes mark-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Story ------------------------------------------------------------------- */

.replay-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-top: 1px solid var(--ink);
  padding-top: 10px;
  margin-bottom: 34px;
}

.story-prose {
  font-family: var(--serif);
  font-size: clamp(21px, 2.15vw, 26px);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.005em;
  max-width: 50ch;
  color: var(--ink);
  text-wrap: pretty;
}
.story-prose p { margin: 0 0 0.9em; }
.story-prose p:last-child { margin-bottom: 0; }

.story-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  margin-top: 34px;
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.story-foot span + span {
  border-left: 1px solid var(--rule);
  padding-left: 18px;
}

.share-url {
  display: none;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 8px;
}
.share-url.show { display: block; }

.tiles-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--ink);
  padding-top: 10px;
  margin: 42px 0 0;
}
.tiles-head h2 {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}
.tiles-head span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
}

.tile {
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--rule-soft);
  min-width: 0;
}
.tile.fill { grid-column: 1 / -1; }
.tile.earnings {
  grid-column: 1 / -1;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule-soft);
  padding-top: 16px;
  padding-bottom: 18px;
  margin: 2px 0 24px;
}
.tile-k {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.tile-v {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
}

/* Empty / error ----------------------------------------------------------- */

.notfound { padding: 12vh 0 20vh; max-width: 720px; }
.notfound h1 { font-size: clamp(38px, 5vw, 64px); margin-bottom: 16px; }
.notfound p { color: var(--muted); max-width: 50ch; margin-bottom: 24px; }

/* Footer ------------------------------------------------------------------ */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  border-top: 1px solid var(--rule);
  margin-top: 72px;
  padding: 22px 0 30px;
  font-size: 12px;
  color: var(--muted);
}
.footer-main p { margin: 0 0 5px; }
.footer-tag { color: var(--ink); }
.footer-credit a { text-decoration: underline; text-underline-offset: 3px; }
.footer-note {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--faint);
}
.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

/* Dialogs ----------------------------------------------------------------- */

dialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgb(16 19 17 / 0.42);
  backdrop-filter: blur(2px);
}

.panel-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(86dvh, 820px);
}
.panel-dialog[open] { animation: dialog-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) both; }

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--rule);
}
.dialog-head .kicker { margin-bottom: 6px; }
.dialog-head h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}
.close {
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 26px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.close:hover { color: var(--accent); }

#method-body {
  padding: 20px 24px 28px;
  overflow: auto;
  max-height: calc(86dvh - 92px);
}
#method-body h3 {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--rule);
}
#method-body h3:first-child { margin-top: 0; }
#method-body p {
  font-size: 15px;
  line-height: 1.55;
  max-width: 64ch;
  margin: 0 0 12px;
}
#method-body ul {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
#method-body li { margin-bottom: 5px; }
#method-body .proto-note {
  border: 1px solid var(--rule);
  background: var(--sheet);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 20px;
}

.gallery-dialog {
  margin: 0 0 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  width: min(460px, 100vw);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}
.gallery-dialog[open] { animation: drawer-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both; }
.gallery-dialog .dialog-head { padding: 20px 22px 16px; }
.dialog-note {
  padding: 12px 22px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}
.gallery-list {
  overflow: auto;
  max-height: calc(100dvh - 236px);
  padding: 0 22px;
}
.gallery-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--rule-soft);
  padding: 14px 0;
}
.gallery-mark { width: 40px; height: 40px; }
.gallery-mark svg { width: 40px; height: 40px; display: block; overflow: visible; }
.gallery-mark .mark-tick:not(.on) { opacity: 0.4; }
.gallery-mark .mark-edu,
.gallery-mark .mark-occ { opacity: 0.55; }
.gallery-open {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.gallery-open:hover .g-place { color: var(--accent); }
.g-year {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 3px;
}
.g-place {
  display: block;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.15s ease;
}
.g-desc {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 4px;
}
.g-remove {
  border: 1px solid var(--rule);
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  padding: 5px 6px;
  cursor: pointer;
}
.g-remove:hover { border-color: var(--accent); color: var(--accent); }
.gallery-empty {
  padding: 36px 0;
  max-width: 32ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--rule);
}
.gallery-dialog .dialog-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--paper);
}
#gallery-clear { color: var(--accent); }
#gallery-clear:hover { border-color: var(--accent); }

.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
}
.confirm-dialog h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.confirm-dialog p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 20px;
}

/* Toast ------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 11px 14px;
  font-size: 12.5px;
  max-width: min(420px, calc(100vw - 48px));
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Motion ------------------------------------------------------------------ */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes stage-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1080px) {
  .hero-top { gap: 32px; }
  .stage-grid { gap: 40px; }
  .fact { grid-template-columns: 112px minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    padding-top: 30px;
  }
  .hero-top { grid-template-columns: 1fr; gap: 24px; }
  .hero-sub { max-width: 44ch; }
  .plate-map { height: min(32vh, 300px); }
  .stage-grid { grid-template-columns: 1fr; gap: 26px; }
  .stage-rail { position: static; }
  .rail-actions { max-width: none; flex-direction: row; flex-wrap: wrap; }
  .rail-actions .btn { width: auto; }
  .rail-lede { max-width: 46ch; }
  .tiles { column-gap: 28px; }
}

@media (max-width: 720px) {
  .wrap, .topbar { width: calc(100% - 32px); }
  .topbar { height: 58px; }
  .brand-tag { display: none; }
  .topnav { gap: 12px; }
  .nav-method { display: none; }
  .lang { padding-left: 10px; }
  .gallery-btn { padding: 7px 8px; }
  .gallery-label.long { display: none; }
  .gallery-label.short { display: inline; }
  .hero h1 { font-size: clamp(40px, 11.4vw, 62px); }
  .hero-sub { font-size: 15.5px; }
  .hero-plate { margin-top: 26px; }
  .plate-map { height: auto; padding: 0; }
  .plate-map svg { height: auto; }
  .plate-caption { font-size: 8.5px; }
  .chain { font-size: 11.5px; gap: 4px; flex-direction: column; align-items: flex-start; }
  .chain .arrow { display: none; }
  .chain-note { width: 100%; margin-left: 0; margin-top: 6px; }
  .progress .lbl { font-size: 8.5px; letter-spacing: 0.06em; }
  .progress .n { display: none; }
  .progress li + li { padding-left: 8px; }
  .big-year { font-size: clamp(76px, 23vw, 118px); }
  .big-place { font-size: clamp(38px, 10.5vw, 56px); }
  .fact { grid-template-columns: 1fr; gap: 5px; padding: 12px 0; }
  .fact dt { padding-top: 0; }
  .fact-fig { font-size: 12px; }
  .tiles { grid-template-columns: 1fr; }
  .story-foot { font-size: 9px; }
  .site-footer { flex-direction: column; gap: 14px; margin-top: 52px; }
  .footer-links { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .panel-dialog { width: 100vw; max-height: 92dvh; }
  .gallery-dialog { width: 100vw; }
  .rail-mark .life-mark-svg { width: 96px; height: 96px; }
  .rail-mark-story .life-mark-svg { width: 112px; height: 112px; }
  .mark-dialog-grid { grid-template-columns: 1fr; gap: 20px; }
  .mark-large svg { width: 180px; height: 180px; }
  .mark-legend > div { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: clamp(36px, 11vw, 52px); }
  .btn { padding: 10px 14px; font-size: 13px; }
  .actions { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .mark-age { stroke-dashoffset: 0; }
}

.footer-credit [lang="en"] { display: none; }
html[lang="en"] .footer-credit [lang="id"] { display: none; }
html[lang="en"] .footer-credit [lang="en"] { display: inline; }

/* About ------------------------------------------------------------------- */

.about {
  max-width: 760px;
  padding-top: clamp(28px, 5vw, 64px);
  padding-bottom: clamp(40px, 6vw, 80px);
}

.about h1 {
  margin: 10px 0 22px;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.about-lede {
  max-width: 56ch;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
}

.about-section {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.about-section h2 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-section p {
  max-width: 62ch;
  margin: 0 0 12px;
  color: var(--muted);
}

.about-note {
  margin: 40px 0 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .life-view-grid { grid-template-columns: 1fr; gap: 20px; }
  .life-visual { max-width: 540px; }
}

@media (max-width: 720px) {
  .life-chapters button { padding: 9px 8px; gap: 5px; }
  .life-chapters .l { font-size: 9px; letter-spacing: 0.08em; }
  .life-chapters .n { font-size: 8px; }
  .life-fact-list .fact { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .life-lead { font-size: 14px; }
  .work-key-row { grid-template-columns: 58px 64px minmax(0, 1fr); gap: 6px; }
  .work-key-label { font-size: 8px; }
  .work-key-row b { font-size: 11px; }
}

@media (max-width: 420px) {
  .life-chapters .n { display: none; }
  .life-chapters button { justify-content: center; }
  .life-visual { padding: 4px 4px 2px; }
  .work-key-row { grid-template-columns: 54px 60px minmax(0, 1fr); gap: 5px; }
  .work-key-row b { font-size: 10.5px; }
  .work-dot-strip { gap: 3px; }
  .work-dot-strip i { width: 7px; height: 7px; }
  .work-bar-strip { gap: 2px; }
  .work-bar-strip i { width: 9px; }
}
