/* そらの本棚 — 色と書体は docs/web-design.md の方針に合わせる。 */

:root {
  --ground: #F9F8F6;
  --paper: #FFFFFF;
  --ink: #15171C;
  --sub: #5A6070;
  --line: #E3E2DD;
  --line-soft: #ECEBE6;
  --line-strong: #C9C8C2;
  --blue: #2744E2;
  --blue-deep: #1A31B8;
  --sky: #E9EDFC;
  --sky-soft: #F1F3FC;
  --navy: #121A3A;
  /* 書体は端末のものを使う。読み込みを待たずに、最初から最終的な文字で出る。 */
  --mincho: 'Hiragino Mincho ProN', 'Yu Mincho', 'YuMincho', 'Noto Serif CJK JP', 'Noto Serif JP', serif;
  --gothic: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'YuGothic', 'Noto Sans CJK JP', 'Noto Sans JP', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: 32px;
}

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

/* manipulation：続けて押してもダブルタップの拡大にならない。2本指の拡大は残す。 */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
/* 明朝を持たない端末（js/fonts.js が判定）でだけ、Web書体の明朝を使う。 */
html.web-mincho { --mincho: 'Shippori Mincho', serif; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, blockquote, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: var(--blue); }
@media (hover: hover) { a:hover { color: var(--blue-deep); } }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 10px 18px;
  background: var(--ink);
  color: #FFFFFF;
  border-radius: 22px;
  text-decoration: none;
}
.skip:focus { top: 12px; color: #FFFFFF; }

.wrap { max-width: 1264px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- ヘッダー ---------- */

.site-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
@media (hover: hover) { .brand:hover { color: var(--ink); } }
.brand img { width: 34px; height: 34px; }
/* ロゴの文字は画像の形で切り抜き、文字色で塗る。読み上げ用の文字は残す。 */
.wordmark {
  display: block;
  width: 108px;
  height: 22px;
  overflow: hidden;
  white-space: nowrap;
  text-indent: -200px;
  background: currentColor;
  -webkit-mask: url('/assets/sora-wordmark.png') center / contain no-repeat;
  mask: url('/assets/sora-wordmark.png') center / contain no-repeat;
}
/* 試験公開中のしるし。ヘッダーのロゴにだけ付ける。 */
.site-header .brand::after {
  content: 'β';
  margin-left: -2px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
}

.search-form {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-form:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39, 68, 226, .12); }
.search-form svg { flex: none; color: var(--sub); }
.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}
.search-form input::placeholder { color: var(--sub); opacity: 1; }

.nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-weight: 500; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.nav a[aria-current] { color: var(--blue); }
@media (hover: hover) { .nav a:hover { color: var(--blue); } }

/* ---------- 文字 ---------- */

.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: .14em; color: var(--blue); }
.label { font-size: 13px; font-weight: 500; letter-spacing: .14em; color: var(--sub); }
.display {
  font-family: var(--mincho);
  font-weight: 500;
  font-size: 46px;
  line-height: 1.5;
  letter-spacing: .04em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.heading {
  font-family: var(--mincho);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.5;
  letter-spacing: .04em;
}
.heading-small { font-family: var(--mincho); font-weight: 500; font-size: 26px; letter-spacing: .04em; }
.sub { color: var(--sub); }
.note { font-size: 13px; color: var(--sub); }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; text-decoration: none; }

.vertical {
  writing-mode: vertical-rl;
  font-family: var(--mincho);
  letter-spacing: .05em;
  overflow-wrap: anywhere;
}

/* ---------- ボタンと選択 ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, transform .2s var(--ease);
}
@media (hover: hover) { .button:hover { background: var(--sky-soft); border-color: var(--blue); color: var(--ink); } }
.button:active { transform: scale(.98); }
.button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #FFFFFF;
  font-weight: 700;
  letter-spacing: .04em;
}
@media (hover: hover) { .button.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #FFFFFF; } }
.button.large { min-height: 56px; padding: 0 56px; font-size: 17px; letter-spacing: .1em; }
.button[aria-pressed='true'] { background: var(--sky); border-color: var(--blue); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
@media (hover: hover) { .chip:hover { border-color: var(--blue); color: var(--ink); } }
.chip[aria-pressed='true'], .chip[aria-current] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.7;
}

.lift { transition: transform .28s var(--ease), box-shadow .28s ease; }
@media (hover: hover) { .lift:hover { transform: translateY(-4px); box-shadow: 0 18px 32px -22px rgba(18, 26, 58, .5); } }
.lift:active { transform: translateY(-1px) scale(.99); }

/* ---------- 表紙 ---------- */

