/* Pickflick. Visual language borrowed from deepstash.com: warm paper, ink,
   Lexend at 900 with tight tracking, pastel tiles, chunky 3D buttons. */

:root {
  color-scheme: light;
  --paper: #FAFAF9;
  --white: #FFFFFF;
  --ink: #1A1A1A;
  --ink-2: #474744;
  --ink-3: #686864;
  --line: rgba(26, 26, 26, 0.10);
  --line-strong: rgba(26, 26, 26, 0.20);
  --chip: #F1F0EC;

  --coral: #F46653;
  --coral-hover: #EC5641;
  --coral-edge: #C2412F;
  --coral-50: #FFF6F2;
  --coral-100: #FFECE6;
  --coral-200: #FFD8CD;
  --lav-50: #FAF9FF;
  --lav-100: #F5F2FF;
  --lav-200: #E2DBFF;
  --mus-50: #FFFBE7;
  --mus-100: #FFF5CF;
  --mus-200: #FFE69E;
  --sky-100: #E6F7FF;
  --sky-200: #CEE9FF;
  --sky-600: #2672EE;
  --mint-100: #DDFBEA;
  --mint-200: #B8F0D2;
  --mint-700: #00734D;
  --rose-100: #FFEBF5;
  --rose-200: #FFD3E8;

  --imdb: #F5C518;
  --csfd: #BA0305;
  --csfd-mid: #4F78A3;
  --csfd-low: #535353;

  --r-panel: 32px;
  --r-tile: 20px;
  --r-btn: 16px;
  --shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.10);
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --focus: 3px solid var(--sky-600);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; outline: none; }

img { display: block; max-width: 100%; }

a { color: inherit; }

button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: var(--focus); outline-offset: 3px; }

.sr-only {
  position: absolute !important;
  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: -60px;
  background: var(--ink); color: var(--white);
  padding: 10px 16px; border-radius: 12px;
  font-weight: 700; z-index: 10; text-decoration: none;
}
.skip:focus { top: 12px; }

.noscript { max-width: 640px; margin: 80px auto; padding: 0 16px; font-size: 20px; }

/* --- top bar ------------------------------------------------------------ */

.topbar {
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; border-radius: 12px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--coral);
  box-shadow: 0 3px 0 var(--coral-edge);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; left: 13px; top: 10px;
  border-left: 12px solid var(--white);
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.brand-name { font-weight: 900; font-size: 23px; letter-spacing: -0.045em; }

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 16px 28px;
  border: 0; border-radius: var(--r-btn);
  font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease, background-color 120ms ease;
}
.btn:active:not(:disabled) { transform: translateY(4px); }

.btn-primary { background: var(--coral); color: var(--white); box-shadow: 0 5px 0 var(--coral-edge); }
.btn-primary:hover:not(:disabled) { background: var(--coral-hover); }
.btn-primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--coral-edge); }

