/* My JeffsFlix: the JeffsFlix brand kit, unchanged (theleeorg/jeffsflix-branding). Void as the
   background, Ghost White for text, Slate for what is secondary, Signal and Deep Violet only as the
   accent; Helvetica, then Inter, Arial or the system's sans-serif. Phone first. */

:root {
  --violet: #7C5CFF;
  --deep: #5B2EE5;
  --void: #0E0B1E;
  --ink: #17123A;
  --ghost: #F4F2FF;
  --slate: #9A94B8;
  --surface: #161230;
  --line: rgba(154, 148, 184, 0.22);
  --up: #3DD68C;
  --down: #FF6B7A;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--ghost);
  font: 16px/1.45 Helvetica, "Helvetica Neue", Inter, Arial, system-ui, sans-serif;
  overflow-wrap: anywhere;
}

a { color: var(--violet); }
img { display: block; max-width: 100%; height: auto; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 8px;
  border-bottom: 1px solid var(--line);
}
.brand { flex: 0 0 auto; }
.brand img { width: 164px; }

/* The tabs sit at the foot of a phone's screen and in the header on a wide one. */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--void);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs[hidden] { display: none; }
.tabs a {
  padding: 14px 2px;
  text-align: center;
  text-decoration: none;
  color: var(--slate);
  font-size: 13px;
  white-space: nowrap;
  font-weight: 700;
}
.tabs a[aria-current="page"] { color: var(--ghost); box-shadow: inset 0 3px 0 var(--violet); }

.view {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px var(--gutter) calc(88px + env(safe-area-inset-bottom));
}

.heading { margin: 4px 0 16px; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--violet);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; }
h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 0 0 14px;
}

.welcome, .note { margin: 0 0 16px; color: var(--ghost); white-space: pre-line; }
.card .note { margin: 0; }
.quiet { margin: 0; color: var(--slate); }
.sub { color: var(--slate); font-size: 14px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0 10px 12px;
  border-left: 3px solid var(--deep);
  margin: 0 0 8px;
}
.list li:last-child { margin-bottom: 0; }
.list .main { font-weight: 700; }
.list .sub { min-width: 0; }
.list.asked { margin-top: 16px; }
.list.asked li { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.list.asked .main { font-weight: 400; min-width: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ghost);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--slate); flex: 0 0 auto; }
.up .dot { background: var(--up); }
.down .dot { background: var(--down); }

.state .big { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.state .dot { width: 14px; height: 14px; }
.state .sub { margin: 0; }

.pill {
  flex: 0 0 auto;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(154, 148, 184, 0.18);
  color: var(--ghost);
}
.pill.approved { background: rgba(124, 92, 255, 0.28); }
.pill.declined { color: var(--slate); }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
button[disabled] { opacity: 0.55; cursor: default; }
.primary { background: linear-gradient(90deg, var(--violet), var(--deep)); color: var(--ghost); }
.secondary { background: transparent; color: var(--ghost); border-color: var(--line); }
.wide { width: 100%; }
.view > .wide, .view > .button { margin-top: 6px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack button { align-self: flex-start; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--slate); }
input[type="email"], input[type="text"], textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--void);
  color: var(--ghost);
  font: inherit;
}
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.toggle { flex-direction: row; align-items: center; gap: 12px; color: var(--ghost); font-size: 16px; }
.toggle input { width: 22px; height: 22px; margin: 0; accent-color: var(--violet); flex: 0 0 auto; }

.said:empty { display: none; }
.problem { margin: 8px 0 0; color: var(--down); }
.ok { margin: 8px 0 0; color: var(--up); }

.signin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 360px;
  margin: 8vh auto 0;
}
.signin .stacked { width: 220px; }
.signin .said { width: 100%; }

@media (min-width: 834px) {
  .top { padding: 12px 24px; }
  .brand img { width: 196px; }
  .tabs {
    position: static;
    display: flex;
    gap: 4px;
    border: 0;
    padding: 0;
    background: none;
  }
  .tabs a { padding: 10px 14px; border-radius: 8px; font-size: 15px; }
  .tabs a[aria-current="page"] { box-shadow: none; background: var(--surface); }
  .view { padding: 32px 24px 48px; }
  h1 { font-size: 34px; }
}

