:root {
  --bg: #090a0c;
  --ink: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.66);
  --quiet: rgba(244, 241, 234, 0.4);
  --line: rgba(255, 255, 255, 0.08);
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, "Liberation Serif", serif;
  --radius: 22px;
  --chrome: 72px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scrollbar-gutter: stable;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.35;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(90% 55% at 8% -8%, rgba(255, 236, 214, 0.055), transparent 48%),
    radial-gradient(70% 45% at 108% 4%, rgba(170, 196, 230, 0.045), transparent 46%),
    radial-gradient(60% 40% at 70% 110%, rgba(120, 110, 160, 0.04), transparent 50%);
}

::selection { background: rgba(255, 255, 255, 0.16); }

button, a { -webkit-tap-highlight-color: transparent; }

:focus { outline: none; }

:focus-visible {
  outline: 2px solid #f4f1ea;
  outline-offset: 3px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: 8px;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 999px;
  z-index: 50;
  text-decoration: none;
  font-size: 14px;
}

.skip:focus { transform: none; }

#app { position: relative; z-index: 1; }

.chrome {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding:
    max(14px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    28px
    max(16px, env(safe-area-inset-left));
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(9, 10, 12, 0.88), rgba(9, 10, 12, 0));
}

.chrome .icon-btn { pointer-events: auto; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 19, 22, 0.72);
  color: rgba(244, 241, 234, 0.92);
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 20px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.icon-btn svg { width: 16px; height: 16px; display: block; }

.icon-btn:active { transform: scale(0.92); }

.screen {
  width: min(1360px, calc(100% - 20px));
  margin: 0 auto;
  padding: 78px 0 calc(64px + env(safe-area-inset-bottom));
}

.stack { margin: 0 0 26px; }

.stack-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 6px 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: rgba(244, 241, 234, 0.86);
}

.stack-name .count {
  font-weight: 500;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--quiet);
}

.tray {
  box-sizing: border-box;
  padding: 4px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.grid {
  display: grid;
  width: 100%;
}

.tile {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.tile.is-quiet { cursor: default; }

.widget {
  --deep: #15161a;
  --mid: #2a2d33;
  --ink: #f3f0ea;
  --accent: #d9d3c7;
  --glow: rgba(220, 210, 190, 0.22);
  --glow2: rgba(60, 60, 70, 0.45);
  --bx: 16%;
  --by: 0%;
  --bx2: 100%;
  --by2: 88%;
  --sheen: 168deg;
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: var(--deep);
  color: var(--ink);
  container-type: size;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 10px 22px rgba(0, 0, 0, 0.24);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: translateZ(0);
}

.widget[data-cat="Movies"] {
  --deep: #1b130e;
  --mid: #3d2b1c;
  --ink: #f7f1e8;
  --accent: #f0b27a;
  --glow: rgba(240, 170, 100, 0.55);
  --glow2: rgba(120, 68, 36, 0.5);
}

.widget[data-cat="Books"] {
  --deep: #131610;
  --mid: #2a3122;
  --ink: #f4f1e6;
  --accent: #d7c7a2;
  --glow: rgba(206, 190, 140, 0.4);
  --glow2: rgba(64, 78, 52, 0.55);
}

.widget[data-cat="Videos"] {
  --deep: #0e1520;
  --mid: #1a334c;
  --ink: #eef5fb;
  --accent: #8ec8f5;
  --glow: rgba(120, 190, 240, 0.48);
  --glow2: rgba(36, 78, 120, 0.55);
}

.widget[data-cat="Podcasts"] {
  --deep: #15131c;
  --mid: #312a46;
  --ink: #f5f2fb;
  --accent: #cbb8f4;
  --glow: rgba(180, 154, 236, 0.46);
  --glow2: rgba(72, 56, 112, 0.55);
}

.widget[data-cat="channels-people"] {
  --deep: #101614;
  --mid: #1c3530;
  --ink: #f2f7f4;
  --accent: #9ed9c4;
  --glow: rgba(130, 214, 184, 0.4);
  --glow2: rgba(32, 78, 68, 0.55);
}

.widget[data-cat="TV"] {
  --deep: #141518;
  --mid: #23252b;
  --ink: #c8c6c0;
  --accent: #9aa0a8;
  --glow: rgba(180, 184, 190, 0.12);
  --glow2: rgba(40, 42, 48, 0.4);
}

.widget.v0 { --bx: 8%; --by: -6%; --bx2: 110%; --by2: 90%; --sheen: 155deg; }
.widget.v1 { --bx: 100%; --by: 0%; --bx2: -10%; --by2: 100%; --sheen: 210deg; }
.widget.v2 { --bx: 50%; --by: -20%; --bx2: 80%; --by2: 120%; --sheen: 180deg; }
.widget.v3 { --bx: 0%; --by: 40%; --bx2: 100%; --by2: 0%; --sheen: 125deg; }
.widget.v4 { --bx: 80%; --by: 80%; --bx2: 0%; --by2: -10%; --sheen: 240deg; }
.widget.v5 { --bx: 20%; --by: 100%; --bx2: 90%; --by2: -20%; --sheen: 20deg; }
.widget.v6 { --bx: 110%; --by: 30%; --bx2: 10%; --by2: 110%; --sheen: 200deg; }
.widget.v7 { --bx: 40%; --by: -10%; --bx2: 0%; --by2: 80%; --sheen: 145deg; }

.material,
.motif,
.gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.material {
  background:
    radial-gradient(90% 78% at var(--bx) var(--by), var(--glow), transparent 62%),
    radial-gradient(70% 64% at var(--bx2) var(--by2), var(--glow2), transparent 68%),
    linear-gradient(var(--sheen), var(--mid), var(--deep) 72%);
}

.motif {
  color: var(--accent);
  opacity: 0.5;
  bottom: auto;
  height: 52%;
}

.widget[data-cat="Books"] .motif { opacity: 0.26; }
.widget[data-cat="Movies"] .motif { opacity: 0.42; }
.widget[data-cat="TV"] .motif { opacity: 0.2; }

.gloss {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 36%);
  opacity: 0.85;
}

.face {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px;
  pointer-events: none;
}

.face::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.38), transparent);
  z-index: -1;
}

