:root {
  --paper: #F5F8F7;
  --surface: #FFFFFF;
  --ink: #1C2B29;
  --muted: #55665F;
  --line: #D3DDDA;
  --uv: #4537C4;
  --uv-soft: #ECEAFB;
  --sun: #F5C64A;
  --sun-soft: #FFF6D9;
  --measure: 40em;
  --gutter: 16px;
  --body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --head: "Zen Maru Gothic", "BIZ UDPGothic", "Hiragino Maru Gothic ProN", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.9;
  letter-spacing: 0.02em;
  font-feature-settings: "palt" 0;
  overflow-x: hidden;
}
a { color: var(--uv); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--uv); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { word-break: auto-phrase; }

.wrap { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* ---------- header with light beam ---------- */
.site-head { position: relative; background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; }
.beam {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 0 58%, var(--sun-soft) 58% 74%, transparent 74%);
}
.head-inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; padding-top: 14px; padding-bottom: 12px; }
.logo { font-family: var(--head); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: 0.04em; }
.gnav { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 0.9375rem; }
@media (max-width: 640px) {
  .head-inner { flex-direction: column; align-items: flex-start; }
  .gnav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; white-space: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  .gnav::-webkit-scrollbar { display: none; }
}
.gnav a { color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.gnav a:hover { border-bottom-color: var(--line); }
.gnav a[aria-current="page"] { border-bottom-color: var(--uv); }

/* ---------- home hero ---------- */
.hero { position: relative; margin: 0 calc(-1 * var(--gutter)); padding: 72px var(--gutter) 64px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -40%; right: -10%; width: 70%; height: 180%;
  background: linear-gradient(180deg, rgba(245, 198, 74, 0.55), rgba(245, 198, 74, 0.08));
  transform: rotate(24deg); transform-origin: top right;
  animation: beam-in 1.6s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes beam-in { from { opacity: 0; transform: rotate(10deg); } to { opacity: 1; transform: rotate(24deg); } }
@media (prefers-reduced-motion: reduce) { .hero::before { animation: none; } }
.hero > * { position: relative; }
.hero h1 {
  font-family: var(--head); font-weight: 700;
  font-size: clamp(1.9rem, 5.4vw, 3.4rem); line-height: 1.35; letter-spacing: 0.02em;
  margin: 0 0 24px; max-width: 15em;
}
.hero .lead { max-width: 34em; font-size: 1.0625rem; color: var(--ink); margin: 0; }

.home-section { margin: 56px 0; }
.home-section > h2 { font-family: var(--head); font-size: 1.5rem; line-height: 1.5; margin: 0 0 8px; }
.home-section > p { max-width: var(--measure); color: var(--muted); margin: 0 0 20px; }

.scenes { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.scenes li { border-bottom: 1px solid var(--line); padding: 22px 0; display: grid; grid-template-columns: 12rem 1fr; gap: 6px 32px; align-items: baseline; }
.scenes h3 { margin: 0; font-family: var(--head); font-size: 1.3rem; line-height: 1.5; }
.scenes h3 a { color: var(--ink); text-decoration: none; }
.scenes h3 a:hover { color: var(--uv); }
.scenes p { margin: 0 0 6px; }
.scenes .sub { font-size: 0.9375rem; display: flex; flex-wrap: wrap; gap: 4px 20px; }
@media (max-width: 640px) { .scenes li { grid-template-columns: 1fr; } }

.starter { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 32px; }
.starter li { border-top: 1px solid var(--line); padding: 16px 0; }
.starter a { font-weight: 700; }
.starter span { display: block; color: var(--muted); font-size: 0.9375rem; margin-top: 4px; }

.policy { background: var(--surface); border-left: 4px solid var(--uv); padding: 20px 24px; max-width: var(--measure); }
.policy p { margin: 0 0 8px; }
.policy p:last-child { margin: 0; }

/* ---------- article ---------- */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0 4px; padding: 0; margin: 20px 0 0; font-size: 0.8125rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
.breadcrumb a { color: var(--muted); }

.article { max-width: var(--measure); }
.article-head { padding: 28px 0 8px; }
.article-head h1 { font-family: var(--head); font-weight: 700; font-size: clamp(1.6rem, 4.2vw, 2.3rem); line-height: 1.45; margin: 0 0 14px; letter-spacing: 0.02em; }
.byline { font-size: 0.8125rem; color: var(--muted); margin: 0 0 18px; }
.article-head .lead { font-size: 1.0625rem; margin: 0; padding: 16px 20px; background: var(--sun-soft); border-radius: 4px; }

.toc { margin: 28px 0 8px; padding: 18px 22px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.toc-title { margin: 0 0 6px; font-weight: 700; font-size: 0.9375rem; }
.toc ol { margin: 0; padding-left: 1.4em; font-size: 0.9375rem; line-height: 1.8; }

.prose h2 { font-family: var(--head); font-size: 1.45rem; line-height: 1.5; margin: 56px 0 16px; padding-top: 14px; border-top: 2px solid var(--ink); }
.prose h3 { font-size: 1.125rem; line-height: 1.6; margin: 32px 0 8px; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: 0.25em 0; }
.prose strong { background: linear-gradient(transparent 62%, var(--sun-soft) 62%); }
.prose blockquote { margin: 0 0 1.2em; padding: 4px 0 4px 18px; border-left: 3px solid var(--line); color: var(--muted); }

.table-scroll { overflow-x: auto; margin: 0 0 1.4em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; line-height: 1.7; background: var(--surface); }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: #EEF3F1; font-weight: 700; white-space: nowrap; }

.note, .caution { padding: 16px 20px; margin: 0 0 1.4em; border-radius: 4px; }
.note { background: var(--uv-soft); }
.caution { background: #FFF1EC; border-left: 4px solid #B6462A; }
.note > :last-child, .caution > :last-child { margin-bottom: 0; }
.note-title { font-weight: 700; margin: 0 0 4px !important; }

/* 3 conditions — the recurring device */
.conditions { margin: 32px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.conditions-title { margin: 0; padding: 12px 20px; font-weight: 700; background: linear-gradient(115deg, var(--sun-soft) 0 60%, var(--surface) 60%); border-bottom: 1px solid var(--line); }
.conditions dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.conditions dl > div { padding: 14px 20px 16px; border-right: 1px solid var(--line); }
.conditions dl > div:last-child { border-right: 0; }
.conditions dt { font-family: var(--head); font-size: 1.6rem; line-height: 1.3; color: var(--uv); margin-bottom: 4px; }
.conditions dd { margin: 0; font-size: 0.9375rem; line-height: 1.75; }
@media (max-width: 640px) {
  .conditions dl { grid-template-columns: 1fr; }
  .conditions dl > div { border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 3rem 1fr; gap: 12px; align-items: baseline; }
  .conditions dl > div:last-child { border-bottom: 0; }
}

.faq h2, .sources h2, .related h2 { font-family: var(--head); font-size: 1.3rem; margin: 56px 0 12px; padding-top: 14px; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style-position: outside; margin-left: 1.1em; }
.faq details[open] summary { color: var(--uv); }
.faq details p { margin: 0 0 12px; }

.sources ul { padding-left: 1.2em; font-size: 0.875rem; line-height: 1.8; color: var(--muted); }

.related { max-width: var(--measure); margin-bottom: 64px; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { border-bottom: 1px solid var(--line); }
.related a { display: block; padding: 14px 0; text-decoration: none; color: var(--ink); }
.related a:hover .rel-t { color: var(--uv); text-decoration: underline; }
.rel-t { display: block; font-weight: 700; }
.rel-d { display: block; font-size: 0.875rem; color: var(--muted); line-height: 1.7; margin-top: 2px; }

/* ---------- footer ---------- */
.site-foot { margin-top: 72px; background: var(--ink); color: #DCE6E3; padding: 40px 0 28px; font-size: 0.875rem; }
.site-foot a { color: #FFFFFF; }
.foot-name { font-family: var(--head); font-size: 1.05rem; color: #FFFFFF; margin: 0 0 6px; }
.foot-desc { max-width: 40em; margin: 0 0 16px; line-height: 1.8; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 20px; }
.copy { margin: 0; color: #9FB2AD; }

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .hero { padding: 48px var(--gutter) 44px; }
  .hero::before { width: 90%; }
  .prose h2 { margin-top: 44px; }
}
@media print { .site-head, .site-foot, .toc, .related { display: none; } }
