/* CubeRealm.io Wiki - bright block-sandbox theme.
   Identity derived from the game: sky, grass, dirt, sun, voxel geometry.
   Self-hosted fonts, no images, no tracking. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-400-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/Nunito-400-normal.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1f2d3a;
  --ink-soft: #3c5164;
  --muted: #6a7b8a;
  --cream: #fffaf0;
  --paper: #ffffff;
  --line: #e2e8de;
  --line-strong: #cfd9cb;
  --sky: #dff4ff;
  --sky-soft: #eefaff;
  --sky-deep: #7cc9ef;
  --blue: #2b8cc4;
  --blue-dark: #1d6b99;
  --grass: #6fcf4a;
  --grass-soft: #eaf9e2;
  --green: #2f9e44;
  --green-dark: #1f6b2e;
  --dirt: #b07a4a;
  --dirt-dark: #7d5236;
  --sun: #ffd166;
  --sun-soft: #fff3d1;
  --sun-dark: #d99a1f;
  --header: #173b32;
  --header-soft: #1f4b3f;
  --radius: 18px;
  --shadow: 0 12px 28px rgba(31, 45, 58, 0.10);
  --font-display: "Fredoka", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  background-color: var(--cream);
  background-image:
    radial-gradient(900px 520px at 82% -10%, rgba(124, 201, 239, 0.24), transparent 62%),
    radial-gradient(760px 460px at 4% 102%, rgba(111, 207, 74, 0.13), transparent 64%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--sun); color: var(--ink); }

/* Japanese sample fallback: the Latin fonts do not include kana/kanji. */
html[lang="ja"] body {
  font-family: "Nunito", "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] .brand-name,
html[lang="ja"] .start-title,
html[lang="ja"] .hub-card-title,
html[lang="ja"] .stat-num {
  font-family: "Fredoka", "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
html[lang="ja"] .article-head h1 { line-height: 1.3; letter-spacing: 0; word-break: auto-phrase; }
html[lang="ja"] .hub-head h1 { font-size: clamp(1.8rem, 3.2vw, 2.55rem); word-break: auto-phrase; }
html[lang="ja"] .prose h2,
html[lang="ja"] .prose h3,
html[lang="ja"] .hub-card-desc,
html[lang="ja"] .start-desc,
html[lang="ja"] .article-lede,
html[lang="ja"] .faq-card p { word-break: auto-phrase; }
html[lang="ja"] .hub-card-more span[aria-hidden="true"],
html[lang="ja"] .rail-links a span[aria-hidden="true"],
html[lang="ja"] .start-more span[aria-hidden="true"] {
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}
html[lang="ja"] .article-lede,
html[lang="ja"] .prose blockquote { font-style: normal; }
html[lang="ja"] .prose { line-break: strict; }
html[lang="ja"] .prose h2,
html[lang="ja"] .prose h3 { line-height: 1.45; }

a { color: var(--green-dark); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--green); }

img { max-width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.page-shell { position: relative; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 14px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 800;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 12px; top: 12px; }

.pixel-label {
  display: block;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--green);
}

.glow-spark { color: var(--green); }

/* Generic panel (legacy class name kept for template compatibility) */
.pixel-frame {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 50;
  background: var(--header);
  border-bottom: 4px solid var(--green);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 78px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--cream);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { color: var(--cream); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  background: rgba(255, 250, 240, 0.1);
  border: 2px solid rgba(255, 250, 240, 0.25);
  border-radius: 13px;
}
.brand-text { min-width: 0; }
.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.1;
}
.brand-sub {
  display: block;
  margin-top: 4px;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #a9c9b9;
}

