/* =========================================================
   Bilibala Reads — literary, warm, trilingual site
   ========================================================= */

:root {
  --bg: #f7f3ec;
  --bg-elevated: #fffdf8;
  --bg-soft: #efe8dc;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --ink-muted: #78716c;
  --line: rgba(28, 25, 23, 0.1);
  --accent: #b45309;
  --accent-deep: #92400e;
  --accent-soft: #fde68a;
  --rose: #be5a4a;
  --teal: #0f766e;
  --shadow: 0 18px 50px rgba(28, 25, 23, 0.08);
  --shadow-sm: 0 8px 24px rgba(28, 25, 23, 0.06);
  --radius: 20px;
  --radius-sm: 12px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino,
    "Noto Serif TC", "Songti TC", "Source Han Serif TC", serif;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang TC", "PingFang SC",
    "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --max: 1120px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fde8c8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e7f0ea 0%, transparent 50%),
    var(--bg);
  line-height: 1.65;
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

/* ---- Layout ---- */
.container {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

.section {
  padding: 5rem 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 36rem;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(247, 243, 236, 0.82);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-header.scrolled {
  border-color: var(--line);
  box-shadow: 0 8px 30px rgba(28, 25, 23, 0.04);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f59e0b, #b45309);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 8px 20px rgba(180, 83, 9, 0.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 550;
  transition: background 0.2s, color 0.2s;
}

.nav a:hover,
.nav a.active {
  background: var(--bg-soft);
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-switch {
  position: relative;
}

.lang-switch select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 0.5rem 2rem 0.5rem 0.9rem;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2357534e' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s,
    border-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(145deg, #d97706, #b45309);
  color: #fff;
  box-shadow: 0 12px 28px rgba(180, 83, 9, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 16px 34px rgba(180, 83, 9, 0.34);
}

.btn-ghost {
  background: rgba(255, 253, 248, 0.7);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
}

.btn-sm {
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
}

/* ---- Hero ---- */
.hero {
  padding: 3.5rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.1);
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 650;
  margin-bottom: 1.1rem;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.15);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 1.75rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 28rem;
}

.stat {
  background: rgba(255, 253, 248, 0.75);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.stat span {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.hero-card {
  position: relative;
  border-radius: 28px;
  padding: 1.5rem;
  background:
    linear-gradient(160deg, rgba(255, 253, 248, 0.95), rgba(255, 248, 235, 0.9)),
    radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.18), transparent 40%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 360px;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: auto -20% -30% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.12), transparent 70%);
  pointer-events: none;
}

.quote-stack {
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.quote-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.quote-card .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.quote-card p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.5;
}

.quote-card .from {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.floating-books {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
  position: relative;
  z-index: 1;
}

.mini-book {
  flex: 1;
  border-radius: 14px;
  padding: 0.9rem 0.7rem;
  color: #fff;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transform: rotate(-2deg);
  transition: transform 0.25s var(--ease);
}

.mini-book:nth-child(2) {
  transform: rotate(1.5deg) translateY(-6px);
}

.mini-book:nth-child(3) {
  transform: rotate(-1deg);
}

.mini-book:hover {
  transform: rotate(0) translateY(-4px) scale(1.02);
}

.mini-book .emoji {
  font-size: 1.3rem;
}

.mini-book .name {
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
}

/* ---- Cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.book-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.book-card-cover {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  color: #fff;
  position: relative;
}

.book-card-cover .emoji {
  font-size: 2.2rem;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
}

.book-card-cover .badge {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
}

.book-card-body {
  padding: 1.15rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.book-card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.book-card-body .meta {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.book-card-body .excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

/* ---- Catalog controls ---- */
.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 0.8rem 1rem 0.8rem 2.6rem;
  box-shadow: var(--shadow-sm);
  outline: none;
}

.search-box input:focus {
  border-color: rgba(180, 83, 9, 0.35);
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.1);
}

.search-box .icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: rgba(180, 83, 9, 0.35);
  color: var(--ink);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-muted);
  background: rgba(255, 253, 248, 0.6);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---- Detail view ---- */
.detail-view {
  display: none;
  padding: 2rem 0 4rem;
}

.detail-view.active {
  display: block;
}

.page-view {
  display: block;
}

.page-view.hidden {
  display: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.back-link:hover {
  color: var(--accent-deep);
}

.detail-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2rem;
}

.detail-cover {
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 4rem;
  color: #fff;
  box-shadow: var(--shadow);
}

.detail-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail-hero .subtitle {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1.25rem;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0 0 0.85rem;
}

.panel p {
  margin: 0;
  color: var(--ink-soft);
}

