/* Hato Sound Lab — institute-style editorial design: paper, ink, ruled sections, serif headings */
:root {
  --paper: #f5f3ec; --paper2: #ece8db; --ink: #111a24; --mute: #5a6470; --rule: #cdc6b3; --rule2: #e0dac9;
  --accent: #1d4e63; --accent2: #8a2f2f;
  --serif: "Shippori Mincho", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 32px);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.9; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

/* header */
.topstrip { background: var(--ink); color: #cfd5dc; font-size: 11px; letter-spacing: .08em; }
.topstrip .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.mark { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: .08em; border: 1.5px solid var(--ink); padding: 5px 7px; line-height: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--serif); font-weight: 800; font-size: 19px; letter-spacing: .02em; }
.brand-text small { font-size: 11px; color: var(--mute); letter-spacing: .1em; }
.nav { display: flex; gap: 22px; font-size: 14px; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; width: 42px; height: 42px; background: none; border: 1px solid var(--rule); cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: transform .2s; }
.nav-toggle span:first-child { top: 15px; } .nav-toggle span:last-child { top: 24px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* page heads */
main { padding-bottom: 72px; }
.crumbs { font-size: 12px; color: var(--mute); padding: 18px 0 0; }
.crumbs a { color: var(--mute); }
.page-head { padding: 28px 0 22px; }
.code { font-size: 12px; color: var(--accent); margin-bottom: 10px; }
h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 5vw, 48px); line-height: 1.3; letter-spacing: .01em; text-wrap: balance; }
.lead { font-size: clamp(16px, 1.8vw, 19px); color: #2a3441; max-width: 46em; margin-top: 14px; }
.tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-size: 12px; border: 1px solid var(--rule); padding: 2px 10px; text-decoration: none; color: var(--ink); background: var(--paper2); }
.tags a:hover { border-color: var(--accent); color: var(--accent); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); padding: clamp(36px, 6vw, 72px) 0 36px; align-items: start; }
.hero h1 { font-size: clamp(40px, 8vw, 84px); line-height: 1.12; letter-spacing: -.01em; }
.cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 10px 22px; background: var(--ink); color: #fff; text-decoration: none; font-size: 14px; border: 1px solid var(--ink); transition: background .15s, color .15s; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.hero-side { border: 1px solid var(--rule); background: var(--paper2); padding: 18px 20px; }
.hero-side h2 { font-size: 11px; letter-spacing: .14em; color: var(--mute); margin-bottom: 8px; font-weight: 500; }

/* sections: ruled, label left */
.sec { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 32px; border-top: 1px solid var(--rule); padding: 26px 0; }
.sec-label { font-size: 12px; font-weight: 500; color: var(--mute); letter-spacing: .06em; padding-top: 4px; }
.sec-body > * + * { margin-top: 14px; }
.sec-body p { max-width: 44em; }
.sec-body ul:not(.cards):not(.note-list):not(.plain) { list-style: none; }
.sec-body ul:not(.cards):not(.note-list):not(.plain) li { position: relative; padding-left: 1.2em; }
.sec-body ul:not(.cards):not(.note-list):not(.plain) li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.plain li + li { margin-top: 14px; }
.more { font-size: 14px; }
.small-note { font-size: 13px; color: var(--mute); }

/* cards */
.cards { display: grid; gap: 0; border-top: 1px solid var(--rule2); }
.cards.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 18px 20px 20px 0; border-bottom: 1px solid var(--rule2); }
.cards.cols2 .card:nth-child(even), .cards.cols3 .card:not(:nth-child(3n+1)) { padding-left: 20px; border-left: 1px solid var(--rule2); }
.card .code { margin-bottom: 4px; font-size: 11px; }
.card h3 { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.4; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card p:not(.code) { font-size: 14px; color: #33404e; margin-top: 6px; line-height: 1.8; }
.card .host { font-size: 12px; color: var(--mute); }

/* note list */
.note-list { border-top: 1px solid var(--rule2); }
.note-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 150px 92px; gap: 6px 16px; padding: 11px 0; border-bottom: 1px solid var(--rule2); align-items: baseline; }
.note-row .no { font-size: 12px; color: var(--accent); }
.note-row .t { font-family: var(--serif); font-weight: 700; font-size: 17px; line-height: 1.5; color: var(--ink); text-decoration: none; }
.note-row .t:hover { color: var(--accent); text-decoration: underline; }
.note-row .meta { font-size: 12px; color: var(--mute); }
.note-row time { font-size: 12px; color: var(--mute); text-align: right; }

/* prose */
.prose { max-width: 44em; padding: 8px 0 24px; border-top: 1px solid var(--rule); }
.prose h2 { font-family: var(--serif); font-size: 24px; font-weight: 800; margin: 34px 0 10px; padding-top: 6px; border-top: 1px solid var(--rule2); }
.prose h2:first-child { margin-top: 24px; border-top: 0; }
.prose p { margin: 12px 0; }
.prose ul { margin: 12px 0; }
.prose li { position: relative; padding-left: 1.2em; margin: 4px 0; }
.prose li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.pn { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--rule); padding-top: 18px; font-size: 14px; }