.kicker {
  max-width: calc(100% - 54px);
  min-height: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--accent);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.title {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.creator {
  margin-top: 4px;
  max-width: 100%;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.take {
  margin-top: 8px;
  max-width: 100%;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.28;
  letter-spacing: -0.014em;
  color: rgba(247, 243, 236, 0.88);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.rate {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}

.ring { width: 22px; height: 22px; display: block; }

.rate-num {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.widget[data-size="s"] .face { padding: 8px; }
.widget[data-size="s"] .kicker { font-size: 10px; max-width: calc(100% - 26px); }
.widget[data-size="s"] .title {
  margin-top: auto;
  font-size: 12.5px;
  line-height: 1.08;
  -webkit-line-clamp: 3;
}
.widget[data-size="s"] .rate { top: 7px; right: 7px; }
.widget[data-size="s"] .ring { width: 16px; height: 16px; }
.widget[data-size="s"] .rate-num,
.widget[data-size="s"] .creator,
.widget[data-size="s"] .take { display: none; }

.widget[data-size="m"] .title {
  margin-top: auto;
  padding-top: 8px;
  font-size: 18px;
  -webkit-line-clamp: 2;
}
.widget[data-size="m"] .take { -webkit-line-clamp: 2; font-size: 13px; }
.widget[data-size="m"] .creator { display: none; }

.widget[data-size="l"] .face { padding: 14px; }
.widget[data-size="l"] .title {
  margin-top: auto;
  padding-top: 10px;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 0.98;
  -webkit-line-clamp: 3;
}
.widget[data-size="l"] .creator { display: block; font-size: 14px; }
.widget[data-size="l"] .take { font-size: 15px; -webkit-line-clamp: 3; }
.widget[data-size="l"] .ring { width: 24px; height: 24px; }

@container (max-height: 128px) {
  .take, .creator { display: none; }
}

@container (max-width: 210px) {
  .widget[data-size="l"] .title { font-size: 22px; }
}

.tile.is-pressed .widget { transform: scale(0.96); }

.tile.is-quiet .widget {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.tile.is-quiet .title {
  color: rgba(244, 241, 234, 0.46);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

@media (hover: hover) and (pointer: fine) {
  .tile:not(.is-quiet):hover .gloss { opacity: 1; }
  .tile:not(.is-quiet):hover .widget {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.26),
      inset 0 0 0 1px rgba(255, 255, 255, 0.1),
      0 16px 32px rgba(0, 0, 0, 0.32);
  }
}

.notice,
.loading,
.problem {
  margin: 12px 4px;
  color: var(--muted);
  font-size: 15px;
}

.retry {
  margin-top: 12px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.retry:hover,
.retry:focus-visible { border-color: rgba(255, 255, 255, 0.4); }

html.is-locked,
html.is-locked body { overflow: hidden; }

#stage {
  position: fixed;
  inset: 0;
  z-index: 40;
}

#stage[hidden] { display: none; }

.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 8, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
}

.detail {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0c0d11;
  color: var(--ink);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform-origin: 0 0;
  will-change: transform;
}

.detail-field {
  position: relative;
  flex: 1 0 200px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px 22px 20px;
  overflow: hidden;
}

.detail-field::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent);
  z-index: 1;
  pointer-events: none;
}

.detail .close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  background: rgba(8, 9, 12, 0.42);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.grabber {
  display: none;
  position: absolute;
  top: 8px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.4);
  z-index: 5;
}

.mini {
  position: absolute;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}

.mini.is-cover { inset: 0; }

.mini.is-icon {
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.mini .widget { box-shadow: none; width: 100%; height: 100%; }

.mini.is-icon .icon-btn { width: 40px; height: 40px; box-shadow: none; }

.detail:focus,
.detail:focus-visible { outline: none; }

.hero { position: relative; z-index: 2; }

.hero-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--accent);
}

