:root {
  --paper: #f8f4eb;
  --paper-deep: #efe5d2;
  --ink: #1c1a17;
  --muted: #6f665b;
  --line: #d7c7aa;
  --gold: #a77c36;
  --green: #314d38;
  --green-soft: #e5ede3;
  --rose: #a33e4b;
  --shadow: 0 18px 45px rgba(73, 56, 34, .12);
  --serif: "Noto Serif JP", serif;
  --sans: "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(167, 124, 54, .08) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .55;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 52px);
  background: rgba(248, 244, 235, .94);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif);
  font-weight: 700;
}
.brand strong { display: block; font: 700 22px/1.2 var(--serif); letter-spacing: .08em; }
.brand small { display: block; color: var(--gold); letter-spacing: .24em; font-size: 11px; margin-top: 4px; }
.site-nav { display: flex; align-items: center; gap: 30px; font-weight: 700; }
.site-nav a { padding: 8px 0; border-bottom: 2px solid transparent; }
.site-nav a.active, .site-nav a:hover { color: var(--gold); border-color: var(--gold); }
.nav-toggle { display: none; }
main { position: relative; z-index: 1; }
.hero {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 44px);
  padding: clamp(54px, 7vw, 90px) clamp(18px, 4vw, 52px) clamp(18px, 3vw, 34px);
  max-width: 1480px;
  margin: 0 auto;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 clamp(18px, 4vw, 52px);
  z-index: -1;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(248, 244, 235, .82) 0%, rgba(248, 244, 235, .68) 44%, rgba(248, 244, 235, .35) 100%),
    url("../img/hero-bg-v1.png") center right / cover no-repeat;
  opacity: .9;
}
.hero-copy {
  position: relative;
  max-width: 760px;
  padding-left: clamp(18px, 3vw, 42px);
}
.eyebrow { margin: 0 0 12px; color: var(--gold); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; }
.hero h1 { margin: 0; font-size: clamp(40px, 5vw, 66px); letter-spacing: .05em; }
.lead { color: #40372d; font-size: clamp(15px, 1.25vw, 17px); max-width: 620px; }
.hero-actions, .detail-actions, .book-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--green);
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  transition: transform .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-1px); background: #253c2b; }
.button.secondary { background: transparent; color: var(--green); }
.detail-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 15px;
  border: 1px solid rgba(49, 77, 56, .28);
  border-radius: 999px;
  background: rgba(229, 237, 227, .72);
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.detail-pill:hover {
  transform: translateY(-1px);
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.starter-panel {
  width: 100%;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid rgba(167, 124, 54, .24);
  border-radius: 8px;
  background: rgba(255, 252, 246, .68);
  box-shadow: var(--shadow);
}
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.panel-heading strong { font: 700 clamp(25px, 2.8vw, 34px) var(--serif); }
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.featured-book { position: relative; text-align: center; border-left: 1px solid var(--line); padding: 0 clamp(12px, 2vw, 26px); }
.featured-book:first-child { border-left: 0; }
.featured-book img {
  width: min(185px, 62%);
  aspect-ratio: 2 / 3;
  object-fit: contain;
  background: var(--paper-deep);
  margin: 0 auto 18px;
  box-shadow: 0 14px 26px rgba(43, 34, 23, .2);
}
.featured-book h3 { min-height: 54px; margin: 0; font-size: clamp(16px, 1.4vw, 22px); }
.featured-book .detail-pill { margin-top: 14px; }
.unlimited-note { text-align: center; color: var(--green); font-weight: 700; margin: 18px 0 0; }
.catalogue { max-width: 1480px; margin: 0 auto; padding: clamp(26px, 4vw, 52px) clamp(18px, 4vw, 52px) 70px; }
.catalogue-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 34px 0 22px; }
.catalogue-head h2 { margin: 0; font-size: clamp(28px, 3vw, 42px); }
.catalogue-head p { margin: 0; color: var(--muted); }
.category-list-head {
  align-items: end;
}
.category-catalogue {
  width: fit-content;
}
.category-grid {
  grid-template-columns: repeat(var(--category-columns), minmax(0, 1fr));
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 28px);
}
.book-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.book-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.cover-link img, .book-card > img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  background: var(--paper-deep);
  box-shadow: 0 12px 24px rgba(43, 34, 23, .15);
}
.book-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.book-meta span,
.book-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(163, 62, 75, .1);
  color: var(--rose);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.book-meta a:hover {
  background: rgba(183, 139, 75, .16);
  color: var(--green);
}
.book-card h3 { margin: 10px 0 8px; font-size: 17px; }
.book-card p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 98px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.book-actions { margin-top: auto; }
.book-actions .button { flex: 1 1 120px; min-height: 38px; padding: 8px 10px; font-size: 13px; }
.breadcrumb, .book-detail, .related, .about-hero, .profile-body, .category-hero {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(18px, 4vw, 52px);
  padding-right: clamp(18px, 4vw, 52px);
}
.category-hero {
  padding-top: clamp(42px, 6vw, 76px);
  padding-bottom: clamp(22px, 4vw, 44px);
}
.category-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 5vw, 62px);
}
.breadcrumb { padding-top: 30px; color: var(--muted); font-size: 14px; }
.breadcrumb a { color: var(--green); font-weight: 700; }
.breadcrumb span::before { content: "/"; margin: 0 10px; color: var(--line); }
.book-detail {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  padding-top: 36px;
  padding-bottom: 54px;
}
.detail-cover img { width: 100%; box-shadow: 0 28px 60px rgba(43, 34, 23, .2); }
.detail-copy h1 { margin: 14px 0 18px; font-size: clamp(34px, 4vw, 56px); }
.detail-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 32px; }
.detail-notes section, .profile-body {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 246, .68);
}
.detail-notes h2 { font-size: 20px; margin: 0 0 10px; }
.detail-notes ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.detail-notes p { margin: 0; color: var(--muted); }
.related { padding-bottom: 44px; }
.faq-section {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 52px) 76px;
}
.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.faq-item {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 246, .68);
}
.faq-item h3 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 18px;
}
.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.about-hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 42px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 34px;
}
.about-hero img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--gold);
  box-shadow: var(--shadow);
}
.about-hero h1 { margin: 0; font-size: clamp(42px, 6vw, 76px); }
.profile-body { margin-bottom: 70px; font-size: 17px; }
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 52px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #f3ebdc;
}
.site-footer strong { color: var(--ink); margin-right: 12px; }
.x-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .2s ease, background .2s ease;
}
.x-share:hover {
  transform: translateY(-1px);
  background: #253c2b;
}
.x-share img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}
.scroll-top {
  position: fixed;
  right: clamp(18px, 3vw, 34px);
  bottom: clamp(92px, 8vw, 118px);
  z-index: 30;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(167, 124, 54, .22);
  border-radius: 50%;
  background: #cbb594;
  color: #2b231c;
  font-size: 34px;
  font-weight: 700;
  line-height: .9;
  box-shadow: 0 14px 28px rgba(43, 34, 23, .24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background .2s ease;
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top:hover { background: #d7c2a0; }
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .site-header { align-items: flex-start; }
  .brand strong { font-size: 18px; }
  .brand-mark { width: 40px; height: 40px; }
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
  }
  .nav-toggle span,
  .nav-toggle span::before,
  .nav-toggle span::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
  }
  .nav-toggle span {
    position: relative;
  }
  .nav-toggle span::before,
  .nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .nav-toggle span::before { top: -7px; }
  .nav-toggle span::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] span {
    background: transparent;
  }
  .nav-toggle[aria-expanded="true"] span::before {
    top: 0;
    transform: rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span::after {
    top: 0;
    transform: rotate(-45deg);
  }
  .site-nav {
    display: none;
    position: absolute;
    left: 18px;
    right: 18px;
    top: 76px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .hero { padding-top: 34px; }
  .hero-copy { padding-left: 8px; }
  .hero h1 { font-size: 39px; }
  .featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .featured-book { border-left: 1px solid var(--line); padding: 0 5px; }
  .featured-book:first-child { border-left: 0; }
  .featured-book img { width: min(78px, 100%); }
  .featured-book h3 { min-height: 62px; font-size: 11px; line-height: 1.45; }
  .featured-book .detail-pill { min-height: 30px; padding: 5px 10px; font-size: 12px; }
  .panel-heading { align-items: start; flex-direction: column; gap: 4px; }
  .panel-heading strong { font-size: 20px; }
  .detail-notes, .about-hero { grid-template-columns: 1fr; }
  .faq-list { grid-template-columns: 1fr; }
  .book-grid, .book-grid.compact { grid-template-columns: 1fr 1fr; }
  .book-detail { grid-template-columns: 1fr; }
  .detail-cover img { max-width: 320px; margin: 0 auto; }
  .site-footer { flex-direction: column; }
  .scroll-top {
    right: 18px;
    bottom: 86px;
    width: 50px;
    height: 50px;
    font-size: 30px;
  }
}
@media (max-width: 500px) {
  .book-grid, .book-grid.compact { grid-template-columns: 1fr; }
  .catalogue-head { align-items: start; flex-direction: column; }
  .book-card p { min-height: 0; }
}
