:root {
  color-scheme: light;
  --ink: #172628;
  --ink-soft: #485c5e;
  --board: #f7faf7;
  --board-line: rgba(36, 86, 81, 0.08);
  --frame: #b9aa8b;
  --accent: #0d6f68;
  --accent-dark: #084b47;
  --paper: #fffef8;
  --shadow: 0 14px 40px rgba(24, 49, 48, 0.14);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.7;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 280px;
  color: var(--ink);
  background: #e7e5dc;
}

a { color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 80px;
  padding: 12px clamp(16px, 4vw, 56px);
  background: rgba(255, 254, 248, .96);
  border-bottom: 1px solid #d7d4c9;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  text-decoration: none;
}

.brand picture { display: inline-flex; flex: 0 0 auto; }

.brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 2px 3px 0 rgba(23, 38, 40, .16);
}

.brand-name { font-weight: 800; letter-spacing: .035em; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  text-underline-offset: 4px;
}

main {
  width: min(1180px, calc(100% - 24px));
  margin: 24px auto;
}

.whiteboard {
  position: relative;
  isolation: isolate;
  min-height: min(760px, calc(100vh - 130px));
  padding: clamp(28px, 6vw, 76px);
  background-color: var(--board);
  background-image:
    linear-gradient(var(--board-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--board-line) 1px, transparent 1px),
    radial-gradient(circle at 20% 14%, rgba(255,255,255,.9), transparent 35%),
    linear-gradient(135deg, rgba(255,255,255,.85), rgba(231,239,234,.65));
  background-size: 32px 32px, 32px 32px, auto, auto;
  border: 10px solid var(--frame);
  border-radius: 10px;
  box-shadow: var(--shadow), inset 0 0 30px rgba(23,38,40,.08);
}

.whiteboard::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(ellipse at 75% 18%, rgba(13, 111, 104, .035), transparent 24%),
    radial-gradient(ellipse at 22% 82%, rgba(23, 38, 40, .035), transparent 30%);
  mix-blend-mode: multiply;
}

.whiteboard::after {
  position: absolute;
  right: clamp(20px, 5vw, 64px);
  bottom: -8px;
  width: min(34vw, 240px);
  height: 12px;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, #c94f14 0 44%, #172628 44% 100%);
  border: 2px solid rgba(23, 38, 40, .72);
  border-radius: 999px;
  box-shadow: 2px 3px 0 rgba(23, 38, 40, .14);
  transform: rotate(-1deg);
}

.hero { max-width: 760px; margin-bottom: clamp(28px, 5vw, 52px); }
.eyebrow { margin: 0 0 4px; color: var(--accent-dark); font-weight: 800; letter-spacing: .12em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2.35rem, 8vw, 6.5rem); line-height: 1.05; letter-spacing: -.04em; }
.candle-i {
  position: relative;
  display: inline-block;
  color: inherit;
}
.candle-i::after {
  content: "";
  position: absolute;
  top: .02em;
  left: 50%;
  width: .12em;
  height: .17em;
  border-radius: 55% 45% 58% 42% / 68% 62% 38% 32%;
  background: #d83b2d;
  box-shadow: 0 0 .07em rgba(216, 59, 45, .32);
  transform: translate(-50%, -10%) rotate(5deg);
}

.board-menu {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 18px);
  width: min(100%, 760px);
}

.marker-card,
.marker-link {
  width: 100%;
  min-height: 94px;
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
  border: 3px solid currentColor;
  border-radius: 48% 52% 47% 53% / 16% 13% 17% 14%;
  box-shadow: 4px 5px 0 rgba(13, 111, 104, .18);
  transform: rotate(var(--tilt, -.25deg));
  transition: color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.marker-card:nth-child(2) { --tilt: .3deg; }
.marker-link:nth-child(3) { --tilt: -.2deg; }
.marker-link:nth-child(4) { --tilt: .25deg; }
.marker-card summary,
.marker-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 90px;
  padding: 16px clamp(20px, 4vw, 38px);
  font-family: "Yu Kyokasho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  text-decoration: none;
}