.cover {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  height: 300px;
  padding: 28px 26px;
  border: 1px solid transparent;
  border-radius: 3px;
  overflow: hidden;
}
.cover .cover-title {
  writing-mode: vertical-rl;
  font-family: var(--mincho);
  font-weight: 500;
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: .12em;
  max-height: 100%;
  overflow: hidden;
  /* 2列になる題名は長さをそろえ、1文字だけ次の列に落とさない。 */
  text-wrap: balance;
}
.cover .cover-author {
  writing-mode: vertical-rl;
  align-self: flex-end;
  font-size: 13px;
  letter-spacing: .2em;
  max-height: 70%;
  overflow: hidden;
  white-space: nowrap;
}
.cover[data-length='long'] .cover-title { font-size: 21px; letter-spacing: .06em; }
.cover.small { width: 64px; height: 88px; flex: none; padding: 8px 6px; border-radius: 2px; justify-content: center; }
.cover.small .cover-title { font-size: 13px; letter-spacing: .08em; }
.cover.small[data-length='long'] .cover-title { font-size: 10px; letter-spacing: 0; }
.cover.small .cover-author { display: none; }
.cover.hero { width: 264px; height: 372px; flex: none; padding: 36px 32px; box-shadow: 0 30px 40px -30px rgba(18, 26, 58, .6); }
.cover.hero .cover-title { font-size: 34px; letter-spacing: .14em; }
.cover.hero[data-length='long'] .cover-title { font-size: 25px; letter-spacing: .08em; }
.cover.hero .cover-author { font-size: 15px; letter-spacing: .24em; }

.tone-night { background: var(--navy); color: #FFFFFF; }
.tone-sky { background: var(--sky); color: var(--navy); }
.tone-blue { background: var(--blue); color: #FFFFFF; }
.tone-paper { background: var(--paper); color: var(--ink); border-color: var(--line); }

/* ---------- トップ：書き出し ---------- */

/* 書き出しページと同じ一行めくり。広い画面では、一行の左に見出し・時間・題名・ボタンを置いて高さを抑える。 */
.hero { padding: 32px 0 40px; }
.hero .stage {
  display: grid;
  grid-template-columns: auto minmax(0, 440px);
  grid-template-rows: auto 1fr;
  justify-content: center;
  align-items: start;
  gap: 16px 64px;
  padding: 0;
  overflow: hidden;
}
.hero-head { display: flex; flex-direction: column; align-items: flex-start; }
.hero-title { font-family: var(--mincho); font-weight: 500; font-size: 30px; letter-spacing: .08em; line-height: 1.5; }
.hero .slide { grid-column: 2; grid-row: 1 / 3; min-width: 0; }
.hero .slide .vertical { height: 320px; font-size: 28px; }
.hero .slide .vertical[data-length='long'] { font-size: 23px; }
.stage-side { align-self: end; display: flex; flex-direction: column; gap: 16px; }
.hero .slide-meta { align-items: flex-start; }
.hero .slide-meta .reveal { padding: 0; }
.hero .stage-controls { gap: 12px; }

.time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); white-space: nowrap; }
.reveal {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--sub);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}

/* ---------- トップ：本棚と読んだ日 ---------- */