.takeaway-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.takeaway-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: var(--bg);
}

.takeaway-list .num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.inspiration-box {
  background: linear-gradient(145deg, #fff7ed, #fef3c7);
  border: 1px solid rgba(180, 83, 9, 0.15);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}

.inspiration-box p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0;
  color: var(--ink);
}

.video-list {
  display: grid;
  gap: 0.6rem;
}

.video-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: background 0.2s, border-color 0.2s;
}

.video-link:hover {
  background: #fff;
  border-color: rgba(180, 83, 9, 0.3);
}

.video-link .play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ff0033;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.video-link span {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---- Inspiration page ---- */
.inspiration-stage {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.inspiration-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.inspiration-card::before {
  content: "“";
  position: absolute;
  top: -0.2rem;
  left: 1.2rem;
  font-family: var(--font-serif);
  font-size: 7rem;
  line-height: 1;
  color: rgba(180, 83, 9, 0.12);
}

.inspiration-card blockquote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
  position: relative;
}

.inspiration-card cite {
  display: block;
  margin-top: 1.25rem;
  font-style: normal;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
}

.values {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.value-item {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.value-item strong {
  display: block;
  margin-bottom: 0.25rem;
}

.value-item span {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.about-aside {
  background:
    linear-gradient(160deg, rgba(15, 118, 110, 0.08), rgba(180, 83, 9, 0.08)),
    var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 100%;
}

.about-aside h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 0 0 0.6rem;
}

.yt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #c00;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  margin-top: 2rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: start;
}

.footer-brand {
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* ---- Views ---- */
#main-content {
  min-height: calc(100vh - var(--header-h) - 140px);
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .hero-grid,
  .detail-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-hero {
    grid-template-columns: 120px 1fr;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(247, 243, 236, 0.98);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1.25rem 1rem;
    gap: 0.25rem;
  }

  .nav.open {
    display: flex;
  }

  .menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--max), calc(100% - 1.5rem));
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-cover {
    width: 140px;
    aspect-ratio: 1;
    border-radius: 24px;
  }

  .brand-text span {
    display: none;
  }

  .section {
    padding: 3.5rem 0;
  }
}

/* ---- Motion reduce ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .book-card,
  .btn,
  .mini-book {
    transition: none;
  }
}

/* ---- Brand avatar / mascot ---- */
.brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(180, 83, 9, 0.22);
  border: 2px solid rgba(255, 253, 248, 0.9);
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid var(--line);
}

.hero-card-mascot {
  display: grid;
  gap: 1rem;
}

.mascot-panel {
  text-align: center;
  position: relative;
  z-index: 1;
}

.mascot-img {
  width: min(280px, 70%);
  height: auto;
  margin: 0 auto;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 4px solid rgba(255, 253, 248, 0.95);
  background: #fff;
}

.mascot-caption {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.about-mascot-wrap {
  display: flex;
  justify-content: center;
}

.about-mascot {
  width: 160px;
  height: 160px;
  border-radius: 28px;
  object-fit: cover;
  border: 4px solid rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow-sm);
}

.inspiration-mascot {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
  display: block;
}

.loading-screen {
  min-height: 50vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 1rem;
  color: var(--ink-soft);
  padding: 3rem 1rem;
}

.loading-mascot {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  object-fit: cover;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
}

.section-alt {
  background: rgba(255, 253, 248, 0.45);
  border-block: 1px solid var(--line);
}

/* ---- Blog cards & posts ---- */
.cards-posts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.post-card-cover {
  height: 110px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  color: #fff;
}

.post-card-cover .emoji {
  font-size: 2rem;
}

.post-card-cover .badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
}

.post-card-body {
  padding: 1.15rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.post-card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.3;
}

.post-card-body .meta {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.post-card-body .excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-layout {
  max-width: 760px;
}

.post-article {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.post-hero-band {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  color: #fff;
}

.post-hero-band .emoji {
  font-size: 3rem;
}

.post-mascot {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.post-header {
  padding: 1.5rem 1.6rem 0.5rem;
}

.post-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.post-body {
  padding: 0.5rem 1.6rem 2rem;
}

.prose p {
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 1.5rem 0 0.6rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.prose li {
  margin-bottom: 0.35rem;
}

.related-books h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 0.85rem;
}

.related-list {
  display: grid;
  gap: 0.5rem;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}

.related-item:hover {
  border-color: rgba(180, 83, 9, 0.35);
  background: #fff;
}

.related-item .emoji {
  font-size: 1.3rem;
}

@media (max-width: 960px) {
  .cards-posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cards-posts {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }
}
