/* ==========================================================================
   Kome Reserves 米 — stylesheet
   Type:  Zen Old Mincho (display, mincho w/ brush-derived stroke contrast)
          Zen Kaku Gothic New (body, metric sibling of the above)
          Martian Mono (all figures — squarish industrial mono)
   Colour: sumi ink ground, washi paper text, shu (朱) vermillion accent. Three.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* ground */
  --sumi-0:  #100e0b;
  --sumi-1:  #14120e;
  --sumi-2:  #1a1813;
  --sumi-3:  #221f18;
  --rule:    #2c2820;
  --rule-2:  #3a352a;

  /* ink */
  --washi:   #ece5d6;
  --washi-2: #b8b0a0;
  --washi-3: #7d766a;
  --washi-4: #514c43;

  /* accent — vermillion, used once per idea, never decoratively */
  --shu:     #c1352a;
  --shu-lit: #e0503f;
  --shu-wash: rgba(193, 53, 42, 0.09);

  /* type */
  --disp: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", monospace;

  /* 1.25 modular scale */
  --t-3xs: 0.64rem;
  --t-2xs: 0.8rem;
  --t-xs:  0.875rem;
  --t-s:   1rem;
  --t-m:   1.25rem;
  --t-l:   1.563rem;
  --t-xl:  1.953rem;
  --t-2xl: 2.441rem;
  --t-3xl: 3.052rem;
  --t-4xl: 3.815rem;

  --shell: 1240px;
  --ease:  cubic-bezier(0.22, 0.61, 0.36, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sumi-1);
  color: var(--washi);
  font-family: var(--body);
  font-size: var(--t-s);
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint paper tooth — kills the flat-void look without a gradient */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(236,229,214,0.022) 0, transparent 42%),
    radial-gradient(circle at 82% 74%, rgba(193,53,42,0.02) 0, transparent 46%);
}

h1, h2, h3, h4 {
  font-family: var(--disp);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.014em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 32px;
  position: relative;
  z-index: 1;
}

/* numerals: tabular everywhere, no exceptions */
.num, td.num, .stat-v, .fig {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.03em;
}

/* --- eyebrow / section label ------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-3xs);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--washi-3);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--shu);
  flex: none;
}
.eyebrow .ja {
  font-family: var(--disp);
  letter-spacing: 0.1em;
  color: var(--washi-4);
  text-transform: none;
}

/* ======================================================================
   MASTHEAD
   ====================================================================== */
.mast {
  position: sticky; top: 0; z-index: 60;
  background: rgba(16, 14, 11, 0.86);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--rule);
}
/* The mast is 62px and sticky, so every in-page anchor must reserve that much
   headroom or the section heading lands underneath it. */
section[id], div[id] { scroll-margin-top: 78px; }
.mast-in {
  display: flex; align-items: center; gap: 28px;
  height: 62px;
}
.brand { display: flex; align-items: baseline; gap: 11px; flex: none; }
.brand-gl {
  font-family: var(--disp);
  font-size: var(--t-m);
  font-weight: 700;
  color: var(--shu);
  line-height: 1;
}
.brand-wm {
  font-family: var(--disp);
  font-size: var(--t-2xs);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--washi);
}
.brand-sub {
  font-family: var(--mono);
  font-size: var(--t-3xs);
  letter-spacing: 0.16em;
  color: var(--washi-4);
  padding-left: 11px;
  border-left: 1px solid var(--rule-2);
}

