/* Home page: reels on the left, the books in the middle, live reviews on the right. */

.home {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 28px 28px 0;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) 330px;
  grid-template-areas: "reels main live";
  gap: 0 36px;
  align-items: start;
}

.home-main { grid-area: main; min-width: 0; }

/* ------------------------------------------------------------ side panels */

.reels, .live {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 124px);
  display: flex;
  flex-direction: column;
}
.reels { grid-area: reels; }
.live { grid-area: live; }

/* Torn-edged paper card. */
.paper-panel {
  background: var(--paper-light) var(--grain);
  padding: 22px 16px 14px;
  clip-path: polygon(0 1.2%, 6% 0, 14% 0.9%, 23% 0.2%, 33% 1%, 44% 0.1%, 55% 0.8%, 67% 0, 78% 0.9%, 89% 0.2%, 100% 1%,
    99.2% 12%, 100% 25%, 99.3% 38%, 100% 51%, 99.4% 64%, 100% 77%, 99.2% 89%, 100% 99%,
    90% 100%, 79% 99.2%, 67% 100%, 55% 99.3%, 43% 100%, 31% 99.2%, 19% 100%, 8% 99.3%, 0 100%,
    0.8% 88%, 0 76%, 0.7% 63%, 0 50%, 0.8% 37%, 0 24%, 0.7% 12%);
  filter: drop-shadow(0 6px 10px rgba(60, 40, 20, 0.08));
}

.panel-head { display: flex; gap: 12px; align-items: center; margin: 0 4px 16px; }
.panel-head h2 { font-size: 23px; margin: 0; }
.panel-head p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.3; }
.reels-badge {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex: none;
}
.reels-badge .icon { width: 15px; height: 15px; margin-left: 2px; }

.reel-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  min-height: 0;
}
.reel-list::-webkit-scrollbar { display: none; }

.reel {
  position: relative;
  display: block;
  flex: none;
  aspect-ratio: 0.8;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #2b2019;
  text-align: left;
  color: #fff;
  font: inherit;
}
/* The reels are bright; a warm wash ties their posters to the page and keeps titles readable. */
.reel img { width: 100%; height: 100%; object-fit: cover; object-position: center 70%; filter: sepia(0.35) saturate(0.85) brightness(0.8); transition: transform 0.4s; }
.reel:hover img { transform: scale(1.04); }
.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(38, 22, 12, 0.55) 0%, rgba(38, 22, 12, 0.35) 40%, rgba(30, 17, 10, 0.92) 100%);
}
.reel .len {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(20, 12, 8, 0.6);
  font-size: 12.5px;
  font-weight: 600;
}
.reel .reel-text { position: absolute; left: 14px; right: 12px; bottom: 12px; z-index: 1; }
.reel .reel-title { display: block; font: 500 20px/1.12 var(--serif); margin-bottom: 8px; }
.reel .reel-book { display: flex; align-items: center; gap: 7px; font-size: 13px; opacity: 0.92; }
.reel .reel-book .icon { width: 11px; height: 11px; }