.btn-secondary { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-strong), 0 5px 0 #D9D7D1; }
.btn-secondary:hover:not(:disabled) { background: var(--coral-50); }
.btn-secondary:active:not(:disabled) { box-shadow: inset 0 0 0 2px var(--line-strong), 0 1px 0 #D9D7D1; }

.btn:disabled { background: #E9E7E2; color: #85837D; box-shadow: 0 5px 0 #D6D4CE; cursor: not-allowed; }

/* the one action on the landing page, sized to match the headline above it */
.btn-hero {
  min-height: 80px; padding: 22px 44px; border-radius: 20px;
  font-size: clamp(22px, 2.1vw, 27px); font-weight: 900; letter-spacing: -0.025em;
  box-shadow: 0 7px 0 var(--coral-edge);
}
.btn-hero:active:not(:disabled) { transform: translateY(6px); }

.btn-link {
  background: none; border: 0; padding: 8px 4px; cursor: pointer;
  font-size: 17px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px;
  color: var(--ink-2); border-radius: 8px;
}
.btn-link:hover { color: var(--ink); }

/* --- landing ------------------------------------------------------------- */

.hero {
  max-width: 1240px; margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 48px; align-items: center;
}

.hero-title {
  margin: 0 0 28px;
  font-size: clamp(50px, 8.2vw, 112px);
  font-weight: 900; letter-spacing: -0.058em; line-height: 0.9;
  text-wrap: balance;
  outline: none;
}

.hero-sub {
  margin: 0 0 36px; max-width: 34em;
  font-size: clamp(18px, 1.55vw, 21px); line-height: 1.5; color: var(--ink-2);
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }

.services-line {
  margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 15px; color: var(--ink-3);
}
.services-line .pill { font-size: 14px; padding: 6px 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--white); border: 2px solid var(--line);
  font-weight: 600; color: var(--ink);
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.deck { position: relative; height: 540px; max-width: 480px; width: 100%; justify-self: center; }
.deck-card {
  position: absolute; left: var(--x); top: var(--y); z-index: var(--z);
  width: min(320px, 78%); min-height: 220px;
  margin: 0; padding: 26px 26px 24px;
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  border: 3px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: rotate(var(--rot));
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
  animation: deal 650ms cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: var(--delay);
}
.deck-card:hover, .deck-card:focus-visible { transform: rotate(var(--rot)) translateY(-14px); z-index: 4; }
.deck-card:nth-child(1) { --x: 0px; --y: 0px; --z: 1; --rot: -5deg; --delay: 60ms; background: var(--coral-100); }
.deck-card:nth-child(2) { --x: 72px; --y: 140px; --z: 2; --rot: 2deg; --delay: 160ms; background: var(--lav-100); }
.deck-card:nth-child(3) { --x: 144px; --y: 280px; --z: 3; --rot: 6deg; --delay: 260ms; background: var(--mus-100); }
.deck-mood { font-size: clamp(30px, 3vw, 38px); font-weight: 900; letter-spacing: -0.045em; line-height: 0.95; }
.deck-hint { font-size: 16px; color: var(--ink-2); }
.deck-card:not(:last-child) .deck-q { visibility: hidden; }
.deck-q { margin-top: auto; font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

@keyframes deal {
  from { transform: rotate(0deg) translateY(40px); opacity: 0; }
}

.how {
  max-width: 1240px; margin: 0 auto; padding: 0 24px 96px;
}
.how h2 { margin: 0 0 24px; font-size: clamp(32px, 4vw, 48px); font-weight: 900; letter-spacing: -0.045em; line-height: 1; }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.how-card { border-radius: var(--r-tile); border: 3px solid var(--line); padding: 28px; }
.how-card:nth-child(1) { background: var(--coral-50); }
.how-card:nth-child(2) { background: var(--lav-50); }
.how-card:nth-child(3) { background: var(--mus-50); }
.how-num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 18px;
  border-radius: 50%; background: var(--ink); color: var(--white); font-weight: 800;
}
.how-card h3 { margin: 0 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.how-card p { margin: 0; color: var(--ink-2); }

/* --- wizard -------------------------------------------------------------- */

.wrap { max-width: 1120px; margin: 8px auto 72px; padding: 0 16px; }

.panel {
  background: var(--white);
  border: 3px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4.2vw, 56px);
}

.progress { display: flex; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.progress li { flex: 1; height: 8px; border-radius: 999px; background: #ECEBE7; }
.progress li.on { background: var(--coral); }

.step-count { margin: 0 0 28px; font-size: 15px; font-weight: 600; color: var(--ink-3); }

.step-title {
  margin: 0 0 10px;
  font-size: clamp(36px, 5.4vw, 64px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.95;
  outline: none;
}
.step-sub { margin: 0 0 32px; font-size: 19px; color: var(--ink-2); }

.group { border: 0; margin: 0 0 36px; padding: 0; min-width: 0; }
.group:last-of-type { margin-bottom: 0; }
.group legend { padding: 0; margin: 0 0 14px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.group-note { font-weight: 500; color: var(--ink-3); font-size: 16px; }

.tiles { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 14px; }

.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  min-height: 116px; padding: 20px 56px 20px 22px;
  border-radius: var(--r-tile); border: 3px solid transparent;
  cursor: pointer; user-select: none;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:hover { transform: translateY(-2px); }
.tile-label { font-size: 21px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; }
.tile-hint { font-size: 15px; line-height: 1.4; color: var(--ink-2); }
.tile .tick {
  position: absolute; top: 16px; right: 16px; width: 28px; height: 28px;
  border-radius: 50%; border: 2.5px solid var(--line-strong); background: rgba(255, 255, 255, 0.7);
  display: grid; place-items: center;
}
.tile .tick svg { width: 15px; height: 15px; opacity: 0; }
.tile:has(input:checked) { border-color: var(--ink); }
.tile:has(input:checked) .tick { background: var(--ink); border-color: var(--ink); }
.tile:has(input:checked) .tick svg { opacity: 1; }
.tile:has(input:focus-visible) { outline: var(--focus); outline-offset: 3px; }
.tile:has(input:disabled) { opacity: 0.45; cursor: not-allowed; transform: none; }

.t-coral { background: var(--coral-100); }
.t-lav { background: var(--lav-100); }
.t-mus { background: var(--mus-100); }
.t-sky { background: var(--sky-100); }
.t-mint { background: var(--mint-100); }
.t-rose { background: var(--rose-100); }
.t-coral:has(input:checked) { background: var(--coral-200); }
.t-lav:has(input:checked) { background: var(--lav-200); }
.t-mus:has(input:checked) { background: var(--mus-200); }
.t-sky:has(input:checked) { background: var(--sky-200); }
.t-mint:has(input:checked) { background: var(--mint-200); }
.t-rose:has(input:checked) { background: var(--rose-200); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 10px 20px;
  border-radius: 999px; border: 2px solid var(--line-strong); background: var(--white);
  font-size: 17px; font-weight: 700; cursor: pointer; user-select: none;
  transition: background-color 120ms ease, color 120ms ease;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { background: var(--coral-50); }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chip:has(input:checked) .dot { box-shadow: 0 0 0 2px var(--white); }
.chip:has(input:focus-visible) { outline: var(--focus); outline-offset: 3px; }
.chip-all { border-style: dashed; }

.hint-line { margin: 12px 0 0; min-height: 24px; font-size: 15px; color: var(--ink-3); }

.note {
  width: 100%; min-height: 150px; padding: 18px 20px;
  border: 3px solid var(--line-strong); border-radius: var(--r-tile); background: var(--white);
  font-size: 20px; line-height: 1.45; resize: vertical;
}
.note:focus { outline: none; border-color: var(--ink); }
.note::placeholder { color: #9A9893; }
.note-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 15px; color: var(--ink-3); }

.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; align-items: center; }
.examples span { font-size: 15px; color: var(--ink-3); margin-right: 4px; }
.example {
  border: 2px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 8px 14px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.example:hover { background: var(--coral-50); }

.wizard-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 40px; padding-top: 28px; border-top: 2px solid var(--line);
}

/* --- loading ------------------------------------------------------------- */

.loading-title {
  margin: 0 0 32px; max-width: 14em;
  font-size: clamp(36px, 5.4vw, 64px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.95;
  outline: none;
}
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.feed li {
  display: flex; align-items: center; gap: 14px; padding: 10px 0;
  font-size: 19px; font-weight: 600; animation: rise 260ms ease both;
}
.feed .mark { width: 16px; height: 16px; border-radius: 50%; background: var(--coral); flex: none; animation: pulse 1s ease-in-out infinite; }
.feed li.done { color: var(--ink-2); }
.feed li.done .mark { background: var(--mint-700); animation: none; }
@keyframes pulse { 50% { transform: scale(0.6); opacity: 0.5; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* --- results ------------------------------------------------------------- */

.results-title {
  margin: 0 0 12px;
  font-size: clamp(40px, 6vw, 76px); font-weight: 900; letter-spacing: -0.055em; line-height: 0.92;
  outline: none;
}
.intro { margin: 0 0 32px; max-width: 38em; font-size: clamp(19px, 1.7vw, 22px); color: var(--ink-2); }

.top-pick { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }

.poster {
  width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: var(--r-tile); background: var(--chip);
  border: 2px solid var(--line);
}
.poster-fallback {
  display: grid; place-items: center; padding: 20px; text-align: center;
  font-weight: 900; font-size: 24px; letter-spacing: -0.03em; line-height: 1.05;
  background: var(--lav-100);
}

.pick-title { margin: 0; font-size: clamp(34px, 4.4vw, 58px); font-weight: 900; letter-spacing: -0.048em; line-height: 0.95; }
.alt-title { margin: 8px 0 0; font-size: 17px; color: var(--ink-3); }

.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.facts li { padding: 6px 12px; border-radius: 999px; background: var(--chip); font-size: 14px; font-weight: 600; }
.facts li.dub { background: var(--sky-100); }

.ratings { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.rating {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 14px; border: 2px solid var(--line);
  text-decoration: none; background: var(--white);
}
.rating:hover { border-color: var(--line-strong); }
.rating-src { padding: 4px 8px; border-radius: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.01em; }
.rating-src.imdb { background: var(--imdb); color: var(--ink); }
.rating-src.csfd { background: var(--csfd); color: var(--white); }
.rating-val { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.rating-val.mid { color: var(--csfd-mid); }
.rating-val.high { color: var(--csfd); }
.rating-val.low { color: var(--csfd-low); }
.rating-votes { font-size: 14px; color: var(--ink-3); }
.rating-none { font-size: 15px; font-weight: 600; color: var(--ink-2); }

.reason {
  margin: 22px 0 0; padding: 20px 22px; border-radius: var(--r-tile);
  background: var(--mus-50); font-size: clamp(19px, 1.6vw, 22px); line-height: 1.45; font-weight: 500;
}
.desc { margin: 16px 0 0; max-width: 40em; color: var(--ink-2); font-size: 16px; }
.people { margin: 10px 0 0; font-size: 15px; color: var(--ink-3); }

.review { margin: 22px 0 0; padding: 20px 22px; border-radius: var(--r-tile); background: var(--lav-100); }
.review blockquote { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink); }
.review figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 12px 0 0; font-size: 14px; color: var(--ink-3); }
.review-stars { color: var(--csfd); letter-spacing: 1px; }
.review-by { font-weight: 600; color: var(--ink-2); }
.review-link { color: var(--ink-2); text-underline-offset: 3px; }
.review-link:hover { color: var(--ink); }
.review.compact { margin-top: 12px; padding: 12px 14px; border-radius: 14px; }
.review.compact blockquote {
  font-size: 14px; line-height: 1.45; color: var(--ink-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.review.compact figcaption { margin-top: 8px; font-size: 13px; }

.watch { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.watch .btn { min-height: 52px; padding: 12px 20px; font-size: 17px; }
.watch svg { width: 16px; height: 16px; flex: none; }
.match { margin: 16px 0 0; font-size: 15px; font-weight: 700; color: var(--ink-3); }

.more-title { margin: 56px 0 20px; font-size: clamp(28px, 3.2vw, 40px); font-weight: 900; letter-spacing: -0.045em; line-height: 1; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.mini {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 3px solid var(--line); border-radius: 24px;
}
.mini .poster { border-radius: 0; border: 0; border-bottom: 2px solid var(--line); }
.mini-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.mini h4 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.mini .meta { margin: 6px 0 0; font-size: 14px; color: var(--ink-3); }
.mini .ratings { margin-top: 12px; gap: 8px; }
.mini .rating { padding: 4px 8px 4px 4px; gap: 6px; border-radius: 10px; }
.mini .rating-val { font-size: 16px; }
.mini .rating-src { font-size: 11px; padding: 3px 5px; border-radius: 6px; }
.mini .reason { padding: 0; margin: 14px 0 0; background: none; font-size: 16px; line-height: 1.45; flex: 1; }
.mini .watch { margin-top: 16px; gap: 8px; }
.mini .watch .btn { min-height: 44px; padding: 8px 14px; font-size: 15px; border-radius: 12px; box-shadow: inset 0 0 0 2px var(--line-strong), 0 3px 0 #D9D7D1; }

.result-actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin: 48px 0 0; }
.source-note { margin: 22px 0 0; font-size: 15px; color: var(--ink-3); }

.empty, .error { text-align: left; }
.error .step-title { color: var(--ink); }

/* --- footer -------------------------------------------------------------- */

.footer {
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 32px 24px 48px; border-top: 2px solid var(--line);
  font-size: 14px; color: var(--ink-3);
}
.footer p { margin: 0 0 6px; max-width: 70em; }

/* --- small screens ----------------------------------------------------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 16px; gap: 24px; }
  .deck { height: 520px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-grid { grid-template-columns: 1fr; }
  .top-pick { grid-template-columns: 1fr; }
  .top-pick .poster { max-width: 280px; }
}

@media (max-width: 560px) {
  .topbar { padding: 16px; }
  .hero, .how { padding-left: 16px; padding-right: 16px; }
  .btn-hero { width: 100%; min-height: 72px; padding: 18px 24px; }
  .deck { height: 400px; }
  .deck-card { width: 74%; min-height: 170px; padding: 18px 20px; }
  .deck-card:nth-child(2) { --x: 13%; --y: 112px; }
  .deck-card:nth-child(3) { --x: 26%; --y: 224px; }
  .deck-mood { font-size: 28px; }
  .mini { flex-direction: row; }
  .mini .poster { width: 112px; flex: none; align-self: flex-start; border-bottom: 0; border-right: 2px solid var(--line); }
  .mini-body { padding: 14px 14px 16px; min-width: 0; }
  .mini h4 { font-size: 19px; }
  .mini .reason { font-size: 15px; }
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .wizard-nav {
    position: sticky; bottom: 0; z-index: 2;
    margin: 32px -24px -24px; padding: 16px 24px;
    background: var(--white); border-radius: 0 0 var(--r-panel) var(--r-panel);
  }
  .wizard-nav .btn { flex: 1; padding: 14px 16px; }
  .result-actions .btn { width: 100%; }
}

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