.top-nav { margin-left: auto; }
.nav-inner { display: flex; align-items: center; gap: 3px; }
.nav-link {
  display: block;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #d7e9df;
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.10); }
.nav-link.active { color: var(--ink); background: var(--sun); }
.nav-link.active:hover { color: var(--ink); background: var(--sun); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.search-link,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--cream);
  background: transparent;
  border: 2px solid rgba(255, 250, 240, 0.35);
  border-radius: 10px;
  cursor: pointer;
}
.search-link:hover,
.nav-toggle:hover { color: var(--ink); background: var(--sun); border-color: var(--sun); }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn-pixel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  color: #fff;
  background: var(--green);
  border: 2px solid var(--green);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--green-dark);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn-pixel:hover {
  color: #fff;
  background: #38b552;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--green-dark);
}
.btn-pixel:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-dark); }
.btn-ghost {
  color: var(--ink);
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: 0 5px 0 #d7dfd2;
}
.btn-ghost:hover {
  color: var(--ink);
  background: var(--sun-soft);
  border-color: var(--sun);
  box-shadow: 0 7px 0 #d7dfd2;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 360px at 82% 10%, rgba(255, 209, 102, 0.30), transparent 62%),
    linear-gradient(180deg, #e9f8ff 0%, #f7fcff 54%, var(--cream) 100%);
  border-bottom: 2px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: 48px;
  padding: 64px 0 58px;
}
.hero-copy { min-width: 0; }
.hero h1 {
  margin: 12px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.2vw, 4.15rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.hero-line { display: block; overflow-wrap: break-word; }
.hero-line.glow-spark { color: var(--green); }
.hero-tagline {
  margin: 0 0 12px;
  max-width: 560px;
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  font-weight: 700;
  color: var(--ink-soft);
}
.hero-desc {
  margin: 0 0 26px;
  max-width: 600px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art {
  width: 100%;
  min-width: 0;
  max-width: 540px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: linear-gradient(180deg, #cdefff, #eafaff);
  box-shadow: 12px 12px 0 rgba(31, 45, 58, 0.12);
}
.scene-svg { display: block; width: 100%; height: auto; }

/* ---------- Home ---------- */
.home-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  align-items: start;
  gap: 48px;
  padding: 56px 0 48px;
}
.home-intro { max-width: none; }
.stat-panel {
  padding: 22px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.stat-panel > .pixel-label { margin-bottom: 14px; color: var(--blue); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 16px 6px;
  text-align: center;
  border-radius: 14px;
  background: var(--sky-soft);
}
.stat:nth-child(2) { background: var(--grass-soft); }
.stat:nth-child(3) { background: var(--sun-soft); }
.stat:nth-child(4) { background: #eef2ff; }
.stat:nth-child(5) { background: #fff0e6; }
.stat:nth-child(6) { background: #f3eefe; }
.stat-num {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}
.stat-label {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-note { margin: 14px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.stat-note a { color: var(--green-dark); font-weight: 700; }

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 22px;
}
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}
.section-head h2::before {
  content: "";
  width: 12px;
  height: 26px;
  background: var(--grass);
  border-radius: 4px;
  box-shadow: 4px 4px 0 rgba(111, 207, 74, 0.22);
}
.section-head .rule { flex: 1; height: 3px; background: var(--line); border-radius: 2px; }
.section-head a,
.section-count {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.section-head a:hover { color: var(--green-dark); }

.home-start { padding: 6px 0 52px; }
.start-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.start-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.start-card:nth-child(1) { border-top: 7px solid var(--grass); }
.start-card:nth-child(2) { border-top: 7px solid var(--blue); }
.start-card:nth-child(3) { border-top: 7px solid var(--sun); }
.start-card:hover {
  color: var(--ink);
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 34px rgba(31, 45, 58, 0.14);
}
.start-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.start-num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--grass-soft);
  border-radius: 11px;
}
.start-card:nth-child(2) .start-num { color: var(--blue-dark); background: var(--sky-soft); }
.start-card:nth-child(3) .start-num { color: var(--sun-dark); background: var(--sun-soft); }
.start-title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.2;
}
.start-desc { color: var(--muted); font-size: 0.93rem; line-height: 1.55; }
.start-more {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-dark);
}

.home-faq { padding: 6px 0 50px; }
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.faq-card {
  padding: 20px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(31, 45, 58, 0.06);
}
.faq-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}
.faq-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

.home-sources { padding: 24px 0 60px; border-top: 2px solid var(--line); }
.home-sources h2 { margin: 0 0 12px; color: var(--muted); }
.source-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.source-list a { color: var(--ink-soft); font-size: 0.86rem; }
.source-list a:hover { color: var(--green-dark); }

/* ---------- Breadcrumbs & status ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}
.breadcrumbs a { color: var(--green-dark); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  border-radius: 999px;
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-verified { color: var(--green-dark); background: var(--grass-soft); }
.status-needs { color: #9a6a0a; background: var(--sun-soft); }
.status-draft { color: var(--muted); background: #eef1f4; }

/* ---------- Article ---------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 50px;
  padding: 42px 0 78px;
}
.article { min-width: 0; max-width: 820px; }
.article-head {
  margin: 15px 0 28px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--line);
}
.article-head h1 {
  margin: 10px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.3vw, 2.65rem);
  font-weight: 600;
  line-height: 1.08;
  overflow-wrap: break-word;
  color: var(--ink);
}
.article-lede {
  margin: 0 0 16px;
  max-width: 680px;
  color: var(--muted);
  font-size: 1.04rem;
  font-style: italic;
  line-height: 1.6;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.article-rail {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rail-card { padding: 0; overflow: hidden; }
.rail-title {
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  background: var(--sky-soft);
  color: var(--blue-dark);
}
.rail-rows { margin: 0; }
.rail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.rail-row:last-child { border-bottom: 0; }
.rail-row dt {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.rail-row dd { margin: 0; text-align: right; font-size: 0.86rem; font-weight: 700; color: var(--ink); }
.rail-row dd a { color: var(--green-dark); text-decoration: none; }
.rail-row dd a:hover { text-decoration: underline; }
.rail-toc { display: flex; flex-direction: column; padding: 8px; }
.rail-toc a {
  display: block;
  padding: 7px 9px;
  color: var(--ink-soft);
  font-size: 0.83rem;
  line-height: 1.4;
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
}
.rail-toc a:hover {
  color: var(--green-dark);
  border-left-color: var(--grass);
  background: var(--grass-soft);
}
.rail-links { margin: 0; padding: 8px; list-style: none; }
.rail-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}
.rail-links a:hover { color: var(--green-dark); background: var(--grass-soft); }

/* ---------- Prose ---------- */
.prose { color: var(--ink); font-size: 1.04rem; line-height: 1.8; }
.prose p { margin: 0 0 1.2em; }
.prose h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2em 0 0.6em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.prose h2::before {
  content: "";
  width: 10px;
  height: 22px;
  flex-shrink: 0;
  background: var(--grass);
  border-radius: 3px;
}
.prose h3 {
  margin: 1.6em 0 0.4em;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--blue-dark);
}
.prose ul { margin: 0 0 1.25em; padding-left: 0; list-style: none; }
.prose ul li { position: relative; margin: 0.35em 0; padding-left: 1.35em; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.64em;
  width: 8px;
  height: 8px;
  background: var(--grass);
  border-radius: 2px;
}
.prose ol { margin: 0 0 1.25em; padding-left: 1.45em; }
.prose ol li { margin: 0.35em 0; }
.prose ol li::marker { color: var(--green-dark); font-weight: 800; }
.prose strong { color: var(--ink); font-weight: 800; }
.prose hr { margin: 2em 0; border: 0; border-top: 2px solid var(--line); }
.prose a { color: var(--green-dark); text-decoration: underline; text-decoration-color: #9bd68f; }
.prose a:hover { color: var(--green); text-decoration-color: var(--green); }
.prose a.external::after { content: " \2197"; font-size: 0.75em; color: var(--muted); }
.prose blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  background: var(--sky-soft);
  border-left: 5px solid var(--sky-deep, #7cc9ef);
  border-radius: 0 12px 12px 0;
  color: var(--ink-soft);
  font-style: italic;
}
.prose blockquote p { margin: 0; }
.prose code {
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  color: var(--ink);
  background: var(--sun-soft);
  border: 1px solid #f0dfae;
  border-radius: 6px;
}
.prose pre {
  margin: 0 0 1.5em;
  padding: 18px;
  overflow-x: auto;
  background: var(--header);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(23, 59, 50, 0.18);
}
.prose pre code {
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #e9f5ee;
  background: none;
  border: 0;
}

.table-wrap {
  width: 100%;
  margin: 0 0 1.5em;
  overflow-x: auto;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(31, 45, 58, 0.06);
}
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th {
  padding: 11px 14px;
  text-align: left;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-dark);
  background: var(--grass-soft);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  vertical-align: top;
  text-align: left;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
tbody tr:nth-child(even) { background: #fbfdf9; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

.correction {
  margin-top: 30px;
  padding: 14px 16px;
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.correction strong { color: var(--ink-soft); }
.correction a { color: var(--green-dark); }

/* ---------- Section hubs ---------- */
.hub-page { padding: 42px 0 78px; }
.hub-head { margin-bottom: 32px; }
.hub-head h1 { font-size: clamp(2rem, 4vw, 3.05rem); }
.hub-intro { max-width: 860px; }
.hub-section { margin-top: 40px; }
.hub-section + .hub-intro { margin-top: 38px; }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.hub-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.hub-card:nth-child(3n + 1) { border-top: 6px solid var(--grass); }
.hub-card:nth-child(3n + 2) { border-top: 6px solid var(--blue); }
.hub-card:nth-child(3n) { border-top: 6px solid var(--sun); }
.hub-card:hover {
  color: var(--ink);
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 34px rgba(31, 45, 58, 0.14);
}
.hub-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hub-read { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.hub-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
}
.hub-card-desc { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.hub-card-more {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-dark);
}
.hub-sources {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 2px solid var(--line);
}
.hub-sources h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hub-sources h2::before { display: none; }
.hub-sources ul { margin: 0; padding: 0; list-style: none; }
.hub-sources li { margin: 4px 0; }
.hub-sources a { color: var(--ink-soft); font-size: 0.86rem; }
.hub-sources a:hover { color: var(--green-dark); }

/* ---------- Search ---------- */
.search-page { max-width: 840px; min-height: 58vh; padding: 60px 0 86px; }
.search-page h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
}
.search-page > p { margin: 0 0 22px; color: var(--muted); }
.search-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(31, 45, 58, 0.06);
  outline: none;
}
.search-input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(111, 207, 74, 0.18); }
.search-results { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.search-hit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.search-hit:hover { color: var(--ink); border-color: var(--green); box-shadow: 0 8px 20px rgba(31, 45, 58, 0.08); }
.search-hit strong { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.search-hit span { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.muted { color: var(--muted); }

.not-found { max-width: 660px; padding: 96px 0 120px; }
.not-found h1 {
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.05;
}
.not-found p { color: var(--muted); }
.not-found .btn-pixel { margin-top: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 18px;
  background: var(--header);
  color: #cfe3d7;
  border-top: 4px solid var(--grass);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(150px, 0.55fr));
  gap: 40px;
  padding: 46px 0 32px;
}
.footer-brand {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--cream);
}
.footer-brand-col .pixel-label { color: #9fc7b2; margin-bottom: 12px; }
.footer-note { margin: 0; max-width: 470px; color: #b7d0c2; font-size: 0.9rem; line-height: 1.6; }
.footer-title {
  margin: 0 0 12px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fc7b2;
}
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links a { display: block; padding: 5px 0; color: #d8e9df; font-size: 0.9rem; text-decoration: none; }
.footer-links a:hover { color: var(--sun); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 0 26px;
  border-top: 1px solid rgba(255, 250, 240, 0.14);
  color: #94b4a2;
  font-size: 0.75rem;
}

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-copy { animation: rise 0.5s ease both; }
.hero-art { animation: rise 0.5s ease 0.1s both; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 36px; }
  .home-overview { gap: 36px; }
}

@media (max-width: 1000px) {
  .hub-grid,
  .hub-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .header-inner { min-height: 68px; gap: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-name { font-size: 1rem; }
  .nav-toggle { display: inline-flex; }
  .top-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    margin: 0;
    background: var(--header);
    border-bottom: 4px solid var(--green);
    box-shadow: 0 18px 30px rgba(31, 45, 58, 0.22);
  }
  .site-header.nav-open .top-nav { display: block; }
  .nav-inner { flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 16px 16px; }
  .nav-link { width: 100%; padding: 12px 14px; border-radius: 10px; }

  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 30px; padding: 46px 0 46px; }
  .hero-art { max-width: 100%; }
  .home-overview { grid-template-columns: 1fr; gap: 32px; padding: 42px 0 38px; }
  .article-layout { grid-template-columns: 1fr; gap: 34px; padding-top: 28px; }
  .article { max-width: none; }
  .article-rail { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .start-grid { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .hub-grid,
  .hub-grid--three { grid-template-columns: 1fr; }
  .article-rail { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .header-actions { gap: 6px; }
  .search-link { display: none; }
  .brand { gap: 9px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 0.86rem; }
  .brand-sub { display: none; }
  .hero h1 { font-size: clamp(2.1rem, 8.6vw, 2.7rem); }
  .hero-tagline { font-size: 1rem; }
  .hero-actions { gap: 10px; }
  .btn-pixel { padding: 12px 14px; font-size: 0.8rem; }
  .article-head h1 { font-size: 1.8rem; }
  .article-meta { font-size: 0.66rem; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  th, td { padding: 9px 10px; }
  table { font-size: 0.86rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

