/* ひびどーあ — 紙芝居の舞台 */

:root {
  --ink: #2B1E16;
  --ink-soft: #5A4537;
  --wood: #9A5530;
  --wood-light: #B86E3F;
  --wood-dark: #6E3A1F;
  --on-wood: #FFF3DD;
  --paper: #FBF6EA;
  --paper-line: #E4D6BD;
  --shu: #E0573F;
  --shu-ink: #B23A22;
  --marigold: #F2B43A;
  --sky: #8CC4E0;
  --leaf: #74B07E;
  --plum: #B97BA5;
  --sand: #E8C98A;
  --teal: #4C9A96;
  --rose: #EFA08F;
  --ai: #2E3A78;
  --ai-deep: #1E2552;
  --moon: #FFF1C1;
  --on-night: #F6EBD0;
  --on-night-soft: #CFC6B4;
  --room: #F3A55C;

  --line: 3px;
  --header-h: 64px;

  --f-display: 'Kaisei Decol', 'Hiragino Mincho ProN', serif;
  --f-text: 'Klee One', 'Hiragino Sans', sans-serif;
  --f-ui: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scrollbar-color: var(--wood) var(--ai-deep);
}

body {
  margin: 0;
  font-family: var(--f-text);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  background: var(--room);
  overflow-x: clip;
}

::selection { background: var(--marigold); color: var(--ink); }

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

a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1.5px; }

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

/* 日本語の見出しを文節で折り返す */
.ph { display: inline-block; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 幕板（ヘッダー） ---------- */

.plate {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: var(--wood);
  border-bottom: var(--line) solid var(--ink);
  color: var(--on-wood);
}

.plate__inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: .02em;
  white-space: nowrap;
}

.wordmark img {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 2px solid var(--ink);
}

.plate nav ul {
  display: flex;
  gap: 4px;
  margin: 0; padding: 0;
  list-style: none;
}

.plate nav a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: .92rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s;
}

.plate nav a:hover { background: var(--wood-dark); }
.plate nav a[aria-current="page"] { background: var(--wood-dark); box-shadow: inset 0 0 0 2px var(--ink); }

/* ---------- App Store 公式バッジ ---------- */

.badge-link {
  display: inline-block;
  line-height: 0;
  border-radius: 9px;
  transition: transform .25s var(--ease-out);
}
.badge-link:hover { transform: translateY(-2px); }
.badge-link img { height: 48px; width: auto; }
.badge-link--small img { height: 40px; }

.badge-note {
  font-family: var(--f-ui);
  font-size: .85rem;
  line-height: 1.5;
}

/* ---------- 夜の区画 ---------- */

.night {
  background: var(--ai-deep);
  color: var(--on-night);
}

.night + .night { border-top: 2px solid rgba(246, 235, 208, .14); }

.night__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 96px 24px;
}

.night h2 {
  margin: 0 0 32px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.4;
  letter-spacing: .02em;
  text-wrap: balance;
}

/* ---------- 足もと（フッター） ---------- */

.foot {
  background: var(--wood);
  color: var(--on-wood);
  border-top: var(--line) solid var(--ink);
}

.foot__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0; padding: 0;
  list-style: none;
  font-family: var(--f-ui);
  font-size: .95rem;
}

.foot small {
  display: block;
  width: 100%;
  font-family: var(--f-ui);
  font-size: .8rem;
  opacity: .85;
}

@media (max-width: 560px) {
  :root { --header-h: 56px; }
  .plate__inner { padding: 0 14px; gap: 8px; }
  .wordmark { font-size: 1.2rem; gap: 8px; }
  .wordmark img { width: 28px; height: 28px; border-radius: 7px; }
  .plate nav a { padding: 6px 8px; font-size: .8rem; }
  .plate nav .nav-optional { display: none; }
  .night__inner { padding: 72px 18px; }
}

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

/* ---------- 読みもののページ（札裏の紙） ---------- */

.page { background: var(--room); }

.sheet {
  max-width: 820px;
  margin: 56px auto 96px;
  padding: 48px 56px 56px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 22px 40px -24px rgba(40, 20, 8, .55);
}

.sheet__title {
  margin: 0 0 32px;
  padding-bottom: 18px;
  border-bottom: 2px dashed var(--paper-line);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.35;
}

.sheet h2 {
  margin: 0 0 12px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.45;
}

.sheet h3 {
  margin: 0 0 10px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.5;
}

.sheet p, .sheet li { line-height: 1.95; }
.sheet p { margin: 0 0 1em; }
.sheet ul { margin: 0 0 1em; padding-left: 1.4em; }
.sheet li + li { margin-top: 4px; }

.sheet .intro-box,
.sheet .section { margin-bottom: 40px; }

.sheet .highlight-box {
  margin-top: 16px;
  padding: 18px 22px 4px;
  background: #F4E9D2;
  border: 2px solid var(--paper-line);
  border-radius: 8px;
}

.sheet a { color: var(--shu-ink); }

.sheet .last-updated {
  margin-top: 40px;
  font-family: var(--f-ui);
  font-size: .85rem;
  color: var(--ink-soft);
  text-align: right;
}

.sheet .form-container {
  margin: 8px 0 32px;
  padding: 8px;
  border: 2px solid var(--paper-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.sheet .form-container iframe {
  display: block;
  width: 100%;
  min-height: 720px;
  border: 0;
}

.sheet .contact-info {
  padding: 16px 20px 2px;
  background: #F4E9D2;
  border-radius: 8px;
  font-size: .95rem;
}

@media (max-width: 560px) {
  .sheet { margin: 28px 12px 64px; padding: 28px 20px 32px; }
}
