/* Apple TV-style directory and the dark hero on an idea page.
   The article under the hero stays in desk.css. */

body.tv {
  background: #07070b;
  color: #f4f4f8;
  color-scheme: dark;
  overflow-x: clip;
}
body.tv.ad {
  background: #07070b;
  color: #f4f4f8;
}
body.tv.ad a { color: inherit; }
body.tv.ad a:hover { color: #fff; }
body.tv ::selection { background: #f4f4f8; color: #07070b; }
body.tv :focus-visible {
  outline: 2px solid #f4f4f8;
  outline-offset: 3px;
}

.tv-loading, .tv-error {
  padding: 28vh 6vw 0;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* —— top bar over the still —— */
.tv-bar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 4vw 18px;
  background: linear-gradient(180deg, rgba(7, 7, 11, 0.72), rgba(7, 7, 11, 0));
}
.tv-bar .wordmark {
  color: #f4f4f8 !important;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}
.tv-links { display: flex; gap: 18px; align-items: center; }
.tv-links a {
  color: rgba(244, 244, 248, 0.82);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}
.tv-links a[aria-current="page"] { color: #fff; }
.tv-search {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
}
.tv-search svg {
  position: absolute;
  left: 14px;
  color: rgba(244, 244, 248, 0.7);
  pointer-events: none;
}
.tv-search input {
  appearance: none;
  width: min(280px, 42vw);
  font: 500 0.95rem/1.2 Figtree, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: #f4f4f8;
  background: rgba(244, 244, 248, 0.1);
  border: 1px solid rgba(244, 244, 248, 0.22);
  border-radius: 999px;
  padding: 10px 16px 10px 40px;
  caret-color: #f4f4f8;
}
.tv-search input::placeholder { color: rgba(244, 244, 248, 0.62); }

/* —— hero —— */
.tv-hero {
  position: relative;
  height: calc(100svh - 92px);
  min-height: calc(100svh - 92px);
  max-height: none;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  overflow: hidden;
}
.tv-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transform-origin: 60% 40%;
  animation: tv-settle 20s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes tv-settle {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
.tv-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(100deg, rgba(7, 7, 11, 0.97) 0%, rgba(7, 7, 11, 0.94) 22%, rgba(7, 7, 11, 0.72) 42%, rgba(7, 7, 11, 0.22) 68%, rgba(7, 7, 11, 0.08) 100%),
    linear-gradient(180deg, rgba(7, 7, 11, 0.42) 0%, rgba(7, 7, 11, 0.06) 26%, rgba(7, 7, 11, 0.5) 72%, #07070b 100%);
}
.tv-hero-copy {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  padding: 0 4vw 6vh;
  display: grid;
  gap: 14px;
}
.tv-stage { position: relative; }
.tv-stage.no-hero .tv-bar {
  position: relative;
  background: #07070b;
}
.tv-stage.no-hero .tv-shelves { padding-top: 12px; }
.tv-hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5.4vw, 5.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
  color: #fff;
}
.tv-pitch {
  margin: 0;
  max-width: 58ch;
  font-size: 1.125rem;
  line-height: 1.5;
  color: #f4f4f8;
}
.tv-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  color: #f4f4f8;
  font-size: 1rem;
}
.tv-score { font-variant-numeric: tabular-nums; font-weight: 600; }
.tv-score span { font-weight: 500; color: #f4f4f8; }
.tv-prov {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid rgba(244, 244, 248, 0.35);
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(244, 244, 248, 0.86);
}
.tv-cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #f4f4f8;
  color: #121218 !important;
  text-decoration: none !important;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tv-cta:hover { background: #fff; color: #000 !important; }
.best-fit {
  margin: 0;
  max-width: 46ch;
  color: #f4f4f8;
  font-size: 1.05rem;
  line-height: 1.45;
}
.best-fit-k { font-weight: 600; }
.poster .best-fit { font-size: 0.95rem; }
.fit-paper { color: var(--ink); }
.sheet .best-fit { margin-bottom: 18px; }
.rail .best-fit { font-size: 15px; line-height: 1.45; margin: 10px 0 0; }

/* —— shelves —— */
.tv-shelves { display: grid; gap: 8px; padding: 8px 0 28px; max-width: 100%; }
.shelf { max-width: 100%; min-width: 0; overflow: clip; }
.shelf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4vw 0;
}
.shelf-head { width: 100%; max-width: 100%; min-width: 0; }
.shelf-head > div { min-width: 0; flex: 1 1 0; }
.shelf-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.shelf-note {
  margin: 6px 0 0;
  max-width: min(62ch, 100%);
  color: rgba(244, 244, 248, 0.72);
  font-size: 0.92rem;
  overflow-wrap: break-word;
}
.shelf-head > .shelf-btns { display: flex; gap: 8px; flex: none; margin-left: auto; position: relative; z-index: 1; }
.shelf-btns button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(244, 244, 248, 0.72);
  background: #1c1c24;
  color: #f4f4f8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.shelf-btns button:disabled { opacity: 0.4; cursor: default; }
.shelf-btns button:hover:not(:disabled) { background: #2a2a34; }

.shelf-scroller {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: auto;
  scroll-padding-inline: 4vw;
  padding: 22px 4vw 36px;
  scrollbar-color: rgba(244, 244, 248, 0.35) transparent;
}
.shelf-scroller::-webkit-scrollbar { height: 8px; }
.shelf-scroller::-webkit-scrollbar-thumb {
  background: rgba(244, 244, 248, 0.32);
  border-radius: 99px;
}

.poster {
  flex: 0 0 clamp(260px, 28vw, 380px);
  scroll-snap-align: start;
  text-decoration: none !important;
  color: inherit !important;
  display: grid;
  gap: 10px;
  transform-origin: center center;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.poster:hover,
.poster:focus-visible {
  transform: translateY(-8px) scale(1.045);
  z-index: 2;
  outline-offset: 6px;
}
.poster-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #16161c;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.poster:hover .poster-frame,
.poster:focus-visible .poster-frame {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55);
}
.poster-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.poster-empty { background: #16161c; }
.poster-copy { display: grid; gap: 6px; padding: 0 2px; }
.poster-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #f4f4f8;
  text-wrap: balance;
}
.poster-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #f4f4f8;
  font-size: 0.92rem;
}

.tv-empty {
  padding: 12px 4vw 48px;
  display: grid;
  gap: 12px;
  justify-items: start;
}
.tv-empty p { margin: 0; font-size: 1.2rem; font-weight: 600; }
.tv-empty button, .linkish {
  background: none;
  border: 0;
  color: #f4f4f8;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.tv-foot {
  padding: 12px 4vw 48px;
  display: grid;
  gap: 8px;
  color: rgba(244, 244, 248, 0.72);
  font-size: 0.92rem;
  border-top: 1px solid rgba(244, 244, 248, 0.12);
  margin: 0 4vw;
}
.tv-foot a { color: #f4f4f8; }

/* —— idea page cinematic header —— */
.cine {
  position: relative;
  isolation: isolate;
  min-height: 520px;
  height: 64vh;
  max-height: 720px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #f4f4f8;
  overflow: hidden;
  background: #07070b;
}
.cine-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transform-origin: center 30%;
  animation: tv-settle 20s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.cine-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(100deg, rgba(7, 7, 11, 0.97) 0%, rgba(7, 7, 11, 0.9) 28%, rgba(7, 7, 11, 0.48) 58%, rgba(7, 7, 11, 0.12) 100%),
    linear-gradient(180deg, rgba(7, 7, 11, 0.5) 0%, rgba(7, 7, 11, 0.08) 24%, rgba(7, 7, 11, 0.55) 68%, #07070b 100%);
}
.cine-top, .cine-copy { position: relative; z-index: 2; }
.cine-top { padding-top: 22px; }
.cine .wordmark { color: #f4f4f8 !important; }
.cine .mast-nav a { color: rgba(244, 244, 248, 0.86); text-decoration: none; }
.cine .icon-btn { color: #f4f4f8; border-color: rgba(244, 244, 248, 0.28); }
.cine-copy { padding-bottom: 72px; max-width: 920px; display: grid; gap: 12px; }
.cine-crumbs, .cine-crumbs a { color: rgba(244, 244, 248, 0.78); }
.cine-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}
.cine-offer {
  margin: 0;
  max-width: 62ch;
  color: rgba(244, 244, 248, 0.9);
  font-size: 1.05rem;
}
.cine-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
.cine .badge { background: rgba(247, 247, 250, 0.92); color: #1b1547; }

.sheet {
  position: relative;
  z-index: 1;
  margin-top: -28px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -24px 48px rgba(0, 0, 0, 0.28);
  padding-top: 8px;
}
.sheet .layout { padding-top: 12px; }
.sheet { font-size: 18.5px; line-height: 1.7; }
.sheet .prose p,
.sheet .dek,
.sheet .omit,
.sheet .why,
.sheet .tk-d,
.sheet .claim-meta,
.sheet .src-line,
.sheet .tool .dek {
  font-size: 18.5px;
  line-height: 1.7;
}
.sheet .claim q { font-size: 26px; line-height: 1.4; }
.sheet .h3 { font-size: 20px; line-height: 1.35; }

@media (max-width: 800px) {
  .tv-bar { flex-wrap: wrap; gap: 12px; padding-top: 16px; }
  .tv-search { margin-left: 0; flex: 1 1 100%; }
  .tv-search input { width: 100%; }
  .tv-hero { height: calc(100svh - 106px); min-height: calc(100svh - 106px); max-height: none; }
  .tv-hero-shade, .cine-shade {
    background: linear-gradient(180deg, rgba(7, 7, 11, 0.82) 0%, rgba(7, 7, 11, 0.5) 16%, rgba(7, 7, 11, 0.88) 52%, rgba(7, 7, 11, 0.97) 78%, #07070b 100%);
  }
  .tv-hero-copy { padding-bottom: 4vh; }
  .tv-pitch, .cine-offer { font-size: 1.0625rem; line-height: 1.55; color: #f7f7fa; }
  .poster { flex-basis: 82vw; }
  .browse .tv-bar { padding-top: 10px; padding-bottom: 8px; }
  .browse-head { flex-wrap: wrap; align-items: stretch; padding-top: 8px; }
  .browse-head h1 { font-size: 1.85rem; }
  .browse-count { margin-top: 4px; }
  .browse-sort { width: 100%; }
  .browse-sort select { width: 100%; }
  .browse-filters { gap: 10px; padding-top: 8px; }
  .browse-filters fieldset { gap: 4px; }
  .browse .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 2px;
  }
  .browse .chip-row .chip { flex: none; scroll-snap-align: start; }
  .browse-grid { padding-top: 8px; }
  .shelf-head { align-items: flex-start; }
  .cine { height: auto; min-height: 0; max-height: none; padding-bottom: 8px; }
  .cine-copy { padding-bottom: 48px; }
  .cine-title { font-size: clamp(2.1rem, 10vw, 3.2rem); }
}
.poster-hit {
  display: grid;
  gap: 10px;
  color: inherit !important;
  text-decoration: none !important;
}
.poster-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.poster-dollar { color: rgba(244, 244, 248, 0.86); font-size: 0.88rem; }
.chip {
  appearance: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  color: #f4f4f8;
  background: transparent;
  border: 1px solid rgba(244, 244, 248, 0.5);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.poster-tags .chip { min-height: 36px; padding: 4px 10px; font-size: 0.82rem; }
.chip:hover, a.chip:hover { border-color: #f4f4f8; color: #fff !important; }
.chip[aria-pressed="true"] {
  background: #f4f4f8;
  color: #121218;
  border-color: #f4f4f8;
}
.chip[aria-pressed="true"]:hover { color: #121218 !important; }
.chip-kind { font-size: 0.72rem; font-weight: 600; margin-left: 6px; }
.browse-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 4vw 6px;
}
.browse-head h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.browse-count { margin: 8px 0 0; color: #f4f4f8; font-size: 1.05rem; }
.browse-sort { display: grid; gap: 6px; font-size: 0.82rem; font-weight: 600; color: rgba(244, 244, 248, 0.86); }
.browse-sort select {
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #f4f4f8;
  background: #1c1c24;
  border: 1px solid rgba(244, 244, 248, 0.5);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
}
.browse-filters { display: grid; gap: 16px; padding: 18px 4vw 0; }
.browse-filters fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.browse-filters legend { font-size: 1rem; font-weight: 600; color: #f4f4f8; padding: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.browse-note {
  margin: 14px 4vw 0;
  max-width: 68ch;
  color: rgba(244, 244, 248, 0.86);
  font-size: 0.95rem;
  line-height: 1.5;
}
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 28px 18px;
  padding: 22px 4vw 48px;
}
.browse-grid .poster { width: auto; flex: none; }
.browse-jump { margin: 0 4vw 28px; font-size: 1.05rem; }
.browse-jump a { color: #f4f4f8; }
.cine a.tag {
  color: #f4f4f8;
  background: rgba(7, 7, 11, 0.55);
  border-color: rgba(244, 244, 248, 0.45);
  text-decoration: none;
}
.cine a.tag:hover { border-color: #fff; color: #fff; }
.cine .tag-kind { font-size: 0.72rem; font-weight: 600; margin-left: 4px; }

@media (prefers-reduced-motion: reduce) {
  .tv-hero-bg, .cine-bg { animation: none; }
  .poster { transition: none; }
  .shelf-scroller { scroll-behavior: auto; }
}