.mast-tick {
  margin-left: auto;
  display: flex; align-items: stretch; gap: 0;
  border-left: 1px solid var(--rule);
}
.tick {
  padding: 0 18px;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--rule);
}
.tick-k {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--washi-4);
}
.tick-v {
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 600;
  color: var(--washi);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tick-v .u { color: var(--washi-3); font-weight: 300; font-size: 0.9em; }

/* ======================================================================
   HERO — asymmetric, vertical Japanese rail, no centred stack
   ====================================================================== */
.hero {
  position: relative;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.hero-in {
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 0;
  min-height: min(88vh, 860px);
  align-items: end;
  padding: 132px 0 64px;
}

.hero-l { max-width: 780px; }

.hero-h {
  font-size: clamp(2.6rem, 7.2vw, var(--t-4xl));
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-top: 30px;
}
.hero-h .li { display: block; }
.hero-h .dim { color: var(--washi-3); font-weight: 400; }
.hero-h em {
  font-style: normal;
  color: var(--shu);
  position: relative;
}

.hero-p {
  margin-top: 30px;
  max-width: 60ch;
  font-size: var(--t-m);
  line-height: 1.62;
  color: var(--washi-2);
}
.hero-p strong { color: var(--washi); font-weight: 500; }

.hero-cta { margin-top: 42px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: var(--t-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 22px;
  border: 1px solid var(--rule-2);
  color: var(--washi);
  background: transparent;
  cursor: pointer;
  transition: border-color 260ms var(--ease), color 260ms var(--ease),
              background 260ms var(--ease), transform 260ms var(--ease);
}
.btn:hover { border-color: var(--washi-3); transform: translateY(-1px); }
.btn-p {
  background: var(--shu);
  border-color: var(--shu);
  color: #fdf7ef;
}
.btn-p:hover { background: var(--shu-lit); border-color: var(--shu-lit); }
.btn .ar { transition: transform 260ms var(--ease); }
.btn:hover .ar { transform: translateX(3px); }

/* vertical Japanese rail on the right edge of the hero */
.hero-r {
  justify-self: end;
  align-self: stretch;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 8px;
  border-left: 1px solid var(--rule);
}
.vrail {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--disp);
  font-size: var(--t-m);
  font-weight: 400;
  letter-spacing: 0.42em;
  color: var(--washi-4);
  line-height: 1;
  user-select: none;
}
.vrail .hi { color: var(--shu); }

/* oversized watermark glyph, clipped by the hero box */
.hero-gl {
  position: absolute;
  right: -3.5vw; bottom: -13vh;
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(20rem, 42vw, 40rem);
  line-height: 0.8;
  color: var(--washi);
  opacity: 0.028;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* hero stat strip */
.hero-stats {
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.hstat {
  padding: 26px 26px 28px;
  border-right: 1px solid var(--rule);
}
.hstat:last-child { border-right: 0; }
.hstat-k {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--washi-4);
}
.hstat-v {
  font-family: var(--mono);
  font-size: var(--t-l);
  font-weight: 600;
  color: var(--washi);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  margin-top: 9px;
  line-height: 1.1;
}
.hstat-v .u {
  font-size: 0.5em; font-weight: 300;
  color: var(--washi-3); letter-spacing: 0.05em; margin-left: 4px;
}
.hstat-n {
  font-size: var(--t-3xs);
  color: var(--washi-4);
  margin-top: 6px;
  font-family: var(--body);
}

/* ======================================================================
   SECTION SCAFFOLD
   ====================================================================== */
section { position: relative; z-index: 1; }
.sec { padding: 116px 0; border-bottom: 1px solid var(--rule); }
.sec-alt { background: var(--sumi-0); }

.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: end; }
.sec-h {
  font-size: clamp(1.7rem, 3.6vw, var(--t-2xl));
  font-weight: 600;
  margin-top: 20px;
  letter-spacing: -0.022em;
}
.sec-h .ja {
  display: block;
  font-size: 0.44em;
  font-weight: 400;
  letter-spacing: 0.34em;
  color: var(--washi-4);
  margin-bottom: 12px;
}
.sec-lede { color: var(--washi-2); font-size: var(--t-s); max-width: 52ch; }
.sec-lede strong { color: var(--washi); font-weight: 500; }

/* ======================================================================
   MAP
   ====================================================================== */
.map-wrap {
  margin-top: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--sumi-0);
}

.map-stage {
  position: relative;
  border-right: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
}
/* The SVG is 760x900 (portrait). aspect-ratio keeps the box honest so the
   Okinawa inset — anchored to the bottom of the viewBox — is never cropped,
   and align-items:center stops a tall read-out panel from leaving a dead
   band of empty stage underneath the map. */
.map-stage svg {
  width: 100%;
  height: auto;
  aspect-ratio: 760 / 900;
  max-height: min(86vh, 880px);
  max-width: calc(min(86vh, 880px) * 760 / 900);
  display: block;
  margin-inline: auto;
}

.map-badge {
  position: absolute; top: 16px; left: 18px;
  font-family: var(--mono);
  font-size: var(--t-3xs);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--washi-4);
  pointer-events: none;
}
.map-badge b { color: var(--washi-2); font-weight: 400; }

