/* おっぱい総研 — 研究ノートのような、読みやすい誌面 */
:root {
  --paper: #fbf8f4;
  --card: #ffffff;
  --ink: #2a2324;
  --muted: #76696a;
  --rule: #e6ddd6;
  --accent: #c8505f;
  --accent-ink: #a63a4a;
  --accent-soft: #f2c7cc;
  --tint: #f5eee8;
  --fact: #2f7a72;  --fact-bg: #e6f2f0;
  --infer: #4a5aa8; --infer-bg: #eaedf8;
  --exp: #b4533f;   --exp-bg: #f8ebe6;
  --hypo: #a7741a;  --hypo-bg: #f8f0de;
  --fun: #6f6a73;   --fun-bg: #efedf1;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  --font-head: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1718; --card: #241f20; --ink: #eee6e3; --muted: #a99c9b; --rule: #3a3233;
    --accent: #e57a87; --accent-ink: #f09aa5; --accent-soft: #6b3940; --tint: #2a2324;
    --fact: #7cc9be; --fact-bg: #1f3331; --infer: #9fabe8; --infer-bg: #242a42;
    --exp: #eb9a84; --exp-bg: #3a2620; --hypo: #e2b35c; --hypo-bg: #362b17;
    --fun: #bdb6c2; --fun-bg: #2c2830;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1718; --card: #241f20; --ink: #eee6e3; --muted: #a99c9b; --rule: #3a3233;
  --accent: #e57a87; --accent-ink: #f09aa5; --accent-soft: #6b3940; --tint: #2a2324;
  --fact: #7cc9be; --fact-bg: #1f3331; --infer: #9fabe8; --infer-bg: #242a42;
  --exp: #eb9a84; --exp-bg: #3a2620; --hypo: #e2b35c; --hypo-bg: #362b17;
  --fun: #bdb6c2; --fun-bg: #2c2830;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.9;
  letter-spacing: .02em;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 720px; }

/* header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { font-family: var(--font-head); font-weight: 800; font-size: 24px; letter-spacing: .06em; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .12em; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--accent-ink); }

/* footer */
.site-foot { margin-top: 96px; border-top: 1px solid var(--rule); background: var(--tint); font-size: 14px; color: var(--muted); }
.site-foot .wrap { padding-block: 40px 48px; display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-foot h2 { font-size: 13px; letter-spacing: .14em; color: var(--ink); margin: 0 0 8px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent-ink); }
.foot-note { grid-column: 1 / -1; font-size: 12px; border-top: 1px solid var(--rule); padding-top: 18px; line-height: 1.8; }

/* labels (evidence types) */
.label { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 2px 10px; border-radius: 999px; line-height: 1.7; white-space: nowrap; }
.l-fact { color: var(--fact); background: var(--fact-bg); }
.l-infer { color: var(--infer); background: var(--infer-bg); }
.l-exp { color: var(--exp); background: var(--exp-bg); }
.l-hypo { color: var(--hypo); background: var(--hypo-bg); }
.l-fun { color: var(--fun); background: var(--fun-bg); }

/* home */
.hero { padding-block: 64px 40px; }
.hero .eyebrow { font-size: 12px; letter-spacing: .2em; color: var(--accent-ink); font-weight: 700; }
.hero h1 { font-family: var(--font-head); font-size: clamp(30px, 6vw, 52px); line-height: 1.35; margin: 12px 0 18px; text-wrap: balance; letter-spacing: .04em; }
.hero p { max-width: 38em; color: var(--muted); margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.section-title { font-size: 13px; letter-spacing: .2em; color: var(--muted); font-weight: 700; margin: 56px 0 16px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); }
.feature:hover h3 { color: var(--accent-ink); }
.feature-art { background: var(--tint); min-height: 220px; display: grid; place-items: center; padding: 24px; }
.feature-body { padding: 28px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.feature h3 { font-family: var(--font-head); font-size: clamp(22px, 3.2vw, 30px); line-height: 1.45; margin: 0; text-wrap: balance; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.issue { font-family: var(--font-head); font-weight: 800; color: var(--accent-ink); letter-spacing: .08em; }
@media (max-width: 720px) { .feature { grid-template-columns: 1fr; } .feature-art { min-height: 160px; } }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 20px 22px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; font-size: 17px; line-height: 1.6; }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.75; }
.count { font-size: 12px; color: var(--muted); }
.lab-card { border-style: dashed; background: transparent; }
.status { font-size: 12px; font-weight: 700; color: var(--hypo); letter-spacing: .08em; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; counter-reset: s; margin: 0; padding: 0; list-style: none; }
.flow li { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; font-size: 14px; line-height: 1.7; counter-increment: s; }
.flow li::before { content: counter(s, decimal-leading-zero); display: block; font-family: var(--font-head); font-weight: 800; color: var(--accent-ink); font-size: 18px; }

