/* ===== Base ===== */
:root {
  --offwhite: #f5f0e8;
  --sakura: #fae8f0;
  --sakura-deep: #f4a7b9;
  --sumi: #2c2416;
  --sumi-soft: #5a4d3a;
  --line: #e8ddd0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Serif JP', 'Yu Mincho', '游明朝', serif;
  color: var(--sumi);
  background: var(--offwhite);
  line-height: 1.9;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sumi); text-decoration: none; transition: opacity .3s; }
a:hover { opacity: .6; }

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

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.site-nav ul {
  display: flex;
  gap: 1.8rem;
  list-style: none;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  color: var(--sumi-soft);
}
.site-nav a:hover { color: var(--sumi); opacity: 1; }

/* ===== Hero (top page) ===== */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(175deg, #fdf0f5, #fae8f0, #f5e0ea); /* 既定（春） */
  overflow: hidden;
  transition: background 1.2s ease;
}

/* ===== 季節ごとの背景色 ===== */
body.season-spring .hero {
  background: linear-gradient(175deg, #fdf0f5, #fae8f0, #f5e0ea);
}
body.season-summer .hero {
  background: linear-gradient(175deg, #f4f9ff, #e6f1fb, #d6e8f6);
}
body.season-autumn .hero {
  background: linear-gradient(175deg, #faf2e8, #f3e0d2, #ecd0bc);
}
body.season-winter .hero {
  background: linear-gradient(175deg, #f8fbff, #ecf1f7, #dde5ee);
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 2rem;
}

.hero-name {
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: 0.4em;
  font-weight: 500;
  margin-bottom: 1.5rem;
  text-indent: 0.4em;
}

.hero-catch {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  letter-spacing: 0.2em;
  color: var(--sumi-soft);
  margin-bottom: 2rem;
}

.hero-sub {
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: var(--sumi-soft);
}

/* ===== Particle wrap (四季共通) ===== */
.particle-wrap, .sakura-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.particle {
  position: absolute;
  top: -40px;
  opacity: 0.85;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* 春：桜の花びら（落ちながら回転） */
.petal-spring,
.petal /* 旧クラス互換 */ {
  border-radius: 150% 0 150% 0;
  animation-name: fall-spring;
}
@keyframes fall-spring {
  0%   { transform: translate3d(0, -40px, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.85; }
  100% { transform: translate3d(var(--drift, 0px), 100vh, 0) rotate(360deg); opacity: 0.7; }
}

/* 夏：ひまわり光（ぼんやり光る粒、ゆったり降りてくる） */
.petal-summer {
  border-radius: 50%;
  filter: blur(0.6px);
  box-shadow: 0 0 8px currentColor;
  animation-name: fall-summer;
}
@keyframes fall-summer {
  0%   { transform: translate3d(0, -40px, 0); opacity: 0; }
  15%  { opacity: 0.7; }
  100% { transform: translate3d(var(--drift, 0px), 100vh, 0); opacity: 0.5; }
}

/* 秋：コスモス（風に大きく揺れて落ちる） */
.petal-autumn {
  border-radius: 150% 0 150% 0;
  animation-name: fall-autumn;
}
@keyframes fall-autumn {
  0%   { transform: translate3d(0, -40px, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.85; }
  30%  { transform: translate3d(calc(var(--drift, 0px) * 0.6), 25vh, 0) rotate(120deg); }
  60%  { transform: translate3d(calc(var(--drift, 0px) * -0.4), 55vh, 0) rotate(240deg); }
  100% { transform: translate3d(calc(var(--drift, 0px) * 0.3), 100vh, 0) rotate(360deg); opacity: 0.6; }
}

/* 冬：雪（しんしんと、まっすぐ降る） */
.petal-winter {
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255,255,255,0.85);
  animation-name: fall-winter;
}
@keyframes fall-winter {
  0%   { transform: translate3d(0, -40px, 0); opacity: 0; }
  15%  { opacity: 0.95; }
  100% { transform: translate3d(var(--drift, 0px), 100vh, 0); opacity: 0.8; }
}

/* アクセシビリティ：動きを減らす設定の方には停止 */
@media (prefers-reduced-motion: reduce) {
  .particle { animation: none !important; opacity: 0; }
}

/* ===== Page sections ===== */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

.page-title {
  font-size: 1.8rem;
  letter-spacing: 0.3em;
  text-align: center;
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.page-title-en {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--sumi-soft);
  margin-bottom: 3rem;
  font-family: 'Noto Serif JP', serif;
}

.page p { margin-bottom: 1.4rem; }

/* ===== Profile ===== */
.profile-box {
  background: #fff;
  border: 1px solid var(--line);
  padding: 2.5rem 2rem;
  margin-top: 2rem;
}

.profile-box dt {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--sumi-soft);
  margin-top: 1.2rem;
}
.profile-box dt:first-child { margin-top: 0; }
.profile-box dd { margin-bottom: 0.4rem; }

/* ===== Book ===== */
.book-cover {
  text-align: center;
  margin: 2rem 0 3rem;
}
.book-cover-art {
  display: inline-block;
  width: 220px;
  height: 310px;
  background: linear-gradient(160deg, #fff 0%, #faf3ec 100%);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(44,36,22,0.08);
  position: relative;
  padding: 2rem 1.2rem;
}
.book-cover-art .b-title {
  font-size: 1.3rem;
  letter-spacing: 0.25em;
  writing-mode: vertical-rl;
  margin: 0 auto;
  height: 100%;
}
.book-cover-art .b-author {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--sumi-soft);
}

.book-meta {
  text-align: center;
  font-size: 0.9rem;
  color: var(--sumi-soft);
  letter-spacing: 0.1em;
}

.toc {
  margin: 3rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2rem 0;
}
.toc h3 {
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.toc ol {
  list-style: none;
  counter-reset: chap;
  max-width: 480px;
  margin: 0 auto;
}
.toc li {
  counter-increment: chap;
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}
.toc li::before {
  content: "第" counter(chap, cjk-ideographic) "章 ";
  color: var(--sakura-deep);
  margin-right: 0.6em;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}
.toc li:last-child { border-bottom: none; }

.buy-btn {
  display: block;
  width: fit-content;
  margin: 2rem auto 0;
  padding: 0.9rem 2.5rem;
  background: var(--sumi);
  color: var(--offwhite);
  letter-spacing: 0.3em;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: background .3s;
}
.buy-btn:hover { background: var(--sumi-soft); opacity: 1; }

/* ===== Words list ===== */
.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}
.word-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.8rem 1.2rem;
  text-align: center;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform .3s, box-shadow .3s;
}
.word-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(44,36,22,0.06);
}
.word-card .num {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--sakura-deep);
  margin-bottom: 0.6rem;
}
.word-card .text {
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  line-height: 1.7;
}

/* ===== Contact / SNS ===== */
.sns-list {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  list-style: none;
  margin: 2rem 0 3rem;
  flex-wrap: wrap;
}
.sns-list a {
  display: block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  background: #fff;
}

.contact-form {
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  padding: 2.5rem 2rem;
}
.contact-form label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--sumi-soft);
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--offwhite);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--sumi);
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form button {
  display: block;
  margin: 2rem auto 0;
  padding: 0.9rem 3rem;
  background: var(--sumi);
  color: var(--offwhite);
  border: none;
  letter-spacing: 0.3em;
  cursor: pointer;
  font-family: inherit;
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--sumi-soft);
  border-top: 1px solid var(--line);
}

