/* base.css — reset, type, layout primitives, accessibility (DESIGN-v2 1.2 / 1.5 / 1.7). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 14px/var(--lh-zh) var(--f-body); overflow-x: clip; position: relative; isolation: isolate;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { line-height: var(--lh-en); }
/* A: two radial lights (lime top-left, pink top-right) + 48px grid; light theme: grid off, lights at 4% */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(900px 420px at 12% -6%, var(--deco-a), transparent 60%),
    radial-gradient(800px 500px at 100% 8%, var(--deco-b), transparent 60%),
    linear-gradient(var(--deco-grid) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--deco-grid) 1px, transparent 1px) 0 0 / 48px 100%;
}
img, svg { max-width: 100%; }
a { color: var(--lime-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: var(--lh-head); margin: 0; }
h1 { font-size: 30px; font-weight: 900; letter-spacing: .01em; }
h2 { font-size: 20px; font-weight: 900; letter-spacing: .02em; }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0 0 var(--s-3); }
@media (min-width: 900px) { h1 { font-size: 46px; } h2 { font-size: 24px; } }
ul, ol { padding-left: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-4) 0; }
code, kbd { font-family: var(--f-mono); font-size: .92em; background: var(--panel-2); padding: 0 4px; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--lime); color: var(--on-lime); }

/* numbers, addresses, block numbers, winning numbers: always mono + tabular */
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: var(--lh-num); }
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.ink-2 { color: var(--ink-2); }
.small { font-size: 13px; }
.lp-tight { margin: 0; }
.tiny { font-size: 12px; }
.ok-ink, .lime-ink { color: var(--lime-ink); } .bad-ink { color: var(--bad); } .warn-ink, .test-ink, .amber-ink { color: var(--amber-ink); }
.pink-ink { color: var(--pink-ink); } .cyan-ink { color: var(--cyan-ink); } .violet-ink { color: var(--violet-ink); }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.break { word-break: break-word; overflow-wrap: anywhere; }
/* Japanese headings: wrap at phrase boundaries, not mid-word (Chrome/Edge 119+; other browsers ignore it). */
html:lang(ja) :is(h1, h2, h3) { word-break: auto-phrase; overflow-wrap: anywhere; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack > * + * { margin-top: var(--s-3); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

/* the signature cut corner (top-left + bottom-right). clip-path also clips borders, shadows and focus rings:
   draw borders as "1px gradient outer + inner panel", focus rings with outline-offset:-3px (DESIGN 1.3). */
.cut { --cut: var(--cut-sm); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.cut:focus-visible, .cut :focus-visible { outline-offset: -3px; }

/* sections */
section.sec, .sec { margin-top: var(--sec-gap); scroll-margin-top: calc(var(--top-h) + 20px); }
section[id], [id].anchor { scroll-margin-top: calc(var(--top-h) + 20px); }

/* no-JS fallback (boot.js adds .js to <html>) */
.js .nojs-only { display: none !important; }
.noscript { background: var(--amber-a); color: var(--amber-ink); padding: 12px 16px; font-size: 14px; font-weight: 600; }
.noscript a { color: inherit; text-decoration: underline; }
.nojs-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 14px; }

/* skip link */
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--lime); color: var(--on-lime); padding: 8px 12px; font-weight: 800; }
.skip:focus { top: 8px; }

/* live-number flash (DataBand / pool): new value flashes lime for 600 ms */
.flash { animation: numflash .6s ease-out; }
@keyframes numflash { 0% { color: var(--lime-ink); text-shadow: var(--glow-text-sm); } 100% { } }
@keyframes pulse { 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
