:root {
  color-scheme: dark;
  --bg: #0d0e12;
  --panel: #121318;
  --line: rgba(255, 255, 255, .1);
  --muted: #9698a2;
  --orange: #ff9418;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-height: 100svh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: #f7f7f8;
  background: radial-gradient(circle at 72% 24%, rgba(136, 56, 37, .12), transparent 30rem), var(--bg);
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 14, 18, .84);
  backdrop-filter: blur(20px);
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #160a02;
  background: linear-gradient(145deg, #ffad38, #ff5f2d);
  box-shadow: 0 8px 24px rgba(255, 115, 35, .2);
  font-weight: 800;
  letter-spacing: -.06em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.repo-link {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d7d7da;
  text-decoration: none;
  font-size: 12px;
}

.preview-page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.preview-heading {
  padding: clamp(54px, 8vw, 92px) 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}
.preview-heading > p { max-width: 430px; margin: 0 0 5px; color: #a7a9b0; line-height: 1.7; font-size: 14px; }
.eyebrow { margin: 0 0 12px; color: var(--orange); font-size: 10px; font-weight: 760; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: 1; letter-spacing: -.05em; }

.controls {
  width: fit-content;
  display: flex;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .045);
}
.date-controls { display: flex; gap: 7px; }
.icon-button {
  width: 44px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, .075);
  font-size: 27px;
  cursor: pointer;
}
.date-field { min-width: 168px; padding: 7px 12px; border-radius: 12px; background: rgba(255, 255, 255, .075); }
.date-field span { display: block; margin-bottom: 2px; color: var(--muted); font-size: 9px; letter-spacing: .11em; text-transform: uppercase; }
.date-field input { width: 100%; border: 0; outline: none; color: #fff; background: transparent; color-scheme: dark; }
.shuffle-button {
  padding: 0 18px;
  border: 1px solid rgba(255, 148, 24, .34);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 148, 24, .09);
  cursor: pointer;
}
.shuffle-button span { color: var(--orange); font-size: 18px; }
.shuffle-button.secondary { border-color: var(--line); color: var(--muted); background: rgba(255, 255, 255, .045); }

.size-comparison { padding: 34px 0 clamp(76px, 10vw, 120px); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.section-heading .eyebrow { margin: 0 0 4px; }
.section-heading h2 { margin: 0; font-size: clamp(25px, 3.5vw, 42px); letter-spacing: -.04em; }
.candidate-label { margin-left: auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.comparison-stage {
  min-height: 450px;
  padding: clamp(32px, 6vw, 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(54px, 8vw, 104px);
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: radial-gradient(circle at 62% 18%, rgba(130, 55, 40, .17), transparent 42%), #111217;
}
.comparison-stage figure { margin: 0; display: grid; gap: 19px; }
.comparison-stage figcaption { display: flex; justify-content: space-between; gap: 28px; color: var(--muted); font-size: 11px; }
.comparison-stage figcaption strong { color: #fff; }

.movie-widget {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  color: white;
  background: #050505;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .28);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif;
}
.movie-widget.small { width: 169px; height: 169px; border-radius: 28px; }
.movie-widget.medium { width: 360px; height: 169px; border-radius: 28px; }
.widget-image { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; }
.widget-image:not([src]), .widget-image[src=""] { display: none; }
.image-fallback { position: absolute; inset: 0; z-index: -2; display: grid; place-items: center; color: rgba(255, 255, 255, .2); background: linear-gradient(145deg, #352e6e, #09090c 57%, #a55422); font-size: 46px; }
.widget-image[src] + .image-fallback { display: none; }
.widget-gradient { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(0, 0, 0, .06), transparent 30%, rgba(0, 0, 0, .24) 55%, rgba(0, 0, 0, .92)); }

.small-copy { position: absolute; inset: 0; display: none; padding: 14px; flex-direction: column; align-items: flex-start; }
.small .small-copy { display: flex; }
.small-day { font-size: 46px; font-weight: 300; line-height: .92; letter-spacing: -.045em; }
.small-spacer { flex: 1; min-height: 6px; }
.small-title-row, .wide-title-row { display: flex; align-items: center; gap: 5px; max-width: 100%; }
.small-title-row .movie-title { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rating-badge { flex: none; display: inline-block; border-radius: 999px; color: #080808; background: var(--orange); font-weight: 800; }
.small .rating-badge { padding: 3px 6px; font-size: 9px; }
.small .movie-quote { margin-top: 4px; display: -webkit-box; overflow: hidden; font-size: 10px; font-weight: 550; line-height: 1.25; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.medium-copy { position: absolute; inset: 0; display: none; padding: 16px 16px 24px; align-items: flex-end; gap: 14px; }
.medium .medium-copy { display: flex; }
.date-lockup { width: 68px; flex: none; display: flex; flex-direction: column; align-items: flex-start; }
.medium-day { font-size: 58px; font-weight: 300; line-height: .82; letter-spacing: -.055em; }
.medium-subtitle { margin-top: 7px; font-size: 10px; font-weight: 700; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.wide-text { min-width: 0; padding-bottom: 3px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.wide-title-row { gap: 7px; }
.book-title { max-width: 170px; overflow: hidden; font-size: 15px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.medium .rating-badge { padding: 4px 7px; font-size: 10px; }
.medium .movie-quote { display: -webkit-box; overflow: hidden; font-size: 11px; font-weight: 560; line-height: 1.22; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

footer { padding: 26px clamp(20px, 5vw, 76px) 34px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: #6f7179; font-size: 10px; }
.footer-links { display: flex; align-items: center; gap: 14px; }
footer a { color: #a7a9b0; text-decoration: none; }
footer a:hover { color: #fff; }

.legal-page { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding: clamp(48px, 8vw, 86px) 0 96px; }
.legal-page header { margin-bottom: 42px; }
.legal-page h1 { margin-bottom: 18px; }
.legal-page .lede { max-width: 680px; margin: 0; color: #b2b4bc; font-size: 16px; line-height: 1.75; }
.legal-page .updated { margin-top: 14px; color: #747780; font-size: 12px; }
.legal-card { margin-top: 16px; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .035); }
.legal-card h2 { margin: 0 0 12px; font-size: 21px; letter-spacing: -.02em; }
.legal-card p, .legal-card li { color: #b2b4bc; line-height: 1.75; }
.legal-card p { margin: 10px 0 0; }
.legal-card ul { margin: 10px 0 0; padding-left: 21px; }
.legal-card a { color: #ffad38; }
.language-divider { margin: 52px 0 30px; border: 0; border-top: 1px solid var(--line); }

@media (max-width: 700px) {
  .preview-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .comparison-stage { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .topbar { height: 64px; padding: 0 14px; }
  .repo-link { display: none; }
  .preview-page { width: calc(100% - 24px); }
  .preview-heading { padding-top: 46px; }
  h1 { font-size: 40px; }
  .controls { width: 100%; flex-wrap: wrap; }
  .date-controls { width: 100%; }
  .date-field { min-width: 0; flex: 1; }
  .shuffle-button { width: 100%; height: 44px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .candidate-label { margin-left: 0; }
  .section-heading h2 { font-size: 28px; }
  .comparison-stage { min-height: 0; padding: 34px 24px; border-radius: 24px; gap: 48px; }
  .comparison-stage figure { max-width: 100%; }
  #mediumWidget { margin-bottom: -27px; transform: scale(.84); transform-origin: top left; }
  #mediumWidget + figcaption { max-width: 302px; }
  footer, .footer-links { align-items: flex-start; flex-direction: column; gap: 8px; }
}

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