/* ===== Brush calligraphy gallery ===== */
.brush-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.brush-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.6rem;
  margin: 0;
  transition: transform .3s, box-shadow .3s;
  cursor: pointer;
}
.brush-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(44,36,22,0.10);
}
.brush-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.brush-card figcaption {
  text-align: center;
  margin-top: 0.6rem;
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--sakura-deep);
}

/* ===== Featured words preview (top page) — auto slide ===== */
.featured-words {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}
.featured-words-scroll-wrap {
  position: relative;
  margin-top: 2rem;
  margin-bottom: 2rem;
  overflow: hidden;
  /* Subtle fade on both edges */
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}
.featured-words-grid {
  display: flex;
  gap: 1.2rem;
  width: max-content;
  padding: 0.4rem 0;
  animation: featured-slide 90s linear infinite;
}
.featured-words-scroll-wrap:hover .featured-words-grid {
  animation-play-state: paused;
}
@keyframes featured-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .featured-words-grid { animation: none; }
}
.featured-words-grid > a {
  flex: 0 0 auto;
  text-decoration: none;
}
.featured-words-grid figure {
  margin: 0;
  width: 280px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.4rem;
  transition: transform .3s, box-shadow .3s;
}
.featured-words-grid figure:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(44,36,22,0.08);
}
.featured-words-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.featured-words-more {
  text-align: center;
  margin-top: 1.5rem;
}

/* ===== Featured book (top page) ===== */
.featured-book {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}
.featured-label {
  text-align: center;
  color: var(--sakura-deep);
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  margin-bottom: 2rem;
}
.featured-inner {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}
.featured-cover {
  flex-shrink: 0;
  display: block;
}
.featured-cover img {
  display: block;
  width: 220px;
  height: auto;
  box-shadow: 0 8px 24px rgba(44,36,22,0.12);
  transition: transform .3s, box-shadow .3s;
}
.featured-cover:hover img {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(44,36,22,0.16);
}
.featured-info {
  flex: 1;
}
.featured-title {
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
}
.featured-sub {
  color: var(--sumi-soft);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}
.featured-status {
  display: inline-block;
  padding: 0.25rem 0.9rem;
  background: var(--sakura-deep);
  color: var(--offwhite);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.6rem;
}
.featured-meta {
  color: var(--sumi-soft);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}
.featured-desc {
  line-height: 1.9;
  margin-bottom: 1.5rem;
}
.featured-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.buy-btn-primary {
  background: var(--sakura-deep);
}
.buy-btn-primary:hover { background: var(--sumi); }

/* ===== Books list ===== */
.book-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  transition: transform .3s, box-shadow .3s;
}
.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(44,36,22,0.06);
}
.book-card-title {
  font-size: 1.3rem;
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: 0.4rem;
}
.book-card-title a {
  color: var(--sumi);
  text-decoration: none;
}
.book-card-title a:hover {
  color: var(--sakura-deep);
}
.book-card-sub {
  text-align: center;
  color: var(--sumi-soft);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.book-card-meta {
  text-align: center;
  color: var(--sakura-deep);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}
.book-card-desc {
  line-height: 1.9;
  color: var(--sumi-soft);
}
.buy-btn-inline {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: var(--sumi);
  color: var(--offwhite);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background .3s;
}
.buy-btn-inline:hover { background: var(--sumi-soft); opacity: 1; }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .nav-inner { padding: 0.8rem 1rem; }
  .site-nav ul { gap: 1rem; }
  .site-nav a { font-size: 0.82rem; }
  .page { padding: 3rem 1.2rem 4rem; }
  .page-title { font-size: 1.4rem; }
  .hero-name { letter-spacing: 0.3em; }
  .profile-box, .contact-form { padding: 1.8rem 1.3rem; }
  .book-card { padding: 1.8rem 1.3rem; }
  .featured-inner { flex-direction: column; gap: 1.5rem; text-align: center; }
  .featured-cover img { width: 180px; }
  .featured-actions { justify-content: center; }
  .featured-words-grid figure { width: 220px; }
  .brush-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
