:root {
  color-scheme: light dark;
  --bg: #f4f2ec;
  --surface: #fffdf8;
  --ink: #171914;
  --muted: #62665c;
  --line: #d9d8cf;
  --accent: #c7ff3d;
  --accent-deep: #557b00;
  --danger: #df5d44;
  --shadow: 0 18px 50px rgba(23, 25, 20, .08);
}

* { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font-family: "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif; line-height: 1.75; }
img, svg, canvas { display: block; max-width: 100%; }
.wrap { width: min(100% - 32px, 1080px); margin-inline: auto; }
.section-pad { padding-block: 72px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0 0 20px; font-size: clamp(1.75rem, 7vw, 3.5rem); line-height: 1.18; letter-spacing: -.04em; }
.section-kicker, .eyebrow { margin: 0 0 10px; color: var(--accent-deep); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.section-intro { max-width: 700px; color: var(--muted); }

.hero { position: relative; min-height: 100svh; display: grid; align-items: center; overflow: hidden; background: #151811; color: #f7f7ef; }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; top: -180px; right: -180px; border-radius: 50%; background: var(--accent); filter: blur(2px); opacity: .9; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 34%; background: linear-gradient(transparent, rgba(0,0,0,.3)); }
.hero__inner { position: relative; z-index: 1; padding-block: 80px 56px; }
.hero .eyebrow { color: var(--accent); }
.hero h1 { max-width: 850px; margin: 0; font-size: clamp(3.2rem, 15vw, 8rem); line-height: .92; letter-spacing: -.075em; }
.hero h1 span { color: var(--accent); }
.lead { max-width: 680px; margin: 28px 0 36px; color: #d8dacd; font-size: clamp(1rem, 4.5vw, 1.35rem); }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.18); }
.hero-stats div { padding: 18px 14px; background: rgba(21,24,17,.88); }
.hero-stats dt { color: var(--accent); font-size: clamp(2rem, 10vw, 4rem); font-weight: 900; line-height: 1; letter-spacing: -.06em; }
.hero-stats small { font-size: .45em; }
.hero-stats dd { margin: 7px 0 0; color: #cfd2c5; font-size: .78rem; }
.micro { margin: 12px 0 0; color: #9ea294; font-size: .72rem; }

.summary { padding-block: 72px; }
.takeaways { display: grid; gap: 14px; margin: 32px 0 0; padding: 0; list-style: none; counter-reset: takeaway; }
.takeaways li { position: relative; min-height: 88px; padding: 20px 18px 20px 64px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.takeaways li::before { counter-increment: takeaway; content: "0" counter(takeaway); position: absolute; left: 18px; top: 20px; color: var(--accent-deep); font-weight: 900; }

.findings { background: #20241b; color: #f5f5ed; }
.findings .section-kicker { color: var(--accent); }
.card-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(82vw, 340px); gap: 14px; overflow-x: auto; padding: 8px 16px 24px 0; scroll-snap-type: x mandatory; overscroll-behavior-inline: contain; }
.finding-card { min-height: 330px; padding: 24px; border: 1px solid #3b4232; border-radius: 22px; background: #292e23; scroll-snap-align: start; }
.finding-card span { color: var(--accent); font-size: 3rem; font-weight: 900; }
.finding-card h3 { margin: 28px 0 14px; font-size: 1.35rem; line-height: 1.35; }
.finding-card p { color: #c8ccbf; }

.chart-card { margin-top: 32px; padding: 20px 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.pf-chart { display: grid; gap: 14px; min-height: 320px; }
.pf-row { display: grid; grid-template-columns: minmax(118px, 38%) 1fr; gap: 12px; align-items: center; }
.pf-label { font-size: .77rem; font-weight: 700; line-height: 1.3; text-align: right; }
.pf-track { position: relative; min-height: 34px; border-radius: 7px; background: color-mix(in srgb, var(--line) 55%, transparent); overflow: hidden; }
.pf-track::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pf-one, 33.333%); border-left: 1px dashed var(--muted); opacity: .7; }
.pf-bar { min-width: 3px; height: 34px; border-radius: 7px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.pf-bar.is-loss { background: linear-gradient(90deg, #a1372b, var(--danger)); }
.pf-value { position: absolute; inset: 0 8px 0 auto; display: grid; place-items: center; color: var(--ink); font-size: .73rem; font-weight: 900; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
.chart-status, .loading { color: var(--muted); font-size: .78rem; }
.method-note { margin-top: 18px; border-block: 1px solid var(--line); }
.method-note summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; font-weight: 800; }
.method-note dl { margin: 0 0 20px; }
.method-note dl div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 8px 0; border-top: 1px dotted var(--line); }
.method-note dt { color: var(--muted); font-size: .8rem; }
.method-note dd { margin: 0; font-size: .88rem; }

.outline-grid { display: grid; gap: 12px; }
.outline-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.outline-grid span { color: var(--accent-deep); font-weight: 900; }
.outline-grid h3 { margin: 12px 0 4px; }
.outline-grid p { margin: 0; color: var(--muted); }
.footer { padding-block: 40px; background: #151811; color: #bfc2b6; font-size: .78rem; }

.mechanisms { background: var(--surface); }
.diagram-grid { display: grid; gap: 16px; margin-top: 32px; }
.diagram-grid figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); }
.diagram-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.diagram-grid figcaption { padding: 18px; color: var(--muted); font-size: .86rem; }
.diagram-grid strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 1rem; }

.scatter-section { background: #20241b; color: #f5f5ed; }
.scatter-section .section-kicker { color: var(--accent); }
.scatter-section .section-intro, .scatter-section .chart-note { color: #c8ccbf; }
.canvas-card { margin-top: 30px; padding: 14px; border: 1px solid #3b4232; border-radius: 22px; background: #292e23; }
.canvas-card canvas { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.chart-note { margin: 12px 4px 2px; font-size: .76rem; }

.ranking { background: var(--surface); }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin: 24px 0 14px; padding-bottom: 4px; }
.filter-button { min-height: 44px; flex: 0 0 auto; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.filter-button.is-active { border-color: var(--accent-deep); background: var(--accent); color: #172000; }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 980px; border-collapse: collapse; background: var(--surface); font-size: .8rem; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #24291f; color: #f4f5ed; font-size: .7rem; letter-spacing: .04em; }
th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4) { text-align: left; }
td:nth-child(2) { max-width: 250px; white-space: normal; font-weight: 800; }
.group-badge { display: inline-flex; min-height: 26px; align-items: center; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-deep); font-size: .68rem; font-weight: 900; }
.group-badge.normalized { background: color-mix(in srgb, #efad46 30%, transparent); color: #9a5a00; }

.ea-catalog { background: var(--bg); }
.search-label { display: block; margin-top: 28px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.ea-search { width: 100%; min-height: 50px; margin: 6px 0 20px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; }
.ea-list { display: grid; gap: 12px; }
.ea-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: clip; }
.ea-card > summary { min-height: 76px; display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 14px; cursor: pointer; list-style: none; }
.ea-card > summary::-webkit-details-marker { display: none; }
.ea-rank { color: var(--accent-deep); font-size: 1.35rem; font-weight: 900; }
.ea-title { min-width: 0; }
.ea-title strong { display: block; line-height: 1.25; }
.ea-title small { color: var(--muted); }
.market-link { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-deep) 55%, transparent); text-underline-offset: 3px; }
.market-link:hover, .market-link:focus-visible { color: var(--accent-deep); text-decoration-color: currentColor; }
.table-price { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.price-note { margin: -8px 0 18px; padding: 12px 14px; border-left: 3px solid var(--accent-deep); background: var(--surface); color: var(--muted); font-size: .78rem; }
.ea-quick { text-align: right; font-variant-numeric: tabular-nums; }
.ea-quick strong { display: block; }
.ea-card[open] > summary { border-bottom: 1px solid var(--line); }
.ea-body { padding: 18px 14px 24px; }
.meta-grid, .metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0 0 20px; border: 1px solid var(--line); background: var(--line); }
.meta-grid div, .metric-grid div { padding: 12px; background: var(--surface); }
.meta-grid dt, .metric-grid dt { color: var(--muted); font-size: .68rem; }
.meta-grid dd, .metric-grid dd { margin: 3px 0 0; font-size: .8rem; font-weight: 800; }
.metric-grid dd { font-size: 1rem; font-variant-numeric: tabular-nums; }
.ea-copy-grid { display: grid; gap: 12px; margin-block: 20px; }
.copy-panel { padding: 18px; border-radius: 14px; background: var(--bg); }
.copy-panel h4 { margin: 0 0 8px; }
.copy-panel p { margin: 0; color: var(--muted); font-size: .86rem; }
.copy-panel.measured { border-left: 4px solid var(--accent-deep); }
.copy-panel.hearsay { border-left: 4px solid #efad46; }
.source-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--accent-deep); font-weight: 800; }
.ea-charts { display: grid; gap: 16px; margin-top: 22px; }
.mini-chart { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.mini-chart canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.mini-chart figcaption { margin-bottom: 8px; font-size: .78rem; font-weight: 800; }
.long-short { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.long-short div { padding: 14px; border-radius: 12px; background: var(--bg); }
.long-short strong { display: block; }
.long-short span { color: var(--muted); font-size: .74rem; }
.data-note { margin-top: 16px; color: var(--muted); font-size: .72rem; }

.method { background: var(--surface); }
.narrow { max-width: 820px; }
.method-grid { display: grid; gap: 14px; margin-top: 28px; }
.method-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
.method-grid h3 { margin-top: 0; }
.method-grid ul { margin-bottom: 0; padding-left: 20px; color: var(--muted); }
.conclusion { background: var(--accent); color: #172000; }
.conclusion .section-kicker { color: #456500; }
.conclusion p { font-size: 1.02rem; }

@media (min-width: 720px) {
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .card-row { grid-auto-columns: minmax(300px, 31%); }
  .takeaways, .outline-grid { grid-template-columns: repeat(3, 1fr); }
  .outline-grid article:last-child { grid-column: span 3; }
  .chart-card { padding: 34px; }
  .pf-row { grid-template-columns: 250px 1fr; }
  .pf-label { font-size: .9rem; }
  .diagram-grid { grid-template-columns: repeat(2, 1fr); }
  .diagram-grid figure:last-child { grid-column: span 2; }
  .ea-body { padding: 28px; }
  .meta-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-grid { grid-template-columns: repeat(5, 1fr); }
  .ea-copy-grid { grid-template-columns: repeat(2, 1fr); }
  .ea-charts { grid-template-columns: repeat(3, 1fr); }
  .method-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 980px) {
  .diagram-grid { grid-template-columns: repeat(3, 1fr); }
  .diagram-grid figure:last-child { grid-column: auto; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #12140f; --surface: #1c2018; --ink: #f1f3ea; --muted: #afb4a7; --line: #394032; --accent-deep: #b7ed3a; --shadow: none; }
  .pf-value { color: #f5f7ef; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
  .group-badge.normalized { color: #ffc56a; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