/* kv, tables */
.kv > div { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--rule2); }
.kv dt { font-size: 12px; color: var(--mute); letter-spacing: .06em; padding-top: 2px; }
.kv dd { font-size: 14px; }
.hero-side .kv > div { grid-template-columns: 6.5em minmax(0, 1fr); }
.scroll { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th, .data td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--rule2); vertical-align: baseline; font-weight: 400; }
.data thead th { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--mute); font-weight: 500; }
.data tbody th { font-weight: 500; }
.data .num { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data.wide { min-width: 720px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; }
.principles { counter-reset: p; }
.principles li { counter-increment: p; padding: 8px 0 8px 2.6em; position: relative; border-bottom: 1px solid var(--rule2); }
.principles li::before { content: counter(p); position: absolute; left: 0; top: 8px; font-family: var(--mono); color: var(--accent); }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; border-bottom: 1px solid var(--ink); padding-top: 8px; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.bar i { display: block; width: 100%; background: var(--accent); min-height: 1px; }
.bar b { font-family: var(--mono); font-size: 11px; font-weight: 500; min-height: 14px; }
.bar-axis { display: flex; gap: 6px; margin: 6px 0 22px; }
.bar-axis span { flex: 1; min-width: 0; text-align: center; font-size: 10px; color: var(--mute); }

/* glossary / faq */
.gloss > div, .faq > div { padding: 12px 0; border-bottom: 1px solid var(--rule2); }
.gloss dt, .faq dt { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.gloss dt small { margin-left: 10px; font-size: 11px; color: var(--mute); font-weight: 400; }
.gloss dd, .faq dd { margin-top: 4px; max-width: 44em; font-size: 15px; }
.gloss > div:target { background: var(--paper2); }

/* footer */
.site-footer { background: var(--ink); color: #cfd5dc; padding: 44px 0 28px; font-size: 14px; }
.site-footer a { color: #e6eaee; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.foot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.site-footer h2 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: #8d98a5; font-weight: 500; margin-bottom: 10px; }
.site-footer li { margin: 5px 0; line-height: 1.6; }
.foot-net { margin-top: 28px; padding-top: 18px; border-top: 1px solid #2b3846; }
.foot-net ul { display: flex; flex-wrap: wrap; gap: 6px 22px; font-family: var(--mono); font-size: 12px; }
.foot-note { margin-top: 24px; font-size: 12px; color: #9aa5b1; max-width: 52em; }
.foot-copy { margin-top: 8px; font-size: 12px; color: #7d8895; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .sec { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cards.cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.cols3 .card:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
  .cards.cols3 .card:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--rule2); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .note-row { grid-template-columns: 62px minmax(0, 1fr) 82px; }
  .note-row .meta { display: none; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; gap: 0; display: none; padding: 6px var(--gutter) 12px; }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--rule2); }
  .topstrip .wrap span:first-child { display: none; }
  .cards.cols2, .cards.cols3 { grid-template-columns: minmax(0, 1fr); }
  .cards.cols2 .card, .cards.cols3 .card, .cards.cols2 .card:nth-child(even), .cards.cols3 .card:nth-child(even), .cards.cols3 .card:not(:nth-child(3n+1)) { padding-left: 0; padding-right: 0; border-left: 0; }
  .kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .note-row { grid-template-columns: minmax(0, 1fr) 82px; }
  .note-row .no { display: none; }
  .pn { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