.shelf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  padding: 20px 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.shelf-recent { flex: 2 1 320px; min-width: 0; display: flex; align-items: center; gap: 20px; }
.shelf-recent p { line-height: 1.5; }
.shelf-recent strong { font-family: var(--mincho); font-weight: 600; font-size: 18px; }
.shelf-days { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; }
.days { display: flex; gap: 10px; font-size: 11px; color: var(--sub); text-align: center; }
.days span { width: 22px; }
.days i { display: block; width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 50%; }
.days i.read { background: var(--blue); border-color: var(--blue); }
.days i.today { border-color: var(--blue); }
.shelf-books { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.shelf-books a { text-decoration: none; }

/* ---------- 棚 ---------- */

.section { display: flex; flex-direction: column; gap: 32px; padding: 96px 0 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-head > div:first-child { display: flex; flex-direction: column; gap: 8px; }

.books { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
.book { display: flex; flex-direction: column; gap: 16px; color: var(--ink); text-decoration: none; border-radius: 4px; }
@media (hover: hover) { .book:hover { color: var(--ink); } }
.book-text { display: flex; flex-direction: column; gap: 4px; }
.book-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.book-title strong { font-family: var(--mincho); font-weight: 600; font-size: 18px; line-height: 1.5; }
.book-title span { flex: none; font-size: 13px; font-weight: 500; color: var(--blue); }
.book-why { font-size: 14px; line-height: 1.7; }

.band { margin-top: 96px; background: var(--sky); }
.band .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 56px; padding-top: 72px; padding-bottom: 72px; }
.band-copy { flex: 1 1 300px; display: flex; flex-direction: column; gap: 8px; color: #3D4354; }
.band-copy .heading { color: var(--ink); }
.band-examples { flex: 2 1 480px; display: flex; flex-direction: column; gap: 12px; }
.band-examples li {
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 8px 24px;
  background: rgba(255, 255, 255, .7);
  border-radius: 30px;
  font-family: var(--mincho);
  font-size: 18px;
  line-height: 1.5;
}
.soon { align-self: flex-start; padding: 2px 12px; background: var(--paper); border-radius: 12px; font-size: 12px; font-weight: 500; color: var(--blue); }

.moods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mood {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 148px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}
.mood strong { font-family: var(--mincho); font-weight: 500; font-size: 24px; letter-spacing: .06em; }
.mood span { font-size: 13px; opacity: .82; }
.mood.tone-paper span { color: var(--sub); opacity: 1; }
@media (hover: hover) { .mood.tone-night:hover, .mood.tone-blue:hover { color: #FFFFFF; } }
@media (hover: hover) { .mood.tone-paper:hover { color: var(--ink); } }

.authors { display: flex; flex-wrap: wrap; gap: 4px 36px; font-family: var(--mincho); font-size: 21px; letter-spacing: .08em; }
.authors a { display: inline-flex; align-items: center; min-height: 48px; color: var(--ink); text-decoration: none; }
@media (hover: hover) { .authors a:hover { color: var(--blue); } }

/* ---------- フッター ---------- */

.site-footer { margin-top: 96px; background: var(--paper); border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 32px 72px; padding-top: 56px; padding-bottom: 56px; }
.footer-about { flex: 2 1 380px; display: flex; flex-direction: column; gap: 16px; color: var(--sub); font-size: 14px; }
.footer-about p { max-width: 520px; }
.footer-about .brand img { width: 28px; height: 28px; }
.footer-about .wordmark { width: 93px; height: 19px; }
.footer-nav { flex: 1 1 200px; display: flex; flex-direction: column; font-size: 14px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
@media (hover: hover) { .footer-nav a:hover { color: var(--blue); } }

/* ---------- 検索結果 ---------- */

.page-head { display: flex; flex-direction: column; gap: 8px; padding: 48px 0 32px; }
.page-head h1 { font-family: var(--mincho); font-weight: 500; font-size: 30px; line-height: 1.6; letter-spacing: .04em; }

.results-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px 48px; }
.results-main { flex: 999 1 560px; min-width: 0; min-height: 70vh; display: flex; flex-direction: column; gap: 40px; }
.results-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 36px; }
.results-side section { display: flex; flex-direction: column; gap: 12px; }
.results-list { display: flex; flex-direction: column; gap: 8px; }
.result {
  display: flex;
  align-items: center;
  gap: 16px 28px;
  padding: 20px 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
@media (hover: hover) { .result:hover { color: var(--ink); } }
.result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.result-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.result-title strong { font-family: var(--mincho); font-weight: 600; font-size: 20px; line-height: 1.5; }
.result-title span { font-size: 13px; color: var(--sub); }
.result-opening { font-family: var(--mincho); font-size: 16px; line-height: 1.9; }
.result mark { background: #DDE4FB; color: var(--ink); padding: 2px 0; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.tip { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--sky); border-radius: 6px; font-size: 14px; color: #3D4354; }
.tip h2 { font-family: var(--mincho); font-weight: 600; font-size: 17px; color: var(--ink); }
.empty { padding: 40px 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- 作品ページ ---------- */

.work-top { display: flex; flex-wrap: wrap; align-items: center; gap: 40px 64px; padding: 56px 0 72px; }
.work-info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.work-info h1 { font-family: var(--mincho); font-weight: 500; font-size: 46px; line-height: 1.4; letter-spacing: .06em; }
.work-info .subtitle { font-family: var(--mincho); font-size: 20px; }
.work-people { font-size: 17px; }
.work-people a { color: var(--ink); text-underline-offset: 5px; }
.work-people small { font-size: 13px; color: var(--sub); }
.work-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.sample { display: flex; flex-direction: column; gap: 24px; padding: 40px 48px 32px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.sample-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.sample .vertical {
  width: 100%;
  height: 340px;
  overflow-x: auto;
  overflow-y: hidden;
  font-size: 20px;
  line-height: 2.1;
  padding-bottom: 4px;
  /* 横に送れる。スクロールバーは出さず、続きがある左端を薄くして知らせる。 */
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px);
  mask-image: linear-gradient(to right, transparent, #000 40px);
}
.sample .vertical::-webkit-scrollbar { display: none; }
.sample .vertical p { text-indent: 1em; }
.sample .vertical p.speech { text-indent: 0; }
.sample rt { font-size: .5em; letter-spacing: 0; }
.sample-foot { padding-top: 20px; border-top: 1px solid var(--line-soft); }

.work-columns { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 56px 64px; padding: 88px 0 0; }
.work-columns > * { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 56px; }
.work-columns section { display: flex; flex-direction: column; gap: 16px; }
.contents { border-top: 1px solid var(--line); font-family: var(--mincho); font-size: 18px; }
.contents li { display: flex; align-items: center; min-height: 52px; padding: 6px 12px; border-bottom: 1px solid var(--line); line-height: 1.6; }
.editions { display: flex; flex-direction: column; gap: 8px; }
.edition {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
  padding: 8px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  line-height: 1.6;
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}
@media (hover: hover) { .edition:hover { border-color: var(--blue); color: var(--ink); } }
.edition[aria-current] { border-color: var(--blue); }
.edition strong { font-weight: 700; }
.edition span { font-size: 13px; color: var(--sub); }
.source { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 6px 16px; font-size: 14px; }
.source dt { color: var(--sub); }

/* ---------- 書き出しからえらぶ ---------- */

body.openings {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}
body.openings[data-night='true'] {
  --ground: #0E1430;
  --ink: #F1F2F7;
  --sub: #B4BAD4;
  --line-strong: rgba(255, 255, 255, .3);
  --sky-soft: rgba(255, 255, 255, .08);
}
.openings-header { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 20px var(--gutter); }
.openings-header .tools { display: flex; align-items: center; gap: 4px 20px; }
.openings-header .tools a, .openings-header .tools button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px var(--gutter) 32px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.stage.dragging { cursor: grabbing; }
.slide { display: flex; flex-direction: column; align-items: center; gap: 32px; max-width: 100%; will-change: transform, opacity; }
.slide.animate { transition: transform .22s var(--ease), opacity .22s ease; }
.slide .vertical { height: min(440px, 52vh); max-width: 100%; font-size: 30px; line-height: 2; letter-spacing: .06em; }
.slide .vertical[data-length='long'] { font-size: 25px; }
.slide-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 76px; }
.slide-meta .time { font-size: 14px; }
.slide-meta .reveal { font-size: 14px; padding: 0 8px; }
.slide-title { display: flex; align-items: center; gap: 12px; min-height: 44px; font-family: var(--mincho); font-size: 18px; letter-spacing: .06em; }
.slide-title strong { font-weight: 600; }
.slide-title span { font-size: 15px; }
.stage-controls { display: flex; align-items: center; justify-content: center; gap: 16px; }
.round {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: transform .2s var(--ease), border-color .2s ease;
}
@media (hover: hover) { .round:hover { border-color: var(--blue); transform: translateY(-2px); } }
.round:active { transform: scale(.95); }
body.openings[data-night='true'] .button.primary { background: #FFFFFF; border-color: #FFFFFF; color: #0E1430; }

/* ---------- 読み込み中と不具合 ---------- */

.skeleton { background: var(--line-soft); border-radius: 6px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.problem { padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.problem code { font-size: 13px; }

/* ---------- せまい画面 ---------- */

@media (max-width: 900px) {
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  body { font-size: 14px; }
  .brand img { width: 30px; height: 30px; }
  .wordmark { width: 98px; height: 20px; }
  /* ロゴと検索を1段に並べる。入力中はロゴの文字をたたんで、検索欄を広げる。 */
  .site-header { padding: 8px 0 4px; gap: 0 12px; }
  .search-form { flex: 1 1 0; min-width: 0; height: 44px; padding: 0 14px; gap: 8px; border-radius: 22px; }
  .search-form input { text-overflow: ellipsis; }
  .site-header:has(.search-form:focus-within) .wordmark { display: none; }
  .site-header:has(.search-form:focus-within) .brand::after { display: none; }
  .nav { flex-basis: 100%; flex-wrap: nowrap; justify-content: space-between; gap: 0 12px; margin: 0; font-size: 14px; white-space: nowrap; }

  /* 絞りこみは1段に収め、幅を分け合う。 */
  .chips { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .chip { flex: 1 1 auto; justify-content: center; padding: 0 10px; white-space: nowrap; }

  .display { font-size: 30px; }
  .heading { font-size: 26px; }
  .heading-small { font-size: 22px; }

  .hero { padding: 8px 0 24px; }
  .hero .stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
  .hero-head { align-self: stretch; }
  .hero-title { font-size: 20px; }
  /* Safari は縦書きだけを入れた箱の幅を0と数えるので、幅いっぱいに広げた中で中央に置く。 */
  .hero .slide { align-self: stretch; padding-top: 4px; }
  .hero .slide .vertical { height: 280px; font-size: 23px; }
  .hero .slide .vertical[data-length='long'] { font-size: 19px; }
  .stage-side { align-self: stretch; align-items: center; gap: 12px; }
  .hero .slide-meta { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 16px; min-height: 44px; }
  .hero .stage-controls { align-self: stretch; }
  .hero .stage-controls .button { flex: 1 1 auto; padding: 0 16px; }

  .shelf { padding: 18px 20px; }
  .section { padding-top: 64px; gap: 20px; }
  .books {
    display: flex;
    gap: 14px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .books::-webkit-scrollbar { display: none; }
  .books .book { flex: 0 0 150px; gap: 10px; scroll-snap-align: start; }
  .books .cover { height: 210px; padding: 20px 18px; }
  .books .cover .cover-title { font-size: 22px; }
  .books .cover[data-length='long'] .cover-title { font-size: 17px; }
  .books .cover .cover-author { font-size: 11px; }
  .book-title { flex-direction: column; gap: 0; }
  .book-title strong { font-size: 16px; }
  .book-why { font-size: 13px; }

  .band { margin-top: 64px; }
  .band .wrap { padding-top: 44px; padding-bottom: 44px; gap: 20px; }
  .band-examples li { min-height: 56px; font-size: 15px; padding: 8px 20px; }
  .moods { gap: 10px; }
  .mood { min-height: 104px; padding: 16px 14px; gap: 12px; }
  .mood strong { font-size: 17px; letter-spacing: 0; text-wrap: balance; }
  .mood span { font-size: 12px; line-height: 1.5; }
  .authors { font-size: 18px; gap: 0 24px; }
  .site-footer { margin-top: 64px; }
  .site-footer .wrap { padding-top: 32px; padding-bottom: 32px; gap: 16px; }

  .page-head { padding: 28px 0 20px; }
  .results-side { order: -1; flex-basis: 100%; gap: 16px; }
  .results-side .tip { display: none; }
  .results-layout { gap: 24px; }
  .page-head h1 { font-size: 24px; }
  .result { padding: 16px 18px; gap: 14px; }
  .result-title strong { font-size: 18px; }

  .work-top { padding: 28px 0 40px; gap: 28px; }
  .cover.hero { width: 168px; height: 236px; padding: 24px 20px; }
  .cover.hero .cover-title { font-size: 23px; }
  .cover.hero[data-length='long'] .cover-title { font-size: 18px; }
  .work-info { gap: 18px; }
  .work-info h1 { font-size: 32px; }
  .work-actions { width: 100%; }
  .work-actions .button.large { flex: 1 1 100%; }
  .work-actions .button { flex: 1 1 auto; }
  .sample { padding: 24px 20px 16px; margin: 0 -8px; }
  .sample .vertical { height: 300px; font-size: 18px; }
  .work-columns { padding-top: 56px; gap: 48px; }

  .slide .vertical { font-size: 24px; height: min(400px, 46vh); }
  .slide .vertical[data-length='long'] { font-size: 20px; }
  .stage { gap: 24px; padding-bottom: 24px; }
  .slide { gap: 24px; }
  .button.large { padding: 0 36px; }
  .openings-header { padding-top: 10px; padding-bottom: 10px; }
  .openings-header .label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .lift:hover { transform: none; }
}