/* prefecture shapes */
.pref {
  fill: #474032;
  stroke: #6b604c;
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
  transition: fill 300ms var(--ease);
  /* Land is a backdrop, never a hit target. Without this the prefecture
     paths sit on top of the marker hit areas and swallow every click aimed
     at a vault node. */
  pointer-events: none;
}
/* vault-bearing prefectures read hotter than plain land */
.pref.has { fill: #554b37; }
.pref.on  { fill: #6e6042; }

/* okinawa inset frame */
.inset-fr {
  fill: none; stroke: #635946; stroke-width: 0.8;
  vector-effect: non-scaling-stroke; pointer-events: none;
}
.inset-lb {
  font-family: var(--mono); font-size: 6.4px;
  fill: var(--washi-3); letter-spacing: 0.09em;
  pointer-events: none;
}

/* vault nodes */
.node { cursor: pointer; pointer-events: auto; }
/* the transparent halo is the real tap target — keep it generous */
.node-halo {
  fill: var(--shu);
  opacity: 0.13;
  transition: opacity 320ms var(--ease), r 320ms var(--ease);
}
.node-lead { stroke: var(--shu); stroke-width: 0.9; opacity: 0.4; pointer-events: none; }
.node-ring {
  fill: none; stroke: var(--shu); stroke-width: 1.1;
  opacity: 0.55; pointer-events: none;
}
.node-dot {
  fill: var(--shu);
  stroke: var(--sumi-0);
  stroke-width: 1.4;
  transition: r 260ms var(--ease);
}
.node-lb {
  font-family: var(--mono);
  font-size: 8.4px;
  letter-spacing: 0.055em;
  fill: var(--washi-2);
  pointer-events: none;
  transition: fill 260ms var(--ease);
}
.node-lb-ja {
  font-family: var(--disp);
  font-size: 8.4px;
  fill: var(--washi-4);
  pointer-events: none;
  transition: fill 260ms var(--ease);
}
.node:hover .node-halo,
.node.on   .node-halo { opacity: 0.3; }
.node:hover .node-dot,
.node.on   .node-dot  { r: 6.4; }
.node:hover .node-lb,
.node.on   .node-lb   { fill: var(--washi); }
.node:hover .node-lb-ja,
.node.on   .node-lb-ja { fill: var(--washi-2); }

.node.anchor .node-dot { stroke: var(--shu-lit); stroke-width: 2; }
.node.anchor .node-ring {
  fill: none; stroke: var(--shu); stroke-width: 0.9; opacity: 0.5;
}

/* leader lines from node to label */
.node-lead { stroke: var(--rule-2); stroke-width: 0.6; vector-effect: non-scaling-stroke; }

/* --- read-out panel ---------------------------------------------------- */
.map-panel { display: flex; flex-direction: column; background: var(--sumi-1); }

.mp-top { padding: 24px 26px 20px; border-bottom: 1px solid var(--rule); }
.mp-ja {
  font-family: var(--disp);
  font-size: var(--t-l);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.2;
}
.mp-en {
  font-family: var(--mono);
  font-size: var(--t-3xs);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--washi-3);
  margin-top: 8px;
}
.mp-grade {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: var(--t-3xs);
  letter-spacing: 0.11em;
  color: var(--shu-lit);
  border: 1px solid rgba(193,53,42,0.42);
  background: var(--shu-wash);
  padding: 5px 11px;
}

.mp-rows { padding: 6px 26px 20px; }
.mp-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px dotted var(--rule);
}
.mp-row:last-child { border-bottom: 0; }
.mp-k {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--washi-4);
}
.mp-v {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--washi);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  text-align: right;
}
.mp-v .u { color: var(--washi-3); font-weight: 300; font-size: 0.84em; margin-left: 3px; }
.mp-v.tx { font-family: var(--body); letter-spacing: 0; font-weight: 400; }

