/* 模擬店探偵 紹介サイト 共通スタイル
   テーマ：文化祭×探偵ノート（クラフト紙・レシート・赤ペン・虫めがね） */

:root {
  --paper: #f6efe2;
  --paper2: #efe4cf;
  --ink: #1f2a44;
  --ink-soft: #5a6378;
  --accent: #d9480f;
  --accent-dark: #b23a0b;
  --ok: #2b8a3e;
  --gold: #c99a2e;
  --card: #fffdf8;
  --line: #d8cbb3;
  --radius: 14px;
  --wrap: 1120px;
  --font: system-ui, "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Meiryo", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--paper);
  /* ノートの罫線をうっすら */
  background-image:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.55), transparent 45%),
    repeating-linear-gradient(to bottom, transparent 0 35px, rgba(216,203,179,.28) 35px 36px);
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }

a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; letter-spacing: .02em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.45rem, 3.4vw, 2rem); }
h3 { font-size: clamp(1.12rem, 2.2vw, 1.3rem); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; color: #fff; }

.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 239, 226, .96);
  border-bottom: 2px dashed var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.brand img { width: 40px; height: 40px; }
.brand:hover { color: var(--ink); }

.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  display: block; padding: 6px 12px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem;
}
.nav a:hover { background: var(--paper2); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

.menu-btn {
  display: none; margin-left: auto;
  align-items: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: .95rem;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: 10px; padding: 6px 12px; cursor: pointer;
}
.menu-btn .bars { width: 18px; height: 14px; position: relative; }
.menu-btn .bars span { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-btn .bars span:nth-child(1) { top: 0; }
.menu-btn .bars span:nth-child(2) { top: 6px; }
.menu-btn .bars span:nth-child(3) { top: 12px; }
.menu-btn[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 800; text-decoration: none; line-height: 1.3;
  padding: .7em 1.3em; border-radius: 12px; border: 2px solid var(--ink);
  background: var(--card); color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { color: var(--ink); transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-play { background: var(--accent); color: #fff; border-color: #8f2f09; box-shadow: 0 4px 0 #8f2f09; }
.btn-play:hover { color: #fff; background: #c8420d; box-shadow: 0 5px 0 #8f2f09; }
.btn-play:active { box-shadow: 0 1px 0 #8f2f09; }
.btn-sm { padding: .45em 1em; font-size: .95rem; border-radius: 10px; box-shadow: 0 3px 0 #8f2f09; }
.btn-lg { font-size: clamp(1.15rem, 2.6vw, 1.45rem); padding: .75em 1.6em; border-radius: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- セクション ---------- */
main { display: block; }
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: rgba(239, 228, 207, .65); border-top: 2px dashed var(--line); border-bottom: 2px dashed var(--line); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto clamp(28px, 4vw, 44px); }
.section-head p { color: var(--ink-soft); }
.eyebrow {
  display: inline-block; font-weight: 800; font-size: .9rem; letter-spacing: .08em;
  color: var(--accent-dark); border: 2px solid var(--accent); border-radius: 8px;
  padding: 0 10px; margin-bottom: 10px; transform: rotate(-2deg); background: var(--card);
}
.lead { font-size: clamp(1.05rem, 2vw, 1.2rem); }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* 赤ペンのマーカー */
.pen {
  background: linear-gradient(transparent 62%, rgba(217, 72, 15, .28) 62%, rgba(217, 72, 15, .28) 92%, transparent 92%);
  padding: 0 .1em; color: inherit;
}
.pen-circle { position: relative; display: inline-block; white-space: nowrap; }
.pen-circle svg { position: absolute; left: -7%; top: -16%; width: 114%; max-width: none; height: 132%; pointer-events: none; overflow: visible; }

/* ---------- レシート風カード（上下ギザギザ） ---------- */
.receipt {
  position: relative; background: var(--card); padding: 26px 24px;
  margin: 10px 0;
  filter: drop-shadow(0 3px 4px rgba(31, 42, 68, .14));
}
.receipt::before, .receipt::after {
  content: ""; position: absolute; left: 0; right: 0; height: 9px;
  background-size: 18px 9px; background-repeat: repeat-x;
}
.receipt::before { top: -9px; background-image: conic-gradient(from 135deg at 50% 0, var(--card) 90deg, transparent 0); }
.receipt::after { bottom: -9px; background-image: conic-gradient(from -45deg at 50% 100%, var(--card) 90deg, transparent 0); }
.receipt > :last-child { margin-bottom: 0; }
.receipt .rule { border: 0; border-top: 2px dashed var(--line); margin: 14px 0; }

.card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 2px 0 var(--line);
}
.card > :last-child { margin-bottom: 0; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- ヒーロー ---------- */
.hero { padding: clamp(36px, 6vw, 72px) 0 clamp(48px, 7vw, 80px); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-tag {
  display: inline-block; font-weight: 800; color: var(--accent-dark); background: var(--card);
  border: 2px solid var(--accent); border-radius: 8px; padding: 2px 12px; transform: rotate(-3deg); margin-bottom: 12px;
}
.hero h1 { margin-bottom: .1em; font-size: clamp(2.4rem, 6.4vw, 4rem); letter-spacing: .04em; }
.hero .subtitle { font-size: clamp(1.1rem, 2.6vw, 1.5rem); font-weight: 800; color: var(--ink-soft); margin-bottom: 1em; }
.catch {
  font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 800; line-height: 1.6; margin: 0 0 .8em;
}
.catch .strike { position: relative; color: var(--accent-dark); white-space: nowrap; }
.hero .note { font-size: .95rem; color: var(--ink-soft); margin-top: 14px; }

/* ノートPCの枠 */
.laptop { position: relative; margin: 0 auto; max-width: 640px; width: 100%; }
.laptop-screen {
  background: #1b2236; border-radius: 16px 16px 4px 4px; padding: 3.2% 3.2% 3.6%;
  box-shadow: 0 0 0 2px #2c3552 inset;
}
.laptop-screen img { width: 100%; border-radius: 3px; aspect-ratio: 16 / 9; object-fit: cover; }
.laptop-base {
  height: 18px; margin: 0 -7%;
  background: linear-gradient(#d9d1c1, #b7ad99);
  border-radius: 2px 2px 14px 14px; position: relative;
  box-shadow: 0 10px 18px rgba(31,42,68,.18);
}
.laptop-base::before { content: ""; position: absolute; left: 50%; top: 0; width: 18%; height: 7px; transform: translateX(-50%); background: #a59a85; border-radius: 0 0 8px 8px; }
.hero-visual { position: relative; padding: 10px 7% 0; }
.hero-visual .loupe { position: absolute; right: -2%; bottom: -18px; width: 22%; max-width: 130px; transform: rotate(-12deg); filter: drop-shadow(0 6px 8px rgba(31,42,68,.2)); }
.sticky-note {
  position: absolute; left: 0; top: -6px; z-index: 2; transform: rotate(-6deg);
  background: #fff3c4; border: 1px solid #e9d894; padding: 6px 12px; font-weight: 800; font-size: .9rem;
  box-shadow: 0 3px 6px rgba(31,42,68,.12);
}

/* ---------- 特長 ---------- */
.feature { text-align: left; }
.feature .f-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--paper2);
  display: grid; place-items: center; margin-bottom: 12px; border: 2px solid var(--line);
}
.feature .f-icon svg { width: 36px; height: 36px; }
.feature h3 { margin-bottom: .4em; }

/* ---------- 写真つきステップ ---------- */
.shot {
  border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--ink);
  box-shadow: 0 6px 0 rgba(31,42,68,.12);
}
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
figure { margin: 0; }
figcaption { font-size: .92rem; color: var(--ink-soft); margin-top: 8px; }

.digest { counter-reset: dg; }
.digest li { list-style: none; }
.digest .num, .step-num {
  display: inline-grid; place-items: center; width: 2em; height: 2em; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; margin-right: .4em; flex: none;
}
.digest h3 { display: flex; align-items: center; margin: 14px 0 6px; }
.digest p { margin: 0; color: var(--ink-soft); font-size: .97rem; }
ol.digest { padding: 0; margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 34px; }
.step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(18px, 3vw, 36px); align-items: center; }
.step:nth-child(even) .step-text { order: 2; }
.step h3 { display: flex; align-items: center; gap: 4px; }
.step-text > :last-child { margin-bottom: 0; }
.step .tag { display: inline-block; font-size: .82rem; font-weight: 800; background: var(--gold); color: var(--ink); border-radius: 6px; padding: 0 8px; margin-left: 6px; }

/* ---------- セット ---------- */
.sets { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.set-card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.set-no {
  display: inline-grid; place-items: center; min-width: 2.2em; height: 2.2em; padding: 0 .4em; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 800; font-size: .95rem;
}
.day { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; margin: 0; }
.day + .day { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.day-label {
  font-size: .8rem; font-weight: 800; border-radius: 6px; padding: 2px 8px; white-space: nowrap; margin-top: 3px;
  background: var(--paper2); border: 1px solid var(--line);
}
.day-2 .day-label { background: var(--ink); color: #fff; border-color: var(--ink); }
.case-title { font-weight: 800; display: block; line-height: 1.5; }
.case-shop { font-size: .88rem; color: var(--ink-soft); }
.case-learn { display: block; font-size: .95rem; margin-top: 2px; }
.case-learn::before { content: "学べること："; color: var(--ok); font-weight: 800; }
.fp-chip {
  display: inline-block; margin-top: 6px; font-size: .85rem; font-weight: 800;
  color: #6b4e0c; background: #f7ecd0; border: 1.5px solid var(--gold); border-radius: 999px; padding: 0 10px;
}

/* ---------- 場面 ---------- */
.scene { display: flex; gap: 16px; align-items: flex-start; }
.scene .s-icon { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; }
.scene .s-icon svg { width: 32px; height: 32px; }

/* ---------- CTA ---------- */
.cta { text-align: center; }
.cta .receipt { max-width: 720px; margin: 0 auto; padding: 36px 24px; }
.cta .btn-row { justify-content: center; }

/* ---------- ページ見出し ---------- */
.page-head { padding: clamp(36px, 6vw, 64px) 0 clamp(18px, 3vw, 28px); }
.page-head p { color: var(--ink-soft); max-width: 760px; }
.breadcrumb { font-size: .9rem; color: var(--ink-soft); margin-bottom: 8px; }
.breadcrumb a { color: var(--ink-soft); }

.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 18px 0 0; }
.toc a { display: inline-block; padding: 4px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; color: var(--ink); font-weight: 700; font-size: .92rem; }
.toc a:hover { border-color: var(--ink); }

.prose { max-width: 780px; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }

/* 表 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { border-collapse: collapse; width: 100%; background: var(--card); font-size: .97rem; }
th, td { border: 1.5px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
thead th { background: var(--ink); color: #fff; border-color: var(--ink); }
td.num, th.num { text-align: right; white-space: nowrap; font-weight: 800; }

.formula {
  font-weight: 800; font-size: clamp(1rem, 2.2vw, 1.15rem); line-height: 1.9;
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 14px 18px;
}
.formula .minus { color: var(--accent-dark); }

.callout { display: flex; gap: 12px; align-items: flex-start; background: #fff7e6; border-left: 6px solid var(--gold); border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 18px 0; }
.callout.ok { background: #edf7ef; border-left-color: var(--ok); }
.callout.warn { background: #fff0e8; border-left-color: var(--accent); }
.callout > svg { width: 26px; height: 26px; flex: none; margin-top: 2px; }
.callout > div > :last-child { margin-bottom: 0; }

.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 1.8em; margin-bottom: .5em; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 1.1em; height: 1.1em; border-radius: 4px; border: 2px solid var(--ok);
}
.check-list li::after {
  content: ""; position: absolute; left: .32em; top: .5em; width: .42em; height: .7em;
  border: solid var(--ok); border-width: 0 3px 3px 0; transform: rotate(45deg);
}

/* ミニ辞典 */
.dict { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.term h3 { margin-bottom: .2em; }
.term .yomi { font-size: .85rem; color: var(--ink-soft); font-weight: 700; margin-left: 6px; }
.term .plain { font-weight: 800; color: var(--accent-dark); margin-bottom: .5em; }
.term .scene-in-game { font-size: .93rem; color: var(--ink-soft); margin: 0; }
.term .scene-in-game b { color: var(--ink); }

/* FAQ */
.faq { display: grid; gap: 14px; max-width: 860px; }
.faq details { background: var(--card); border: 2px solid var(--line); border-radius: 12px; }
.faq details[open] { border-color: var(--ink); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 52px 16px 18px; font-weight: 800; position: relative;
  display: flex; gap: 10px; align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .q { flex: none; color: var(--accent-dark); font-weight: 900; }
.faq summary::after {
  content: ""; position: absolute; right: 20px; top: 24px; width: 10px; height: 10px;
  border: solid var(--ink); border-width: 0 3px 3px 0; transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 28px; }
.faq .answer { padding: 0 18px 18px 18px; border-top: 2px dashed var(--line); padding-top: 14px; margin: 0 0 0; }
.faq .answer > :last-child { margin-bottom: 0; }

/* ダウンロード */
.dl-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.dl-box .zip-icon { width: 96px; height: 96px; }
.three-steps { counter-reset: st; list-style: none; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.three-steps li { position: relative; }
.three-steps .step-num { margin-bottom: 10px; }

/* ---------- フッター ---------- */
.site-footer { margin-top: 0; background: var(--ink); color: #e9e4d8; padding: 44px 0 30px; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffd8c4; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; }
.footer-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.15rem; color: #fff; margin-bottom: 8px; }
.footer-brand img { width: 44px; height: 44px; background: var(--paper); border-radius: 10px; padding: 2px; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.footer-note { border-top: 1px solid rgba(255,255,255,.2); margin-top: 26px; padding-top: 18px; color: #c9c4b8; font-size: .88rem; }
.footer-note p { margin-bottom: .5em; }

/* ---------- 控えめな動き ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 1080px) {
  .nav a { padding: 6px 9px; font-size: .9rem; }
}
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { text-align: center; }
  .hero .btn-row { justify-content: center; }
  /* メニューを折りたたむ（JSがあるときだけ） */
  .js .menu-btn { display: inline-flex; }
  .js .header-play { margin-left: auto; }
  .js .menu-btn { margin-left: 0; }
  .js .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 2px dashed var(--line);
    padding: 8px 20px 16px; display: none;
  }
  .js .nav.is-open { display: block; }
  .js .nav ul { flex-direction: column; gap: 2px; }
  .js .nav a { padding: 10px 14px; font-size: 1rem; border-radius: 10px; }
  .no-js .header-inner { flex-wrap: wrap; padding-bottom: 8px; }
  .no-js .nav { order: 3; width: 100%; margin-left: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .grid-2, .grid-3, .three-steps { grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: minmax(0, 1fr); }
  .step:nth-child(even) .step-text { order: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .dl-box { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .dl-box .zip-icon { margin: 0 auto; }
  .dl-box .btn-row { justify-content: center; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .brand { font-size: 1.05rem; gap: 8px; }
  .brand img { width: 34px; height: 34px; }
  .header-inner { gap: 8px; }
  .menu-btn { padding: 6px 9px; }
  .menu-btn .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .header-play { padding: .45em .8em; font-size: .9rem; }
  .sets, .dict { grid-template-columns: minmax(0, 1fr); }
  .receipt { padding: 22px 18px; }
  .card { padding: 18px; }
}
@media (max-width: 360px) {
  .header-play .icon { display: none; }
}

/* ===== 読みやすい改行 =====
   日本語は文節の切れ目（tools/phrase_wrap.py が入れた <wbr>）だけで改行する。
   見出しは行の長さをそろえ、本文は最後の行に1〜2文字だけ残らないようにする。 */
body { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
h1, h2, h3, h4, .lead, summary, figcaption, .btn { text-wrap: balance; }
p, li, dd, td, th { text-wrap: pretty; }
