:root {
  --ink: #202b4a;
  --ink-soft: #5a6177;
  --paper: #f4f2ef;
  --paper-deep: #e5e1e8;
  --card: #fffdfb;
  --line: #cec8d4;
  --accent: #b64b68;
  --accent-dark: #8e3150;
  --gold: #b38a45;
  --sage: #e4e8f1;
  --shadow: 0 18px 45px rgba(32, 43, 74, .12);
  --radius: 22px;
  --sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 7%, rgba(182, 75, 104, .09), transparent 24rem),
    linear-gradient(90deg, rgba(32, 43, 74, .032) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 52px 52px, auto;
  font-family: var(--sans);
  line-height: 1.8;
}

a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: .6rem 1rem;
  color: #fff;
  background: var(--ink);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid #d78aa0; outline-offset: 3px; }

.site-header,
.site-footer,
.page-width { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .08em;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50% 50% 46% 54%;
  font-family: var(--serif);
  font-size: 1.2rem;
}
.brand-copy small { display: block; color: var(--ink-soft); font-size: .62rem; letter-spacing: .15em; font-weight: 600; }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: .6rem .75rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.62); }
.nav-toggle { display: none; border: 0; color: var(--ink); background: none; font-weight: 800; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 1rem;
  color: var(--accent-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }

.hero {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
  padding: clamp(58px, 9vw, 112px) 0 74px;
}
.hero h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.65rem, 6.2vw, 5.9rem);
  font-weight: 600;
  letter-spacing: -.06em;
  line-height: 1.04;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-lead { max-width: 680px; margin: 1.5rem 0 0; color: var(--ink-soft); font-size: 1.04rem; }
.hero-note { margin: 1.2rem 0 0; padding-left: 1rem; border-left: 3px solid var(--gold); color: var(--ink-soft); font-size: .86rem; }

