/* Lenses stylesheet - W1-look.  Palette only: #0F0F0F #272727
   #FFFFFF #AAAAAA #F1F1F1 #FFC53D, plus rgba() of black, white or the
   canvas colour for scrims, shades and surfaces. */
:root {
  --bg: #0F0F0F;
  --surface: #272727;
  --fg: #FFFFFF;
  --muted: #AAAAAA;
  --chip-bg: #F1F1F1;
  --accent: #FFC53D;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--fg); text-decoration: none; }
button { font-family: inherit; color: inherit; }
img { display: block; }

/* Header: fixed, transparent over the billboard */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: transparent;
}
.site-header.scrolled {
  background: rgba(15,15,15,.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.wordmark {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--fg);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px;
  border: 0; border-radius: 9999px;
  background: rgba(255,255,255,.1);
  color: var(--accent);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  min-width: 44px;
}
.pill-chevron { font-size: 12px; }

/* Billboard */
.billboard {
  position: relative;
  height: 62svh;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 16px 24px;
}
.billboard-bg {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  filter: blur(28px) brightness(.45);
  transform: scale(1.12);
}
.billboard-bg img { width: 100%; height: 100%; object-fit: cover; }
.billboard-shade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 60%;
  background: linear-gradient(to bottom,
    rgba(15,15,15,0) 0%,
    rgba(15,15,15,.13) 33%,
    rgba(15,15,15,.25) 50%,
    rgba(15,15,15,.40) 66%,
    rgba(15,15,15,.55) 79%,
    rgba(15,15,15,.68) 90%,
    rgba(15,15,15,1) 100%);
}
.billboard-a {
  position: relative; z-index: 1;
  margin: 0 0 8px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.billboard-b {
  position: relative; z-index: 1;
  margin: 0;
  font-size: clamp(32px, 7vw, 56px);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.02em;
  color: var(--fg);
}
.billboard-c {
  position: relative; z-index: 1;
  margin: 10px 0 0;
  font-size: 16px;
  color: rgba(255,255,255,.75);
}

/* Chip row: sticky under the header */
.chips {
  position: sticky; top: 56px; z-index: 40;
  display: flex; gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  background: var(--bg);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 32px; padding: 0 12px;
  border: 0; border-radius: 9999px;
  background: rgba(255,255,255,.1);
  color: var(--fg);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  min-width: 44px;
}
.chip.active { background: var(--chip-bg); color: var(--bg); }

/* Feed */
.feed {
  max-width: 1440px; margin: 0 auto;
  padding: 16px 16px 0;
  display: grid; gap: 16px; grid-template-columns: 1fr;
}
.card { min-width: 0; }
.thumb {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: 12px; overflow: hidden;
  background: var(--surface);
  cursor: pointer;
}
.video-card.short .thumb { aspect-ratio: 9 / 16; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; inset: 0; margin: auto;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,0,0,.55);
  pointer-events: none;
}
.play::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 0; height: 0; margin-left: 6px;
  border-top: 10px solid transparent; border-bottom: 10px solid transparent;
  border-left: 16px solid #FFFFFF;
}
.player {
  position: relative; padding-top: 56.25%;
  border-radius: 12px; overflow: hidden; background: var(--bg);
}
.video-card.short .player { padding-top: 177.78%; }
.player iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.open-link {
  display: block; padding: 10px 2px;
  color: var(--muted); font-size: 14px;
}
.card-body { padding: 10px 0 2px; }
.card-title {
  margin: 0 0 4px;
  font-size: 16px; font-weight: 500; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { margin: 0; color: var(--muted); font-size: 14px; }
.card-summary { margin: 4px 0; color: var(--muted); font-size: 14px; }

/* Vertical shelf (after the third card) */
.shelf {
  display: flex; gap: 8px;
  margin-right: -16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  grid-column: 1 / -1;
  padding-bottom: 4px;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf .video-card {
  flex: 0 0 auto;
  width: 40vw; max-width: 180px;
  scroll-snap-align: start;
}

/* Lens page subline */
.subline {
  margin: 0; padding: 8px 16px 0;
  color: var(--muted); font-size: 14px;
}

/* Error line (under the chips) */
.error-line {
  margin: 0; padding: 8px 16px;
  color: var(--muted); font-size: 14px;
}

/* Outlook fallback notice */
.fallback-notice {
  margin: 0; padding: 12px 16px;
  background: rgba(155, 123, 255, 0.15);
  color: var(--fg); font-size: 14px;
  border-left: 3px solid #9B7BFF;
}

/* Sentinel: the loader watches it to render the next 20 cards */
.sentinel { height: 1px; }

/* End of feed (muted) */
.feed-end {
  margin: 0; padding: 8px 16px 0;
  color: var(--muted); font-size: 14px;
  grid-column: 1 / -1;
}

/* Sheet */
.sheet {
  border: 0; padding: 0;
  margin: auto auto 0;
  width: 100%; max-width: 100%;
  max-height: 58svh;
  background: var(--surface);
  color: var(--fg);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}
.sheet::backdrop { background: rgba(0,0,0,.32); }
.sheet-handle {
  width: 32px; height: 4px; border-radius: 9999px;
  background: rgba(255,255,255,.3);
  margin: 12px auto 0;
}
.sheet-body {
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: calc(58svh - 20px);
}
.sheet-title {
  margin: 4px 0 16px;
  font-size: clamp(24px, 7vw, 28px);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.02em;
}
.sheet-label {
  margin: 0 0 8px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
  display: flex; align-items: center; justify-content: space-between;
}
.outlook-clear {
  font-size: 13px; text-transform: none; letter-spacing: 0;
  color: var(--accent); text-decoration: none;
}
.outlook-clear:hover { text-decoration: underline; }
.outlook-subgroup {
  margin: 0 0 12px;
}
.outlook-sublabel {
  margin: 0 0 6px;
  font-size: 13px; color: var(--muted);
}
.sheet-group { margin: 0 0 20px; }
.sheet-options { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-option {
  min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 9999px;
  background: rgba(255,255,255,.1);
  color: var(--fg);
  font-size: 16px;
  cursor: pointer;
}
.sheet-option.active { background: var(--accent); color: var(--bg); }

/* Country button in sheet */
.country-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 56px; padding: 0 16px;
  border: 0; border-radius: 9999px;
  background: rgba(255,255,255,.1);
  color: var(--fg);
  font-size: 16px;
  cursor: pointer;
  min-width: 44px;
}
.country-btn .flag-img {
  width: 24px; height: 18px;
  border-radius: 2px;
  flex-shrink: 0;
}
.country-code {
  font-weight: 500; color: var(--accent);
  font-size: 14px; text-transform: lowercase;
}
.country-name {
  flex: 1; text-align: left;
}
.country-chevron {
  font-size: 12px; color: var(--muted);
}

/* Done button (accent) and choice line */
.sheet-done {
  width: 100%; min-height: 49px;
  border: 0; border-radius: 10px;
  font-size: 17px; font-weight: 600;
  cursor: pointer;
}
.sheet-done.accent {
  background: var(--accent); color: var(--bg);
}
.choice-line {
  margin: 2px 0 12px;
  font-size: 14px; color: var(--muted);
  text-align: center;
}

/* Surprise me (violet outline) */
.surprise {
  width: 100%; min-height: 48px;
  border: 2px solid #9B7BFF; border-radius: 9999px;
  background: transparent; color: #9B7BFF;
  font-size: 16px; font-weight: 800;
  cursor: pointer;
}

/* Country picker (full-screen dialog) */
.picker {
  border: 0; padding: 0;
  margin: 0; width: 100%; max-width: 100%;
  height: 100%; max-height: 100%;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}
.picker::backdrop { background: rgba(0,0,0,.80); }
.picker-search {
  display: flex; align-items: center;
  height: 56px; padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.picker-search input {
  flex: 1; height: 40px; padding: 0 12px;
  border: 0; border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font-size: 17px; outline: none;
}
.picker-search input::placeholder { color: var(--muted); }
#picker-close {
  width: 36px; height: 36px; margin-left: 8px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.picker-list {
  overflow-y: auto;
  height: calc(100% - 56px);
  padding-bottom: env(safe-area-inset-bottom);
}
.picker-section {
  margin: 0; padding: 16px 16px 8px;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.picker-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 52px; padding: 0 16px;
  border: 0; background: transparent;
  color: var(--fg); font-size: 16px;
  cursor: pointer; text-align: left;
}
.picker-row .flag-img {
  width: 24px; height: 18px;
  border-radius: 2px;
  flex-shrink: 0;
}
.picker-name { flex: 1; }
.picker-code { color: var(--muted); font-size: 14px; }
.picker-empty {
  margin: 0; padding: 24px 16px;
  color: var(--muted); font-size: 16px;
  text-align: center;
}

/* Flag image in pill */
.pill .flag-img {
  width: 24px; height: 18px;
  border-radius: 2px;
  vertical-align: middle;
}

/* Flag image in billboard line B */
.billboard-b .flag-img {
  width: clamp(32px, 7vw, 56px);
  height: auto;
  vertical-align: middle;
  margin-right: 0.2em;
}

/* Footer */
.site-footer {
  max-width: 1440px; margin: 0 auto;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
  color: var(--muted); font-size: 13px;
}
.site-footer p { margin: 4px 0; }

/* Age-gender dialog (over sheet) */
.age-gender-dialog {
  border: 0; padding: 0;
  margin: auto;
  max-width: 360px;
  background: var(--surface);
  color: var(--fg);
  border-radius: 16px;
  overflow: hidden;
}
.age-gender-dialog::backdrop { background: rgba(0,0,0,0.80); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.ag-body {
  padding: 16px 16px 24px;
}
.ag-title {
  margin: 0 0 16px;
  font-size: 18px; font-weight: 600; line-height: 1.3;
}
.ag-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 48px; margin: 0 0 12px;
}
.ag-row .ag-option {
  min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 9999px;
  background: rgba(255,255,255,.1);
  color: var(--fg);
  font-size: 16px;
  cursor: pointer;
}
.ag-row .ag-option.active { background: var(--accent); color: var(--bg); }
.ag-done {
  width: 100%; min-height: 48px;
  border: 0; border-radius: 10px;
  background: #FFC53D; color: var(--bg);
  font-size: 17px; font-weight: 600;
  cursor: pointer;
}

/* Desktop */
@media (min-width: 901px) {
  .billboard { height: min(48vw, 520px); }
  .chips {
    flex-wrap: wrap;
    max-width: 1440px; margin: 0 auto; width: 100%;
  }
  .feed { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .feed > .card:first-child { grid-column: span 2; }
  .shelf { margin-right: 0; }
  .sheet {
    margin: 0;
    position: fixed; top: 64px; right: 16px;
    width: 380px; max-width: 380px; max-height: 70vh;
    border-radius: 16px;
  }
  .sheet-body { max-height: calc(70vh - 20px); }
}

/* Motion (only for people who want it) */
@media (prefers-reduced-motion: no-preference) {
  .pill, .chip, .sheet-option, .surprise, .sheet-done {
    transition: transform 100ms cubic-bezier(.2,0,0,1);
  }
  .pill:active, .chip:active, .sheet-option:active, .surprise:active {
    transform: scale(.97);
  }
  .site-header { transition: background 200ms cubic-bezier(.2,0,0,1); }
  .billboard-bg, .billboard-b { transition: opacity 300ms cubic-bezier(.2,0,0,1); }
  .billboard.switching .billboard-bg,
  .billboard.switching .billboard-b { opacity: 0; }
  .sheet { transition: transform 350ms cubic-bezier(.2,0,0,1); }
  .sheet:not([open]) { transform: translateY(100%); }
  .sheet[open] { transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 901px) {
  .sheet:not([open]) { transform: translateY(-100%); }
}