/* Year: one big number, a few facts, twelve bars and two ranked lists. */
.hero { text-align: center; padding: 28px 16px; background: linear-gradient(160deg, var(--ink), var(--surface)); }
.hero-number { margin: 0; font-size: 72px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; }
.hero-unit { margin: 6px 0 12px; color: var(--violet); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 14px; }
.hero .sub { margin: 0; }
.stats { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0 0 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.stat p { margin: 0; }
.stat-label { color: var(--slate); font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.stat-value { margin-top: 4px; font-size: 24px; font-weight: 700; line-height: 1.2; }
.months { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 140px; }
.months li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.monthtrack { flex: 1 1 auto; width: 100%; display: flex; align-items: flex-end; }
.monthbar { display: block; width: 100%; height: calc(var(--h, 0) * 1%); background: linear-gradient(180deg, var(--violet), var(--deep)); border-radius: 4px 4px 0 0; }
.monthname { color: var(--slate); font-size: 12px; }
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranked li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 0 14px 34px; counter-increment: rank; }
.ranked li::before { content: counter(rank); position: absolute; left: 0; top: 10px; width: 24px; color: var(--violet); font-weight: 700; }
.ranked .main { font-weight: 700; }
.rankbar { position: absolute; left: 34px; bottom: 4px; height: 3px; width: calc((100% - 34px) * var(--w, 0) / 100); border-radius: 2px; background: var(--deep); }
.fine { margin: 0 0 14px; color: var(--slate); font-size: 14px; }
.years { display: flex; justify-content: space-between; gap: 12px; }
.years a { padding: 10px 4px; font-weight: 700; text-decoration: none; }

@media (min-width: 834px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .months { height: 180px; }
}

/* Signed out, the stacked lockup is the page's only mark. */
.signed-out .top { display: none; }

/* Requests (#17): Discover's shelves of posters, Search, one title, and their requests. Posters come
   from the API; a title without one keeps its plain block. */
.subnav { display: flex; gap: 6px; margin: 0 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.subnav a { flex: 1 1 0; min-width: 0; padding: 9px 4px; border-radius: 8px; text-align: center; text-decoration: none; color: var(--slate); font-weight: 700; font-size: 14px; }
.subnav a[aria-current="page"] { background: var(--ink); color: var(--ghost); box-shadow: inset 0 -2px 0 var(--violet); }
.kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip-link { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--slate); text-decoration: none; font-size: 14px; font-weight: 700; }
.chip-link[aria-pressed="true"] { color: var(--ghost); border-color: var(--violet); background: rgba(124, 92, 255, 0.16); }

.poster { position: relative; display: block; flex: 0 0 auto; width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: linear-gradient(160deg, var(--ink), var(--deep)); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster.small { width: 46px; border-radius: 6px; }
.poster.large { width: 132px; border-radius: 10px; }

.shelf-card { padding-right: 0; }
.shelf { list-style: none; margin: 0; padding: 0 16px 4px 0; display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.shelf li { scroll-snap-align: start; min-width: 0; }
.tile { display: flex; flex-direction: column; gap: 4px; color: var(--ghost); text-decoration: none; min-width: 0; }
.tile-title { font-weight: 700; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-sub { color: var(--slate); font-size: 13px; }
.tile .pill { align-self: flex-start; font-size: 12px; padding: 1px 8px; }

.searchbar { display: flex; gap: 8px; margin: 0 0 14px; }
.searchbar input { flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--void); color: var(--ghost); font: inherit; }
.searchbar input:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.searchbar button { flex: 0 0 auto; padding: 10px 16px; }

.results, .cast { list-style: none; margin: 0; padding: 0; }
.result, .req { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ghost); text-decoration: none; border-top: 1px solid var(--line); min-width: 0; }
.results li:first-child .result, .reqs .req:first-child { border-top: 0; padding-top: 0; }
.reqs .req:last-child { padding-bottom: 0; }
.req-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.req-main .main { font-weight: 700; }
.req-main .sub { min-width: 0; }
.result .pill, .req .pill { align-self: center; }
.prog { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: rgba(154, 148, 184, 0.22); overflow: hidden; }
.prog i { display: block; height: 100%; width: calc(var(--w, 0) * 1%); background: linear-gradient(90deg, var(--violet), var(--deep)); }
.pill.ready { background: rgba(61, 214, 140, 0.18); color: var(--up); }
.pill.wait { background: rgba(154, 148, 184, 0.18); color: var(--ghost); }
.more { display: inline-block; margin-top: 12px; font-weight: 700; text-decoration: none; }
.allowance { margin: 0 0 12px; }

.title-head { display: flex; gap: 16px; align-items: flex-start; margin: 4px 0 16px; }
.title-facts { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.title-facts h1 { font-size: 24px; }
.title-facts p { margin: 0; }
.ratings { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ratings li { padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ghost); }
.ask { margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.ask .sub { margin: 0; }
.cast li { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--line); }
.cast li:first-child { border-top: 0; padding-top: 0; }
.cast .main { font-weight: 700; }
.credit { margin-top: 4px; }

@media (max-width: 359px) {
  .poster.large { width: 104px; }
  .title-facts h1 { font-size: 21px; }
  .shelf { grid-auto-columns: 100px; }
}

@media (min-width: 834px) {
  .shelf { grid-auto-columns: 140px; }
  .poster.large { width: 200px; }
  .title-facts h1 { font-size: 34px; }
  .poster.small { width: 54px; }
}