.marker-card summary { list-style: none; }
.marker-card summary::-webkit-details-marker { display: none; }
.marker-card summary::after,
.marker-link::after {
  flex: 0 0 auto;
  margin-left: 20px;
  color: var(--accent);
  font-family: "Segoe Print", "Yu Kyokasho", sans-serif;
  font-size: 1.35em;
  font-weight: 500;
  line-height: 1;
}
.marker-card summary::after { content: "+"; }
.marker-card[open] summary::after { content: "−"; }
.marker-link::after { content: "→"; }
.marker-card:not([open]) > .marker-content { display: none; }
.marker-card[open] { background: rgba(255, 255, 255, .94); transform: none; }
.marker-card[open] summary { min-height: 70px; padding-bottom: 6px; }
.marker-content { padding: 0 clamp(18px, 4vw, 36px) 28px; }
.marker-content ul { padding-left: 1.3em; }
.compact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.compact-links .button {
  background: rgba(13, 111, 104, .09);
  border: 2px solid var(--accent);
  color: var(--accent-dark);
}
.compact-links .button:hover,
.compact-links .button:focus-visible {
  background: var(--accent);
  color: white;
}
.marker-card:hover,
.marker-link:hover {
  color: var(--accent-dark);
  background: white;
  box-shadow: 6px 7px 0 rgba(13, 111, 104, .22);
  transform: translateX(4px) rotate(0);
}

.button {
  background: var(--accent);
  color: white;
  text-decoration: none;
}
.button:hover { background: var(--accent-dark); }

.page-shell {
  min-height: calc(100vh - 130px);
  padding: clamp(20px, 3.5vw, 42px);
  background: var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.page-intro { max-width: 700px; margin-bottom: clamp(16px, 2.5vw, 26px); }
.page-intro h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.8rem); }
.infinity-oo {
  display: inline-block;
  margin: 0 .04em 0 -.01em;
  color: #d83b2d;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-weight: 900;
  letter-spacing: -.22em;
  transform: rotate(-4deg) scaleX(1.08);
  transform-origin: center;
}
.empty-state {
  max-width: 720px;
  padding: clamp(24px, 5vw, 48px);
  background: var(--board);
  border: 3px solid var(--ink);
  border-radius: 46% 54% 51% 49% / 9% 12% 10% 11%;
}