.hero-title {
  margin: 8px 0 0;
  max-width: 16ch;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.048em;
  line-height: 0.94;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero-title.is-long {
  max-width: 18ch;
  font-size: clamp(28px, 4vw, 42px);
}

.hero-title.is-longer {
  max-width: 22ch;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1;
}

.hero-creator {
  margin: 10px 0 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

.hero-rate {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--accent);
}

.hero-rate .rate {
  position: static;
}

.hero-rate .ring { width: 28px; height: 28px; }

.score {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.detail-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 26px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.38));
  user-select: text;
}

.detail-body .take {
  display: block;
  margin: 0;
  padding: 0;
  -webkit-line-clamp: unset;
  overflow: visible;
  font-size: 1.35rem;
  line-height: 1.35;
  color: #f6f2ea;
}

.review {
  margin: 16px 0 0;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(246, 242, 234, 0.92);
  white-space: pre-wrap;
}

.detail-body .take + .review { margin-top: 18px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.011em;
  text-decoration: none;
}

.text-link svg { width: 14px; height: 14px; display: block; }

.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.detail.is-info {
  --deep: #16181e;
  --mid: #262b36;
  --ink: #f4f1ea;
  --accent: #e4dccf;
  --glow: rgba(228, 220, 207, 0.18);
  --glow2: rgba(70, 80, 100, 0.4);
  --bx: 0%;
  --by: 0%;
  --bx2: 100%;
  --by2: 100%;
  --sheen: 180deg;
}

.detail.is-info .detail-field {
  flex: 0 0 auto;
  min-height: 0;
  padding: 58px 22px 18px;
}

.detail.is-info .hero-title {
  font-size: clamp(32px, 4vw, 40px);
  max-width: none;
}

.info-block { margin: 0 0 16px; }

.info-block h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(244, 241, 234, 0.48);
}

.info-block p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(244, 241, 234, 0.92);
}

.info-block:last-child { margin-bottom: 0; }

.miss-tray {
  width: min(420px, 100%);
  padding: 18px 18px 16px;
}

.miss-copy {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--muted);
}

html[data-vp="phone"] .grabber { display: block; }

html[data-vp="phone"] .detail-field { padding-top: 28px; }

@media (min-width: 900px) {
  :root { --radius: 26px; }

  .screen {
    width: min(1360px, calc(100% - 72px));
    padding-top: 96px;
  }

  .tray { border-radius: 30px; }

  .stack { margin-bottom: 32px; }

  .widget[data-size="m"] .title { font-size: 22px; }
  .widget[data-size="l"] .title { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .tile.is-pressed .widget,
  .icon-btn:active { transform: none; }
}