.reel-more {
  align-self: center;
  margin-top: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.reel-more .icon { width: 20px; height: 20px; }
.reel-more:hover { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------ reel player */

.player {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(22, 15, 10, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}
.player-box { display: flex; gap: 22px; align-items: flex-end; max-height: 100%; }
.player video { height: min(86vh, 860px); aspect-ratio: 9 / 16; max-width: 100%; background: #000; border-radius: 10px; }
.player-info { color: #f2ebdf; width: 240px; padding-bottom: 8px; }
.player-info h3 { font-size: 26px; color: #fff; }
.player-info p { font-size: 15px; color: #d6cbbb; }
.player-info .btn { border-color: #f2ebdf; color: #f2ebdf; margin-top: 6px; }
.player-info .btn:hover { background: #f2ebdf; color: var(--ink); }
.player .nav, .player .close {
  background: none;
  border: 1px solid #7a6c5f;
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.player .nav:hover, .player .close:hover { background: rgba(255, 255, 255, 0.1); }
.player .nav[disabled] { opacity: 0.3; cursor: default; }
.player .nav .icon, .player .close .icon { width: 22px; height: 22px; }
.player .close { position: absolute; top: 14px; right: 14px; border: 0; z-index: 1; }

/* ------------------------------------------------------------ intro */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  align-items: center;
  padding: 8px 0 40px;
  border-bottom: 1px solid var(--rule);
}
.intro h1 { font-size: clamp(36px, 3.6vw, 52px); line-height: 1.05; margin-bottom: 18px; }
.intro h1 em { font-style: italic; color: var(--accent); }
.intro .lede { font-size: 18px; line-height: 1.55; color: var(--ink-soft); max-width: 40ch; margin-bottom: 24px; }
.intro .actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 28px; }
.intro .actions a.text-link { font-size: 15.5px; font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.facts { display: flex; gap: 0; border-top: 1px solid var(--rule); padding-top: 16px; }
.facts div { padding: 0 22px; border-left: 1px solid var(--rule); font-size: 14px; color: var(--ink-soft); line-height: 1.3; }
.facts div:first-child { padding-left: 0; border-left: 0; }
.facts strong { display: block; font: 500 26px/1.1 var(--serif); color: var(--ink); margin-bottom: 2px; }

/* A fanned stack of covers. Each one lifts on hover. */
.fan { position: relative; height: 360px; }
.fan a {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 34%;
  transform-origin: 50% 100%;
  transition: transform 0.3s ease;
}
/* The mockups are cut out, so the shadow follows the book's shape rather than a box. */
.fan a img { width: 100%; filter: drop-shadow(0 14px 14px rgba(40, 25, 15, 0.35)) drop-shadow(0 3px 4px rgba(40, 25, 15, 0.25)); }
.fan a.flat img { filter: none; box-shadow: 0 16px 28px -14px rgba(40, 25, 15, 0.6); }
.fan a:nth-child(1) { transform: translateX(-150%) rotate(-11deg); z-index: 1; }
.fan a:nth-child(2) { transform: translateX(-104%) rotate(-5deg); z-index: 2; }
.fan a:nth-child(3) { transform: translateX(-50%) translateY(-14px); z-index: 3; width: 38%; }
.fan a:nth-child(4) { transform: translateX(4%) rotate(5deg); z-index: 2; }
.fan a:nth-child(5) { transform: translateX(50%) rotate(11deg); z-index: 1; }
.fan a:hover { z-index: 5; }
.fan a:nth-child(1):hover { transform: translateX(-150%) rotate(-11deg) translateY(-16px); }
.fan a:nth-child(2):hover { transform: translateX(-104%) rotate(-5deg) translateY(-16px); }
.fan a:nth-child(3):hover { transform: translateX(-50%) translateY(-30px); }
.fan a:nth-child(4):hover { transform: translateX(4%) rotate(5deg) translateY(-16px); }
.fan a:nth-child(5):hover { transform: translateX(50%) rotate(11deg) translateY(-16px); }

/* ------------------------------------------------------------ series and books */

.series-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  scroll-margin-top: 90px;
}
.series-nav span { color: var(--ink-soft); }
.series-nav a { text-decoration: none; font-weight: 600; white-space: nowrap; }
.series-nav a small { font-weight: 400; color: var(--ink-soft); margin-left: 4px; }
.series-nav a:hover { color: var(--accent); }

.series { padding-top: 44px; scroll-margin-top: 90px; }
.series-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 24px; }
.series-head h2 { font-size: 30px; margin: 0; }
.series-head p { margin: 6px 0 0; color: var(--ink-soft); max-width: 58ch; font-size: 16px; }
.series-head .num { color: var(--ink-soft); font-size: 14.5px; white-space: nowrap; }

.home .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 24px; }
.home .card .card-title { font-size: 18px; }

.about-shop { order: 3; margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--rule); }
.about-shop h2 { font-size: 30px; }
.about-shop p { max-width: 68ch; color: var(--ink-soft); }

/* ------------------------------------------------------------ live reviews */

.live {
  background: rgba(248, 243, 234, 0.85);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 20px 0 0;
  overflow: hidden;
}
.live-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 20px; }
.live-head h2 { font-size: 25px; margin: 0; display: flex; align-items: center; gap: 10px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #b9ae9f; flex: none; }
.live-dot.on { background: #4c9a52; box-shadow: 0 0 0 0 rgba(76, 154, 82, 0.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(76, 154, 82, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 154, 82, 0); } }
.online { font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }
.live-sub { font-size: 14.5px; color: var(--ink-soft); margin: 6px 20px 0; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }

.feed { list-style: none; margin: 0; padding: 14px 16px 6px; overflow-y: auto; flex: 1; min-height: 140px; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.feed > li { margin-bottom: 16px; }
.feed > li.new { animation: slide-in 0.6s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-10px); } }
.feed-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.feed-meta strong { font-size: 15px; color: var(--ink); }
.badge { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 10px; background: #e3ecd9; color: #36592d; font-size: 12px; font-weight: 600; line-height: 20px; }
.badge .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.badge.free { background: #f1e6c8; color: #6f5413; }
.badge.book { background: #f0dcd5; color: var(--accent); }
.bubble { background: var(--paper-deep); border-radius: 4px 12px 12px 12px; padding: 10px 12px; font-size: 15px; line-height: 1.45; }
.bubble p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.bubble .about { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.bubble .about a { text-decoration: none; font-weight: 600; color: var(--ink); }
.bubble .about a:hover { color: var(--accent); }
.bubble .about .stars { font-size: 12px; }
.excerpt .bubble { background: #f6efe2; border: 1px dashed var(--rule); }
.excerpt .bubble p { font: italic 400 16px/1.45 var(--serif); color: #3d322a; }
.like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 2px 10px 2px 8px;
  border: 0;
  border-radius: 12px;
  background: var(--paper-deep);
  color: var(--ink);
  font: 600 13px var(--sans);
  cursor: pointer;
}
.like .icon { width: 15px; height: 15px; color: var(--accent); }
.like.liked .icon { fill: var(--accent); }
.like:hover { background: var(--rule); }

.composer { border-top: 1px solid var(--rule); padding: 12px 14px 14px; background: var(--card); }
.composer form.composer-bar { display: flex; gap: 8px; }
.composer-bar input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  font: 15px var(--sans);
  color: var(--ink);
}
.composer-bar input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.send:hover { background: var(--accent-dark); }
.send .icon { width: 19px; height: 19px; }
.composer form { display: grid; gap: 10px; }
.composer .tabs { display: flex; gap: 4px; background: var(--paper-deep); border-radius: 8px; padding: 3px; }
.composer .tabs button { flex: 1; border: 0; background: none; border-radius: 6px; padding: 6px; font: 600 13.5px var(--sans); color: var(--ink-soft); cursor: pointer; }
.composer .tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.composer input, .composer select, .composer textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  font: 16px var(--sans); /* 16px stops phones zooming in on focus */
  color: var(--ink);
}
.composer textarea { min-height: 84px; resize: vertical; }
.composer .note { font-size: 13px; color: var(--ink-soft); margin: 0; }
.composer .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.composer .row .btn { height: 40px; padding: 0 18px; }
.composer .star-input label { font-size: 26px; }
.composer .form-error { margin: 0; font-size: 14px; }

/* ------------------------------------------------------------ smaller screens */

@media (max-width: 1320px) {
  .home { grid-template-columns: 200px minmax(0, 1fr) 300px; gap: 0 26px; }
  .home .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro { grid-template-columns: 1fr; }
  .fan { height: 320px; max-width: 520px; width: 100%; margin: 0 auto; }
}

/* Tablets and phones: one column. The reels become a swipeable strip under the
   intro, and reviews follow the books. */
@media (max-width: 1100px) {
  .home { display: flex; flex-direction: column; align-items: stretch; padding: 20px 20px 0; }
  .home > *, .home-main > * { min-width: 0; }
  .home-main { display: contents; }
  .intro { order: 1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .reels { order: 2; }
  .series-nav, .series { order: 3; }
  .live { order: 4; }

  .reels, .live { position: static; max-height: none; }
  .reels { margin: 28px 0 0; padding: 18px 16px 16px; }
  .reel-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding-bottom: 2px; }
  .reel { width: 168px; scroll-snap-align: start; }
  .reel-more { display: none; }
  .live { max-height: 640px; margin-top: 44px; }
  .fan { height: 300px; }
}

@media (max-width: 760px) {
  .home { padding: 16px 16px 0; }
  .intro { grid-template-columns: 1fr; gap: 8px; padding-bottom: 32px; }
  .fan { height: 200px; max-width: 300px; margin-top: 8px; }
  .home .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .home .card .card-title { font-size: 16.5px; margin-top: 10px; }
  .home .card .sub { font-size: 14px; }
  .series { padding-top: 34px; }
  .series-head { flex-direction: column; gap: 2px; margin-bottom: 18px; }
  .series-head h2 { font-size: 26px; }
  /* Series links scroll sideways as chips instead of wrapping into a block. */
  .series-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; padding: 14px 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .series-nav::-webkit-scrollbar { display: none; }
  .series-nav span { display: none; }
  .series-nav a { border: 1px solid var(--rule); border-radius: 18px; padding: 7px 14px; background: var(--paper-light); }
  .live { margin: 40px 0 0; max-height: 560px; }

  .player { padding: 0; gap: 0; background: #000; }
  .player-box { flex-direction: column; align-items: center; gap: 10px; width: 100%; }
  .player video { height: auto; width: 100%; max-height: 78vh; border-radius: 0; }
  .player-info { width: auto; text-align: center; padding: 0 16px; }
  .player-info h3 { font-size: 21px; margin-bottom: 4px; }
  .player-info p { display: none; }
  .player .nav { position: absolute; bottom: 18px; width: 44px; height: 44px; }
  .player .prev { left: 16px; }
  .player .next { right: 16px; }
}

@media (max-width: 420px) {
  .intro h1 { font-size: 34px; }
  .intro .lede { font-size: 16.5px; }
  .intro .actions .btn { flex: 1; }
  .facts div { padding: 0 12px; }
  .facts strong { font-size: 21px; }
  .reel { width: 148px; }
  .reel .reel-title { font-size: 18px; }
}
