:root {
  --ink: #242424;
  --paper: #fffaf2;
  --white: #ffffff;
  --clay: #9b4f3f;
  --indigo: #3b347f;
  --sky: #35a9dc;
  --leaf: #4d9b62;
  --sun: #f3a12f;
  --rose: #d84768;
  --shadow: 0 18px 45px rgba(31, 28, 21, 0.16);
  --soft-shadow: 0 10px 26px rgba(31, 28, 21, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  letter-spacing: 0;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(53, 169, 220, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(243, 161, 47, 0.2), transparent 42%),
    var(--paper);
}

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

a {
  color: inherit;
}

.home-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.home-layout {
  min-height: 100vh;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(280px, 1fr);
  align-items: center;
  gap: 44px;
  padding: 32px 0;
}

.home-art {
  position: relative;
}

.home-art::before {
  content: "";
  position: absolute;
  inset: 18px -12px -14px 20px;
  background:
    repeating-linear-gradient(90deg, rgba(59, 52, 127, 0.16) 0 18px, transparent 18px 34px),
    rgba(77, 155, 98, 0.18);
  border-radius: 8px;
  transform: rotate(-2deg);
}

.cover-image {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 64px);
  object-fit: contain;
  border: 8px solid var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--white);
}

.home-copy {
  padding: 16px 0;
}

.book-label {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4rem;
  line-height: 1.02;
  color: var(--indigo);
}

.home-intro {
  max-width: 560px;
  margin: 20px 0 26px;
  font-size: 1.25rem;
  line-height: 1.55;
}

.home-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.primary-action,
.secondary-action,
.nav-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  border: 2px solid transparent;
  text-decoration: none;
  font-weight: 800;
}

.primary-action {
  padding: 14px 24px;
  color: var(--white);
  background: var(--rose);
  box-shadow: 0 10px 0 #a92e4b, var(--soft-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 0 #a92e4b, var(--soft-shadow);
}

.play-mark {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--white);
}

.feature-strip {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-strip span,
.theme-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--white);
  font-weight: 800;
}

.feature-strip span:nth-child(1) {
  background: var(--clay);
}

.feature-strip span:nth-child(2) {
  background: var(--sky);
}

.feature-strip span:nth-child(3) {
  background: var(--leaf);
}

.feature-strip span:nth-child(4) {
  background: var(--sun);
  color: #302212;
}

.site-header {
  min-height: 112px;
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  align-items: center;
  gap: 18px;
  padding: 22px max(20px, calc((100% - 1180px) / 2));
  background: var(--white);
  box-shadow: 0 4px 0 rgba(53, 169, 220, 0.18);
}

.site-header h1 {
  font-size: 2.5rem;
  text-align: center;
}

.site-header .book-label {
  margin-bottom: 4px;
  text-align: center;
}

.nav-link {
  min-width: 130px;
  padding: 10px 16px;
  color: var(--indigo);
  border-color: rgba(59, 52, 127, 0.25);
  background: #f7f5ff;
}

.nav-link.strong {
  color: var(--white);
  border-color: var(--indigo);
  background: var(--indigo);
}

.contents-intro,
.watch-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 0;
}

.contents-intro {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 420px);
  align-items: stretch;
  gap: 22px;
}

.intro-copy {
  padding: 28px;
  border-left: 8px solid var(--sky);
  background: var(--white);
  box-shadow: var(--soft-shadow);
  border-radius: 8px;
}

.intro-copy h2,
.watch-details h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  line-height: 1.1;
  color: var(--clay);
}

.intro-copy p {
  max-width: 620px;
  margin: 14px 0 0;
  font-size: 1.08rem;
  line-height: 1.55;
}

.contents-preview {
  margin: 0;
  min-height: 230px;
  border: 8px solid var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--soft-shadow);
  background: var(--white);
}

.contents-preview img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: top center;
}

.chapter-section {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.chapter-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  border: 3px solid var(--accent);
  background: var(--white);
  box-shadow: var(--soft-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.chapter-card:hover,
.chapter-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(31, 28, 21, 0.14);
}

.chapter-topline,
.chapter-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chapter-number {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--accent);
  font-weight: 900;
  font-size: 1.25rem;
}

.chapter-pages {
  font-weight: 900;
  color: var(--accent);
}

.chapter-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1.16;
}

.chapter-card ul,
.topic-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-card li,
.topic-list li {
  position: relative;
  margin-top: 9px;
  padding-left: 22px;
  line-height: 1.38;
}

.chapter-card li::before,
.topic-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}

.watch-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--white);
  background: var(--accent);
  font-weight: 900;
}

.theme-a {
  --accent: var(--sky);
}

.theme-b {
  --accent: var(--clay);
}

.theme-c {
  --accent: var(--leaf);
}

.theme-special {
  --accent: var(--sun);
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: start;
}

.video-panel,
.watch-details {
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.video-panel {
  padding: 16px;
}

.chapter-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #111111;
}

.watch-details {
  padding: 22px;
  border-top: 8px solid var(--accent, var(--sky));
}

.theme-pill {
  width: max-content;
  margin: 0 0 15px;
  background: var(--accent, var(--sky));
}

.page-range {
  margin: 12px 0 18px;
  color: var(--accent, var(--sky));
  font-size: 1.1rem;
  font-weight: 900;
}

.watch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.secondary-action {
  min-width: 0;
  padding: 10px 12px;
  color: var(--indigo);
  border-color: rgba(59, 52, 127, 0.25);
  background: #f7f5ff;
}

@media (max-width: 860px) {
  .home-layout,
  .contents-intro,
  .watch-layout,
  .site-header {
    grid-template-columns: 1fr;
  }

  .home-layout {
    gap: 24px;
    padding: 20px 0 32px;
  }

  .cover-image {
    max-height: 58vh;
  }

  h1 {
    font-size: 2.55rem;
  }

  .site-header {
    justify-items: stretch;
    text-align: center;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .nav-link {
    width: 100%;
  }

  .contents-intro,
  .watch-layout {
    margin-top: 22px;
  }

  .intro-copy {
    padding: 22px;
  }

  .intro-copy h2,
  .watch-details h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 520px) {
  .home-layout,
  .contents-intro,
  .watch-layout,
  .chapter-section {
    width: min(100% - 20px, 1180px);
  }

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

  .chapter-card {
    min-height: 0;
  }

  .chapter-topline,
  .chapter-bottomline {
    align-items: flex-start;
    flex-direction: column;
  }

  .watch-actions {
    grid-template-columns: 1fr;
  }
}