.mp-note {
  margin: 0 26px 22px;
  padding: 14px 16px;
  background: var(--sumi-2);
  border-left: 2px solid var(--rule-2);
  font-size: var(--t-2xs);
  line-height: 1.6;
  color: var(--washi-2);
}

.mp-bars { padding: 0 26px 26px; margin-top: auto; }
.mp-bars-h {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--washi-4);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 14px;
}
.bar-r { display: grid; grid-template-columns: 88px 1fr 64px; gap: 11px; align-items: center; padding: 5px 0; cursor: pointer; }
.bar-l {
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.05em; color: var(--washi-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 220ms var(--ease);
}
.bar-t { height: 5px; background: var(--sumi-3); position: relative; overflow: hidden; }
.bar-f {
  position: absolute; inset: 0 auto 0 0;
  background: var(--rule-2);
  transition: background 240ms var(--ease), width 640ms var(--ease);
}
.bar-n {
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--washi-3); text-align: right;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  transition: color 220ms var(--ease);
}
.bar-r:hover .bar-l, .bar-r.on .bar-l { color: var(--washi); }
.bar-r:hover .bar-n, .bar-r.on .bar-n { color: var(--washi); }
.bar-r:hover .bar-f, .bar-r.on .bar-f { background: var(--shu); }

/* ======================================================================
   LEDGER TABLE
   ====================================================================== */
.tbl-wrap { margin-top: 56px; border: 1px solid var(--rule); overflow-x: auto; }
table.ledger { width: 100%; border-collapse: collapse; min-width: 900px; }

.ledger thead th {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--washi-4);
  text-align: left;
  padding: 15px 18px;
  background: var(--sumi-0);
  border-bottom: 1px solid var(--rule-2);
  white-space: nowrap;
}
.ledger thead th.r { text-align: right; }

.ledger tbody tr {
  border-bottom: 1px solid var(--rule);
  transition: background 220ms var(--ease);
  cursor: pointer;
}
.ledger tbody tr:last-child { border-bottom: 0; }
.ledger tbody tr:hover { background: var(--sumi-2); }
.ledger tbody tr.on { background: var(--shu-wash); }
.ledger tbody tr.anchor td:first-child { box-shadow: inset 2px 0 0 var(--shu); }

.ledger td {
  padding: 16px 18px;
  font-size: var(--t-2xs);
  vertical-align: middle;
  color: var(--washi-2);
}
.ledger td.r { text-align: right; }
.ledger td .ja {
  font-family: var(--disp);
  font-size: var(--t-xs);
  color: var(--washi);
  display: block;
  letter-spacing: 0.04em;
}
.ledger td .en {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--washi-4);
  display: block;
  margin-top: 3px;
}
.ledger td.num { color: var(--washi); font-size: var(--t-xs); font-weight: 500; }

.gr {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  padding: 3px 7px;
  border: 1px solid rgba(193,53,42,0.4);
  background: var(--shu-wash);
  color: var(--shu-lit);
  white-space: nowrap;
}
.streak { display: inline-flex; gap: 3px; }
.streak i {
  width: 5px; height: 12px;
  background: var(--shu);
  opacity: 0.82;
  display: block;
}

.tbl-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 17px 18px;
  background: var(--sumi-0);
  border-top: 1px solid var(--rule-2);
  font-family: var(--mono);
  font-size: var(--t-3xs);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--washi-4);
}
.tbl-foot b {
  color: var(--washi);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ======================================================================
   MECHANISM — asymmetric: one tall figure + numbered steps
   ====================================================================== */
.mech { margin-top: 62px; display: grid; grid-template-columns: 340px 1fr; gap: 0; border: 1px solid var(--rule); }

.mech-fig {
  border-right: 1px solid var(--rule);
  background: var(--sumi-0);
  padding: 34px 30px;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 30px;
}
.unit-stack { display: flex; flex-direction: column; gap: 0; }
.unit-r {
  display: flex; align-items: baseline; gap: 13px;
  padding: 17px 0;
  border-bottom: 1px dotted var(--rule);
}
.unit-r:last-child { border-bottom: 0; }
.unit-gl {
  font-family: var(--disp);
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--shu);
  line-height: 1;
  width: 40px; flex: none;
}
.unit-tx { flex: 1; }
.unit-n {
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 500;
  color: var(--washi);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.unit-d { font-size: var(--t-3xs); color: var(--washi-3); margin-top: 4px; line-height: 1.5; }

.mech-steps { display: grid; grid-template-columns: 1fr 1fr; }
.step {
  padding: 30px 30px 32px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.step:nth-child(2n) { border-right: 0; }
.step:nth-last-child(-n+2) { border-bottom: 0; }
.step-n {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--shu);
}
.step-h {
  font-family: var(--disp);
  font-size: var(--t-m);
  font-weight: 600;
  margin-top: 13px;
  letter-spacing: -0.012em;
}
.step-h .ja {
  display: block;
  font-size: 0.5em; font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--washi-4);
  margin-bottom: 7px;
}
.step-p { margin-top: 12px; font-size: var(--t-2xs); color: var(--washi-2); line-height: 1.65; }
.step-p code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--washi);
  background: var(--sumi-3);
  padding: 1px 5px;
  letter-spacing: -0.02em;
}