/* article */
.article-head { padding-block: 48px 8px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.article-head h1 { font-family: var(--font-head); font-size: clamp(28px, 5.4vw, 44px); line-height: 1.4; margin: 14px 0 16px; text-wrap: balance; letter-spacing: .03em; }
.lead { color: var(--muted); font-size: 16px; margin: 0 0 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li { font-size: 12px; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 10px; }
.disclosure { font-size: 13px; color: var(--muted); background: var(--tint); border-radius: 8px; padding: 10px 14px; margin: 24px 0 8px; line-height: 1.7; }
.disclosure a { color: var(--muted); }

.toc { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 22px; margin: 28px 0 8px; font-size: 15px; }
.toc summary { font-weight: 700; cursor: pointer; letter-spacing: .08em; font-size: 14px; }
.toc ol { margin: 10px 0 0; padding-left: 1.4em; line-height: 1.9; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent-ink); }

.prose { max-width: 720px; }
.prose h2 { font-family: var(--font-head); font-size: clamp(22px, 3.6vw, 28px); line-height: 1.5; margin: 64px 0 18px; text-wrap: balance; padding-top: 18px; border-top: 2px solid var(--ink); }
.prose p { margin: 0 0 1.25em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.4em; }
.prose li { margin-bottom: .4em; }
.prose strong { background: linear-gradient(transparent 62%, var(--accent-soft) 62%); font-weight: 700; }
.prose p.note > strong:first-child, .prose li > strong:first-child { background: none; }
.note { position: relative; padding: 14px 18px 14px 18px; border-radius: 10px; background: var(--card); border: 1px solid var(--rule); border-left-width: 4px; }
.note .label { margin-right: 8px; vertical-align: 1px; }
.n-fact { border-left-color: var(--fact); }
.n-infer { border-left-color: var(--infer); }
.n-exp { border-left-color: var(--exp); background: var(--exp-bg); border-color: transparent; border-left-color: var(--exp); }
.n-hypo { border-left-color: var(--hypo); background: var(--hypo-bg); border-color: transparent; border-left-color: var(--hypo); }
.n-fun { border-left-color: var(--fun); border-style: dashed; border-left-style: solid; }
.label-list { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.label-list li { margin: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.6em; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 14px; line-height: 1.7; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.prose th { background: var(--tint); font-size: 13px; letter-spacing: .04em; }
.prose tr:last-child td { border-bottom: 0; }

.fig { margin: 8px 0 32px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 18px 14px; }
.fig svg { display: block; width: 100%; font-family: var(--font-body); }
.fig figcaption { font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 8px; }
.fig-no { font-weight: 700; color: var(--ink); margin-right: 8px; }

.refs ul { font-size: 13px; line-height: 1.75; color: var(--muted); padding-left: 1.2em; }
.refs li { margin-bottom: .7em; overflow-wrap: anywhere; }

.next-lab { margin-top: 48px; border: 2px dashed var(--accent); border-radius: 14px; padding: 22px 24px; }
.next-lab h2 { border: 0; margin: 4px 0 8px; padding: 0; font-size: 22px; }
.next-lab p { margin: 0; color: var(--muted); font-size: 15px; }

.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 40px; padding: 20px 22px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; }
.avatar { flex: 0 0 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; color: var(--accent-ink); font-size: 18px; }
.author-box p { margin: 4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.75; }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; font-size: 14px; }
.share a { border: 1px solid var(--rule); border-radius: 999px; padding: 6px 16px; text-decoration: none; color: var(--ink); background: var(--card); }
.share a:hover { border-color: var(--accent); }

/* simple pages */
.page-head { padding-block: 48px 8px; }
.page-head h1 { font-family: var(--font-head); font-size: clamp(26px, 5vw, 38px); margin: 8px 0 8px; line-height: 1.4; }
.dl { display: grid; grid-template-columns: minmax(7em, max-content) minmax(0, 1fr); gap: 0; border-top: 1px solid var(--rule); margin: 0 0 1.6em; }
.dl dt, .dl dd { margin: 0; padding: 12px 8px; border-bottom: 1px solid var(--rule); }
.dl dt { font-weight: 700; font-size: 14px; color: var(--muted); }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; } .dl dt { border-bottom: 0; padding-bottom: 0; } }
.empty { color: var(--muted); background: var(--card); border: 1px dashed var(--rule); border-radius: 12px; padding: 24px; }

h1, h2, h3 { word-break: auto-phrase; }