.hero-art {
  position: relative;
  min-height: 470px;
  display: grid;
  place-items: center;
}
.sun-disc {
  position: absolute;
  width: min(26vw, 310px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  opacity: .93;
}
.name-slip {
  position: relative;
  width: min(280px, 72vw);
  min-height: 390px;
  padding: 42px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,253,251,.94);
  box-shadow: var(--shadow);
  border: 1px solid rgba(206,200,212,.92);
  transform: rotate(2deg);
}
.name-slip::before, .name-slip::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(32,43,74,.17); pointer-events: none; }
.name-slip::after { inset: 18px; border-color: rgba(182,75,104,.2); }
.slip-seal { align-self: flex-end; padding: .2rem .45rem; color: var(--accent); border: 1px solid currentColor; font-size: .74rem; writing-mode: vertical-rl; }
.slip-name { font-family: var(--serif); font-size: clamp(2.1rem, 4vw, 3.25rem); writing-mode: vertical-rl; letter-spacing: .13em; }
.slip-reading { color: var(--ink-soft); font-size: .76rem; letter-spacing: .14em; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.fact { padding: 22px 24px; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact strong { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.fact span { color: var(--ink-soft); font-size: .8rem; }

.section { padding: 92px 0; }
.section-head { display: grid; grid-template-columns: 1fr .8fr; gap: 48px; align-items: end; margin-bottom: 38px; }
.section-head h2, .prose-hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.1rem, 4.2vw, 4rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.15; }
.section-head p { margin: 0; color: var(--ink-soft); }

.workbench {
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr);
  background: var(--ink);
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: var(--shadow);
}
.control-panel { padding: clamp(28px, 5vw, 56px); color: #f7f3f7; }
.control-panel h3 { margin: 0 0 1.8rem; font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.field { position: relative; margin: 0 0 1.35rem; }
.field label, .field legend { display: block; margin-bottom: .52rem; color: #dce1ef; font-size: .8rem; font-weight: 800; letter-spacing: .05em; }
.field input, .field select {
  width: 100%;
  min-height: 50px;
  padding: .7rem .9rem;
  color: var(--ink);
  background: #fffdfb;
  border: 1px solid transparent;
  border-radius: 10px;
}
.field input[aria-expanded="true"] { border-color: #d78aa0; }
.field-help { display: block; margin-top: .35rem; color: #b7bfd3; font-size: .72rem; }

.surname-options {
  position: absolute;
  z-index: 20;
  top: calc(100% - 18px);
  right: 0;
  left: 0;
  max-height: 270px;
  margin: 0;
  padding: 7px;
  overflow: auto;
  list-style: none;
  color: var(--ink);
  background: #fffdfb;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 35px rgba(0,0,0,.2);
}
.surname-options[hidden] { display: none; }
.surname-options button { width: 100%; display: flex; justify-content: space-between; padding: .55rem .7rem; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; }
.surname-options button:hover, .surname-options button:focus { background: var(--sage); }
.surname-options small { color: var(--ink-soft); }

.segment { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment label { margin: 0; padding: .62rem .5rem; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; color: #f7f3f7; text-align: center; cursor: pointer; }
.segment input:checked + label { color: var(--ink); background: #f7f3f7; border-color: #f7f3f7; }
.segment input:focus-visible + label { outline: 3px solid #d78aa0; }

.primary-btn {
  width: 100%;
  min-height: 54px;
  margin-top: .5rem;
  padding: .8rem 1rem;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.primary-btn:hover { background: #c65c79; }
.primary-btn:disabled { opacity: .55; cursor: wait; }

.result-panel { min-height: 620px; padding: clamp(28px, 5vw, 56px); background: var(--card); border-radius: var(--radius); }
.result-empty { min-height: 500px; display: grid; place-items: center; color: var(--ink-soft); text-align: center; }
.result-empty .empty-mark { margin: 0 auto 1.2rem; width: 92px; height: 92px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-family: var(--serif); font-size: 2.5rem; }
.result-list { display: grid; gap: 18px; }
.result-card { position: relative; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.result-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); border-radius: 16px 0 0 16px; }
.result-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.generated-name { margin: 0; font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 600; letter-spacing: .05em; }
.generated-reading { display: block; margin-top: .15rem; color: var(--ink-soft); font-size: .78rem; letter-spacing: .1em; }
.copy-btn { flex: 0 0 auto; padding: .48rem .72rem; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: .76rem; }
.result-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 1rem 0; }
.tag { padding: .23rem .55rem; background: var(--sage); border-radius: 999px; color: #46526f; font-size: .72rem; }
.source-box { margin: 1.2rem 0; padding: 1rem 1.1rem; background: #f3eff4; border-left: 3px solid var(--gold); }
.source-box strong { display: block; margin-bottom: .25rem; font-family: var(--serif); }
.source-box p { margin: 0; color: var(--ink-soft); font-size: .85rem; }
.fortune-grid { display: grid; grid-template-columns: 100px 1fr; gap: 20px; align-items: center; padding-top: 1rem; border-top: 1px solid #e5e0e8; }
.fortune-total { width: 94px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; text-align: center; }
.fortune-total b { display: block; font-family: var(--serif); font-size: 1.65rem; line-height: 1; }
.fortune-total small { font-size: .62rem; }
.fortune-bars { display: grid; gap: 8px; }
.fortune-row { display: grid; grid-template-columns: 56px 1fr 30px; gap: 8px; align-items: center; font-size: .72rem; }
.bar { height: 6px; overflow: hidden; background: #e5e2e8; border-radius: 99px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: inherit; }
.fortune-note { margin: .85rem 0 0; color: var(--ink-soft); font-size: .78rem; }

.method-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.method-card { padding: 30px; background: var(--paper); }
.method-num { display: block; margin-bottom: 1.4rem; color: var(--accent); font-family: var(--serif); font-size: 1.5rem; }
.method-card h3 { margin: 0 0 .55rem; font-family: var(--serif); }
.method-card p { margin: 0; color: var(--ink-soft); font-size: .88rem; }

.notice { margin-top: 28px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); background: rgba(255,255,255,.45); font-size: .82rem; }

.theme-library { padding-top: 36px; }
.theme-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.theme-card { position: relative; min-height: 270px; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; grid-column: span 4; overflow: hidden; background: rgba(255,253,251,.82); border: 1px solid var(--line); border-radius: 18px; }
.theme-card:nth-child(1), .theme-card:nth-child(2), .theme-card:nth-child(3) { grid-column: span 4; }
.theme-card:nth-child(4), .theme-card:nth-child(5), .theme-card:nth-child(6), .theme-card:nth-child(7) { grid-column: span 3; }
.theme-card::after { content: ""; position: absolute; width: 140px; height: 140px; right: -56px; bottom: -64px; border: 1px solid rgba(182,75,104,.24); border-radius: 50%; }
.theme-glyph { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 50%; font-family: var(--serif); font-size: 1.15rem; }
.theme-kicker { margin: 1.15rem 0 .2rem; color: var(--accent-dark); font-size: .68rem; font-weight: 800; letter-spacing: .15em; }
.theme-card h3 { margin: 0; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
.theme-card > p:not(.theme-kicker) { margin: .65rem 0 1.2rem; color: var(--ink-soft); font-size: .83rem; }
.theme-action, .example-card button { margin-top: auto; padding: 0 0 .18rem; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid currentColor; font-size: .78rem; font-weight: 800; }
.theme-action[aria-pressed="true"] { color: var(--accent-dark); }
.theme-actions { width: 100%; margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.theme-actions a { color: var(--ink-soft); font-size: .75rem; }

.examples-section, .guide-library { background: var(--ink); color: #f7f3f7; }
.examples-section .section-head p, .guide-library .section-head p { color: #c4cbda; }
.examples-section .eyebrow, .guide-library .eyebrow { color: #eca2b6; }
.example-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.example-card { padding: 28px; display: flex; flex-direction: column; background: #fffdfb; color: var(--ink); border-radius: 18px; }
.example-name span { display: block; color: var(--ink-soft); font-size: .7rem; letter-spacing: .1em; }
.example-name strong { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 600; }
.example-source { margin: .8rem 0 1.2rem; padding: .4rem .6rem; color: var(--accent-dark); background: #f3e7ec; font-size: .72rem; }
.example-card h3 { margin: 0; font-family: var(--serif); }
.example-card > p:not(.example-source) { color: var(--ink-soft); font-size: .83rem; }

.surname-portal { padding: clamp(30px, 5vw, 58px); display: grid; grid-template-columns: .9fr 1.1fr; gap: 50px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.surname-portal h2 { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.3rem); font-weight: 600; }
.surname-portal p { color: var(--ink-soft); }
.portal-search label { display: block; margin-bottom: .55rem; font-size: .8rem; font-weight: 800; }
.portal-search > div { display: grid; grid-template-columns: 1fr auto; }
.portal-search input { min-width: 0; padding: .85rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 10px 0 0 10px; }
.portal-search button { padding: .8rem 1.1rem; color: #fff; background: var(--accent); border: 0; border-radius: 0 10px 10px 0; font-weight: 800; }

.rhythm-board { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.rhythm-sample { padding: 28px; display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; background: rgba(255,255,255,.45); }
.rhythm-sample + .rhythm-sample { border-left: 1px solid var(--line); }
.rhythm-sample span { color: var(--accent-dark); font-size: .7rem; font-weight: 800; }
.rhythm-sample b { font-family: var(--serif); font-weight: 600; letter-spacing: .08em; }
.rhythm-sample i { grid-column: 1 / -1; width: 30px; height: 1px; margin: .45rem 0; background: var(--gold); }
.rhythm-sample small { grid-column: 1 / -1; color: var(--ink-soft); }
.section-link { margin: 1.4rem 0 0; text-align: right; }
.section-link a { color: var(--accent-dark); font-weight: 800; text-underline-offset: 5px; }

.guide-grid { display: grid; grid-template-columns: repeat(5, 1fr); border-block: 1px solid rgba(255,255,255,.2); }
.guide-grid a { min-height: 230px; padding: 24px 20px; display: flex; flex-direction: column; text-decoration: none; border-right: 1px solid rgba(255,255,255,.2); }
.guide-grid a:last-child { border-right: 0; }
.guide-grid span { color: #eca2b6; font-size: .72rem; font-weight: 800; }
.guide-grid strong { margin: 2.7rem 0 .7rem; font-family: var(--serif); font-size: 1.08rem; }
.guide-grid small { color: #c4cbda; }
.guide-library .section-link a { color: #f7f3f7; }

.hub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 30px 0; }
.hub-card { padding: 26px; color: inherit; background: rgba(255,255,255,.52); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.hub-card:hover { border-color: var(--accent); }
.hub-card span { color: var(--accent-dark); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.hub-card h2, .hub-card h3 { margin: .5rem 0; font-family: var(--serif); font-weight: 600; }
.hub-card p { margin: 0; color: var(--ink-soft); font-size: .85rem; }
.name-collection { display: flex; flex-wrap: wrap; gap: 9px; margin: 1.2rem 0 2rem; }
.name-token { padding: .55rem .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-family: var(--serif); }
.article-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.5rem 0; }
.article-actions a { padding: .65rem 1rem; color: #fff; background: var(--ink); border-radius: 999px; text-decoration: none; font-size: .8rem; font-weight: 800; }

.motif-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 1.5rem 0 2rem; background: var(--line); border: 1px solid var(--line); }
.motif-band > div { min-height: 150px; padding: 20px; background: var(--card); }
.motif-band b { display: block; margin-bottom: .45rem; font-family: var(--serif); font-size: 1.1rem; }
.motif-band span { color: var(--ink-soft); font-size: .78rem; }
.reading-pattern { display: grid; grid-template-columns: 90px 1fr; gap: 14px; align-items: start; margin: .8rem 0; padding: 1rem; background: rgba(255,255,255,.5); border: 1px solid var(--line); border-radius: 10px; }
.reading-pattern strong { color: var(--accent-dark); font-family: var(--serif); }
.reading-pattern p { margin: 0; }

.checker { margin: 40px 0 90px; display: grid; grid-template-columns: .8fr 1.2fr; background: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.checker-form { padding: clamp(28px, 5vw, 50px); color: #fff; }
.checker-form h2 { margin-top: 0; font-family: var(--serif); font-weight: 600; }
.checker-field { margin: 0 0 1rem; }
.checker-field label { display: block; margin-bottom: .4rem; color: #dce1ef; font-size: .8rem; font-weight: 800; }
.checker-field input { width: 100%; min-height: 50px; padding: .7rem .9rem; border: 0; border-radius: 9px; }
.checker-output { min-height: 520px; padding: clamp(28px, 5vw, 50px); background: var(--card); }
.checker-empty { min-height: 420px; display: grid; place-items: center; color: var(--ink-soft); text-align: center; }
.score-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2rem 0; }
.score-pill { min-width: 108px; padding: .7rem .9rem; background: var(--sage); border-radius: 10px; }
.score-pill b { display: block; font-family: var(--serif); font-size: 1.4rem; }
.check-list { display: grid; gap: 10px; margin-top: 1.4rem; }
.check-item { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.check-item b { display: block; margin-bottom: .2rem; }
.check-item p { margin: 0; color: var(--ink-soft); font-size: .83rem; }

.glossary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 30px; }
.glossary-item { padding: 22px; background: rgba(255,255,255,.5); border: 1px solid var(--line); border-radius: 12px; }
.glossary-item dt { font-family: var(--serif); font-size: 1.18rem; font-weight: 700; }
.glossary-item dd { margin: .45rem 0 0; color: var(--ink-soft); font-size: .86rem; }

.site-footer { padding: 34px 0 48px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 34px; border-top: 1px solid var(--line); }
.footer-copy { color: var(--ink-soft); font-size: .78rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; gap: .3rem 1rem; }
.footer-nav a { color: var(--ink-soft); font-size: .78rem; text-underline-offset: 4px; }

.prose-hero { padding: 72px 0 34px; border-bottom: 1px solid var(--line); }
.prose-hero p { max-width: 720px; color: var(--ink-soft); }
.prose-layout { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 70px; padding: 56px 0 96px; }
.toc { position: sticky; top: 24px; align-self: start; display: grid; gap: .55rem; }
.toc strong { margin-bottom: .4rem; font-size: .8rem; }
.toc a { color: var(--ink-soft); font-size: .8rem; text-decoration: none; }
.toc a:hover { color: var(--accent-dark); }
.prose h2 { margin: 2.7rem 0 .7rem; font-family: var(--serif); font-size: 1.65rem; font-weight: 600; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.7rem 0 .45rem; font-size: 1rem; }
.prose p, .prose li { color: #4c566f; font-size: .93rem; }
.prose a { color: var(--accent-dark); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.prose th, .prose td { padding: .72rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { white-space: nowrap; }
.callout { margin: 1.5rem 0; padding: 1rem 1.1rem; background: var(--sage); border-radius: 10px; }

.directory-tools { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin: 32px 0 18px; }
.directory-search { min-height: 54px; padding: .75rem 1rem; background: #fffdfb; border: 1px solid var(--line); border-radius: 10px; }
.kana-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.kana-filter button { min-width: 38px; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: transparent; }
.kana-filter button.active { color: #fff; background: var(--ink); border-color: var(--ink); }
.directory-status { color: var(--ink-soft); font-size: .83rem; }
.surname-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0 30px; }
.surname-item { padding: 15px; display: flex; justify-content: space-between; gap: 12px; color: inherit; background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.surname-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.surname-item b { font-family: var(--serif); font-size: 1.05rem; }
.surname-item small { color: var(--ink-soft); font-size: .7rem; }
.load-more { display: block; min-width: 210px; margin: 0 auto; padding: .7rem 1rem; color: #fff; background: var(--ink); border: 0; border-radius: 999px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; padding: .75rem 1rem; color: #fff; background: var(--ink); border-radius: 8px; box-shadow: var(--shadow); transform: translateY(160%); transition: transform .2s ease; }
.toast.show { transform: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .main-nav { position: absolute; z-index: 40; top: 76px; right: 20px; left: 20px; padding: 12px; display: none; flex-direction: column; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 390px; }
  .sun-disc { width: 240px; }
  .name-slip { min-height: 340px; }
  .section-head, .workbench, .prose-layout { grid-template-columns: 1fr; }
  .toc { position: static; grid-template-columns: repeat(2, 1fr); padding-bottom: 22px; border-bottom: 1px solid var(--line); }
  .toc strong { grid-column: 1 / -1; }
  .surname-grid { grid-template-columns: repeat(2, 1fr); }
  .theme-card, .theme-card:nth-child(n), .example-grid > *, .guide-grid > * { grid-column: auto; }
  .theme-grid, .example-grid, .rhythm-board, .surname-portal { grid-template-columns: 1fr 1fr; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-grid a { min-height: 190px; border-bottom: 1px solid rgba(255,255,255,.2); }
  .rhythm-sample + .rhythm-sample { border-left: 0; }
  .motif-band { grid-template-columns: repeat(2, 1fr); }
  .checker { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .site-header, .site-footer, .page-width { width: min(100% - 26px, 1180px); }
  .site-header { min-height: 72px; }
  .brand-copy small { display: none; }
  .hero { padding-top: 44px; }
  .hero h1 { font-size: clamp(2.45rem, 14vw, 4rem); }
  .facts { grid-template-columns: 1fr; }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--line); }
  .section { padding: 64px 0; }
  .section-head { gap: 16px; }
  .control-panel, .result-panel { padding: 25px 20px; }
  .result-panel { min-height: 500px; }
  .result-top, .fortune-grid { grid-template-columns: 1fr; }
  .fortune-grid { display: grid; }
  .fortune-total { width: 78px; }
  .method-strip { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }
  .prose-hero { padding-top: 52px; }
  .prose-layout { gap: 32px; }
  .directory-tools { grid-template-columns: 1fr; }
  .surname-grid { grid-template-columns: 1fr; }
  .theme-grid, .example-grid, .rhythm-board, .surname-portal, .hub-grid { grid-template-columns: 1fr; }
  .theme-card { min-height: 240px; }
  .portal-search > div { grid-template-columns: 1fr; gap: 8px; }
  .portal-search input, .portal-search button { border-radius: 10px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-grid a { min-height: auto; }
  .guide-grid strong { margin-top: 1.2rem; }
  .motif-band, .glossary-grid { grid-template-columns: 1fr; }
}

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