/* ======================================================================
   CONTEXT — national reserve bars
   ====================================================================== */
.ctx { margin-top: 58px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); }
.ctx-l { padding: 34px 34px 38px; border-right: 1px solid var(--rule); }
.ctx-r { padding: 34px 34px 38px; background: var(--sumi-0); }

.cbar { margin-bottom: 24px; }
.cbar:last-child { margin-bottom: 0; }
.cbar-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 9px;
}
.cbar-l { font-size: var(--t-2xs); color: var(--washi-2); }
.cbar-v {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--washi);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.028em;
  white-space: nowrap;
}
.cbar-v .u { color: var(--washi-3); font-weight: 300; font-size: 0.82em; margin-left: 3px; }
.cbar-t { height: 7px; background: var(--sumi-3); position: relative; overflow: hidden; }
.cbar-f { position: absolute; inset: 0 auto 0 0; background: var(--rule-2); transition: width 900ms var(--ease); }
.cbar.now  .cbar-f { background: var(--shu); }
.cbar.ev   .cbar-f { background: #6d5f3e; }
.cbar-s { font-size: 0.62rem; color: var(--washi-4); margin-top: 7px; }

.scale-note {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: var(--t-2xs);
  color: var(--washi-2);
  line-height: 1.68;
}
.scale-note b {
  font-family: var(--mono);
  color: var(--shu-lit);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ======================================================================
   PROVENANCE / HISTORY — Dojima 1730
   ====================================================================== */
.hist { margin-top: 58px; display: grid; grid-template-columns: 1fr 400px; gap: 0; border: 1px solid var(--rule); }
.hist-l { padding: 40px 42px 44px; }
.hist-q {
  font-family: var(--disp);
  font-size: var(--t-l);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.008em;
  color: var(--washi);
}
.hist-q .hi { color: var(--shu); }
.hist-a {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: var(--t-3xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--washi-4);
}
.hist-b { margin-top: 30px; font-size: var(--t-2xs); color: var(--washi-2); line-height: 1.72; max-width: 58ch; }
.hist-b + .hist-b { margin-top: 14px; }
.hist-b strong { color: var(--washi); font-weight: 500; }

.chrono { border-left: 1px solid var(--rule); background: var(--sumi-0); padding: 24px 0; }
.chr {
  display: grid; grid-template-columns: 62px 1fr;
  gap: 16px;
  padding: 14px 26px;
  position: relative;
}
.chr-y {
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 600;
  color: var(--shu);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.chr-t { font-size: var(--t-3xs); color: var(--washi-2); line-height: 1.58; }
.chr.dim .chr-y { color: var(--washi-4); }
.chr.dim .chr-t { color: var(--washi-3); }

/* ======================================================================
   FOOTER
   ====================================================================== */
.foot { padding: 76px 0 34px; background: var(--sumi-0); }
.foot-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; padding-bottom: 46px; border-bottom: 1px solid var(--rule); }
.foot-brand { display: flex; align-items: baseline; gap: 12px; }
.foot-gl { font-family: var(--disp); font-size: var(--t-2xl); font-weight: 700; color: var(--shu); line-height: 1; }
.foot-nm { font-family: var(--disp); font-size: var(--t-m); font-weight: 600; letter-spacing: 0.03em; }
.foot-tag { margin-top: 18px; font-size: var(--t-2xs); color: var(--washi-3); max-width: 40ch; line-height: 1.66; }

.foot-h {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--washi-4);
  margin-bottom: 16px;
}
.foot-li { font-size: var(--t-2xs); color: var(--washi-2); padding: 6px 0; line-height: 1.5; }
.foot-li a { border-bottom: 1px solid var(--rule-2); transition: border-color 220ms var(--ease), color 220ms var(--ease); }
.foot-li a:hover { color: var(--washi); border-color: var(--shu); }

.foot-bot {
  padding-top: 26px;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--washi-4);
}
.disc {
  margin-top: 22px;
  font-size: 0.66rem;
  line-height: 1.66;
  color: var(--washi-4);
  max-width: 92ch;
  font-family: var(--body);
  letter-spacing: 0;
}