.book-grid { display: grid; gap: 24px; }
.book-card {
  display: grid;
  grid-template-columns: clamp(130px, 18vw, 190px) minmax(0, 1fr);
  grid-template-areas:
    "cover title"
    "cover meta"
    "cover description"
    "cover notice"
    "cover actions";
  align-content: start;
  column-gap: clamp(20px, 3vw, 38px);
  max-width: 980px;
  padding: clamp(16px, 2.5vw, 28px);
  background: white;
  border: 1px solid #d6d6cc;
  border-radius: 8px;
  box-shadow: 0 7px 24px rgba(23,38,40,.08);
}
.book-cover {
  grid-area: cover;
  width: 100%;
  height: auto;
  max-width: 190px;
  object-fit: cover;
  background: #eee;
}
.book-cover-picture {
  grid-area: cover;
  display: block;
  width: 100%;
  max-width: 190px;
}
.book-title {
  grid-area: title;
  align-self: end;
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.35;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.book-description {
  grid-area: description;
  max-width: 68ch;
  margin: 10px 0 0;
  font-size: clamp(.9rem, .4vw + .82rem, 1rem);
  line-height: 1.78;
}
.book-usage-notice {
  grid-area: notice;
  display: flex;
  align-items: baseline;
  gap: .65em;
  max-width: 68ch;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f5f6f2;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.65;
}
.book-usage-notice strong { flex: 0 0 auto; color: var(--ink); }
.book-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.button-disabled,
.button-disabled:hover {
  border: 1px dashed #85908e;
  background: #eef0ed;
  color: #59615f;
  cursor: not-allowed;
}
.book-cover-placeholder {
  display: grid;
  place-content: center;
  aspect-ratio: 3 / 4;
  gap: 12px;
  padding: 24px;
  overflow: hidden;
  border: 3px solid var(--ink);
  background:
    linear-gradient(132deg, transparent 0 44%, rgba(13, 111, 104, .11) 44% 56%, transparent 56%),
    repeating-linear-gradient(0deg, rgba(23, 38, 40, .035) 0 1px, transparent 1px 18px),
    var(--board);
  color: var(--ink);
  text-align: center;
}
.book-cover-placeholder span {
  color: var(--accent-dark);
  font-family: "Segoe Print", "Yu Kyokasho", sans-serif;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
}
.book-cover-placeholder strong {
  font-family: "Yu Kyokasho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.35rem, 4vw, 2rem);
}
.book-meta { grid-area: meta; margin: 8px 0 0; color: var(--ink-soft); }

.books-page {
  color: #1c1c1c;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.85;
}
.books-page main {
  width: min(calc(100% - 32px), 760px);
  margin: 0 auto;
  padding: 56px 0 72px;
}
.books-shell { width: 100%; }
.featured-book h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.28;
  letter-spacing: .01em;
}
.featured-book h2 {
  margin: 56px 0 18px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.45;
}
.featured-book p { margin: 0 0 1.15em; }
.featured-book-eyebrow {
  color: #666;
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.featured-book-meta,
.featured-book-read-meta { color: #666; }
.featured-book-meta { margin-bottom: 24px !important; }
.featured-book-lead { font-size: 1.1rem; }
.featured-book-cover {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin: 32px auto;
  border: 1px solid #e4e4e4;
}
.featured-book-cover-picture { display: block; }
.books-cta-wrap { margin: 28px 0; }
.books-cta {
  display: inline-block;
  min-height: 44px;
  padding: 14px 20px;
  border: 1px solid #1c1c1c;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.books-cta:hover,
.books-cta:focus-visible { color: #fff; background: #1c1c1c; }
.books-cta-note {
  margin-top: 8px;
  color: #666;
  font-size: .92rem;
}
.featured-book-themes { padding-left: 1.2em; }
.featured-book-info {
  margin: 32px 0;
  padding: 22px;
  background: #f7f7f7;
  border-radius: 10px;
}
.featured-book-info p { margin: 0; }
.featured-book-faq {
  padding: 16px 0;
  border-top: 1px solid #e4e4e4;
}
.featured-book-faq:last-child { border-bottom: 1px solid #e4e4e4; }
.featured-book-faq summary { cursor: pointer; font-weight: 700; }
.featured-book-faq p { margin: 12px 0 0; }
.other-books {
  margin-top: 72px;
  padding-top: 8px;
  border-top: 1px solid #e4e4e4;
}
.other-books .book-title { white-space: normal; }

.site-footer { padding: 28px 16px 40px; text-align: center; color: var(--ink-soft); }

:focus-visible { outline: 3px solid #c94f14; outline-offset: 4px; }

@media (max-width: 680px) {
  main { margin-top: 12px; }
  .books-page main { margin-top: 0; padding: 36px 0 56px; }
  .page-shell { padding: 16px; }
  .page-intro h1 { font-size: 2.25rem; }
  .book-card {
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-areas:
      "title title"
      "cover meta"
      "description description"
      "notice notice"
      "actions actions";
    gap: 10px 14px;
    padding: 14px;
  }
  .book-cover,
  .book-cover-picture { max-width: 84px; }
  .book-cover-placeholder { gap: 5px; padding: 8px; border-width: 2px; }
  .book-cover-placeholder span { font-size: .52rem; letter-spacing: .08em; }
  .book-cover-placeholder strong { font-size: .85rem; line-height: 1.25; }
  .book-title { align-self: center; font-size: .72rem; line-height: 1.35; letter-spacing: -.055em; }
  .book-actions { margin-top: 2px; }
  .book-description { margin-top: 2px; font-size: .9rem; line-height: 1.72; }
  .book-usage-notice { display: block; margin-top: 4px; }
  .book-usage-notice strong { display: block; margin-bottom: 2px; }
  .whiteboard { padding: 24px 16px 34px; border-width: 6px; }
  .marker-card,
  .marker-link { min-height: 82px; }
  .marker-card summary,
  .marker-link { min-height: 78px; }
}

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

@media print {
  body { background: white; }
  .site-header, .whiteboard, .page-shell { box-shadow: none; }
}