/* ======================================================================
   MOTION — one idea, applied once
   ====================================================================== */
/* Content is visible by DEFAULT. Only once JS confirms IntersectionObserver
   support does it add .js-rv to <html>, which arms the reveal. Without this
   guard, a no-JS client, a print/PDF render, or a full-page screenshot (which
   never scrolls, so the observer never fires) leaves whole sections stuck at
   opacity:0 — content that silently does not exist. */
.rv { opacity: 1; transform: none; }
.js-rv .rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 720ms var(--ease), transform 720ms var(--ease);
}
.js-rv .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-rv .rv, .rv { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
/* Printing must never depend on scroll state. */
@media print {
  .js-rv .rv, .rv { opacity: 1 !important; transform: none !important; }
}

/* ======================================================================
   RESPONSIVE
   ====================================================================== */
@media (max-width: 1120px) {
  .map-wrap { grid-template-columns: 1fr; }
  .map-stage { border-right: 0; border-bottom: 1px solid var(--rule); min-height: 520px; }
  .mech { grid-template-columns: 1fr; }
  .mech-fig { border-right: 0; border-bottom: 1px solid var(--rule); }
  .hist { grid-template-columns: 1fr; }
  .chrono { border-left: 0; border-top: 1px solid var(--rule); }
}

@media (max-width: 900px) {
  .mast-tick .tick:nth-child(-n+2) { display: none; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hstat:nth-child(2n) { border-right: 0; }
  .hstat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .sec-head { grid-template-columns: 1fr; gap: 26px; }
  .ctx { grid-template-columns: 1fr; }
  .ctx-l { border-right: 0; border-bottom: 1px solid var(--rule); }
  .foot-top { grid-template-columns: 1fr 1fr; gap: 34px; }
  .foot-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --t-4xl: 2.6rem; --t-3xl: 2.2rem; }
  .shell { padding-inline: 20px; }
  .sec { padding: 76px 0; }
  .hero-in { grid-template-columns: 1fr; padding: 92px 0 48px; min-height: 0; }
  .hero-r { display: none; }
  .hero-gl { font-size: 20rem; right: -8vw; bottom: -8vh; }
  .mech-steps { grid-template-columns: 1fr; }
  .step { border-right: 0 !important; border-bottom: 1px solid var(--rule) !important; }
  .step:last-child { border-bottom: 0 !important; }
  .hist-l { padding: 30px 24px 34px; }
  .mast-tick { display: none; }
  .brand-sub { display: none; }
}

@media (max-width: 460px) {
  .hero-stats { grid-template-columns: 1fr; }
  .hstat { border-right: 0 !important; border-bottom: 1px solid var(--rule); }
  .hstat:last-child { border-bottom: 0; }
  .foot-top { grid-template-columns: 1fr; }
  .map-stage { min-height: 420px; padding: 10px; }
  .mp-top, .mp-rows, .mp-bars { padding-inline: 18px; }
  .mp-note { margin-inline: 18px; }
  .hero-p { font-size: var(--t-s); }
}

/* print: the ledger should survive paper */
@media print {
  body { background: #fff; color: #000; }
  .mast, .hero-gl, .map-stage, .foot { display: none; }
  .sec { border-color: #ccc; padding: 12px 0; }
}
