/* Skinpick. Layout idea: a versus screen. Two skins face each other, left against right. */
:root {
  --bg: #0d1115;
  --surface: #151b21;
  --surface-2: #1d252d;
  --line: #2b3640;
  --fg: #e8ecef;
  --muted: #98a4ae;
  --accent: #e2a93b;
  --accent-ink: #1b1405;
  --radius: 8px;
  --maxw: 1180px;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Motion tokens: strong custom curves, the built-in easings are too weak */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f4f5;
    --surface: #fbfcfc;
    --surface-2: #e6eaed;
    --line: #cdd5da;
    --fg: #12171b;
    --muted: #55616b;
    --accent: #8a5f00;
    --accent-ink: #fffaf0;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; text-wrap: balance; }
h1:focus { outline: none; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A new view fades in so the page does not jump from one screen to the next */
.view { animation: fade 200ms ease both; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes settle { from { opacity: 0; transform: scale(0.985); } }
@keyframes pop { from { opacity: 0; transform: scale(0.9); } }

/* Top bar */
.bar { border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }
.mark { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none; }
.bar nav { display: flex; gap: 1.5rem; }
.bar nav a { text-decoration: none; color: var(--muted); font-weight: 500; transition: color 150ms ease; }

/* Buttons: press feedback on every pressable element */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.15rem; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 160ms var(--ease-out), filter 150ms ease, background-color 150ms ease, opacity 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; transform: none; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.small { padding: 0.4rem 0.7rem; font-size: 0.9rem; }
.btn .label { display: inline-block; transition: filter 200ms ease, opacity 200ms ease; }
.btn .label.swap { filter: blur(2px); opacity: 0.6; }
#playBoth { min-width: 8.25rem; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-weight: 500; transition: color 150ms ease; }

@media (hover: hover) and (pointer: fine) {
  .bar nav a:hover, .back:hover { color: var(--fg); }
  .btn:hover { filter: brightness(1.08); }
  .btn.ghost:hover { background: var(--surface-2); filter: none; }
  .swatches span:hover { transform: scale(1.15); }
  .stage:hover .grip { transform: translate(-50%, -50%) scale(1.06); }
  .champs a:hover { background: var(--surface); }
  .champs a:hover img, .tile:hover img { transform: scale(1.04); }
}

/* Form fields */
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.95rem; font-weight: 500; }
.field input {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); font: 500 1rem var(--font-body); font-variant-numeric: tabular-nums;
}

/* Home: champion picker */
.home { padding-block: 3rem 4rem; }
.home h1, .pick h1 { font-size: clamp(2.6rem, 5.6vw, 4.25rem); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; }
.home .lead, .pick .lead { margin-top: 1rem; max-width: 52ch; font-size: 1.15rem; color: var(--muted); }
.search { margin-top: 2rem; max-width: 26rem; }
.count { margin-top: 0.6rem; font-size: 0.92rem; color: var(--muted); }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.5rem; margin-top: 2rem; }
.champs a {
  display: grid; justify-items: center; gap: 0.45rem; padding: 0.75rem 0.4rem; border-radius: var(--radius);
  text-decoration: none; text-align: center; font-size: 0.95rem; font-weight: 500; line-height: 1.2;
  transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.champs a:active { transform: scale(0.97); }
.champs .icon { width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.champs img { width: 64px; height: 64px; transition: transform 200ms var(--ease-out); }
.empty { margin-top: 2rem; color: var(--muted); }

/* Champion: skin picker */
.pick { padding-block: 2rem 8rem; }
.pick h1 { margin-top: 1rem; }
.pick h1 small { display: block; margin-top: 0.4rem; font: 500 1.15rem/1.3 var(--font-body); color: var(--muted); text-transform: none; letter-spacing: 0; }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 1rem; margin-top: 2rem; }
.tile {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 160ms var(--ease-out);
}
.tile:active { transform: scale(0.97); }
.tile .thumb { display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 150ms ease; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 200ms var(--ease-out); }
.tile[aria-pressed="true"] .thumb { outline-color: var(--accent); }
.tile .order {
  position: absolute; top: 0.5rem; left: 0.5rem; width: 1.75rem; height: 1.75rem; border-radius: 6px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  font: 700 1rem/1 var(--font-display);
  opacity: 0; transform: scale(0.9); transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.tile[aria-pressed="true"] .order { opacity: 1; transform: none; }
.tile-name { display: block; margin-top: 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.15; }
.tile-meta { display: block; color: var(--muted); font-size: 0.92rem; }

/* Compare bar: slides up once a skin is picked, leaves the same way */
.comparebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%); transition: transform 250ms var(--ease-out);
}
.comparebar[data-open] { transform: none; }
.comparebar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.comparebar p { font-weight: 500; min-width: 0; }

/* Compare: hero */
.hero { padding-block: 2rem 4rem; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: 3rem; align-items: center; }
.hero h1 { margin-top: 1rem; font-size: clamp(2.4rem, 5.4vw, 4.25rem); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.hero p { margin-top: 1.1rem; max-width: 34ch; font-size: 1.15rem; color: var(--muted); }
.hero .btn { margin-top: 1.75rem; }
.hero-text > * { animation: rise 500ms var(--ease-out) both; }
.hero-text > :nth-child(2) { animation-delay: 60ms; }
.hero-text > :nth-child(3) { animation-delay: 120ms; }
.hero-text > :nth-child(4) { animation-delay: 180ms; }
.versus { margin: 0; animation: settle 600ms var(--ease-out) 120ms both; }

/* Compare slider: the top image is clipped along a slanted line that follows the pointer */
.stage {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); cursor: ew-resize; touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.layer { position: absolute; inset: 0; overflow: hidden; }
.layer img { position: absolute; top: 0; width: 150%; max-width: none; height: auto; pointer-events: none; }
.layer.a img { left: -48%; }
.layer.b img { left: -2%; }
.layer.b { clip-path: polygon(56% 0, 100% 0, 100% 100%, 44% 100%); }
.divider { position: absolute; top: 0; bottom: 0; left: -6%; width: 12%; transform: translateX(416.667%); pointer-events: none; }
.divider::before {
  content: ""; position: absolute; inset: 0; background: var(--fg);
  clip-path: polygon(calc(100% - 1.5px) 0, calc(100% + 1.5px) 0, 1.5px 100%, -1.5px 100%);
}
.grip {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; border-radius: 50%;
  transform: translate(-50%, -50%);
  display: grid; place-items: center; pointer-events: auto;
  background: var(--fg); color: var(--bg); font: 700 1.1rem/1 var(--font-body); letter-spacing: 0.12em; padding-left: 0.12em;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
  transition: transform 160ms var(--ease-out);
}
.stage[data-dragging] .grip { transform: translate(-50%, -50%) scale(0.94); }
.versus figcaption { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.9rem; }
.versus figcaption div:last-child { text-align: right; }
.cap-name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.1; }
.cap-meta { color: var(--muted); font-size: 0.95rem; }

/* Compare: sections */
section.block { padding-block: 4rem; border-top: 1px solid var(--line); }
.block h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 600; }
.block .lead { margin-top: 0.75rem; max-width: 62ch; color: var(--muted); }
.note { margin-top: 1rem; font-size: 0.92rem; color: var(--muted); max-width: 70ch; }

/* Scroll reveal: fires once per block, never again */
.js [data-reveal="block"] { opacity: 0; transform: translateY(12px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.js [data-reveal="block"][data-visible] { opacity: 1; transform: none; }
.js [data-reveal="rows"]:not([data-visible]) tbody tr > * { opacity: 0; }
.js [data-reveal="rows"][data-visible] tbody tr > * { animation: rise 300ms var(--ease-out) both; animation-delay: calc(var(--i) * 30ms); }
.js [data-reveal="pop"]:not([data-visible]) .swatches span { opacity: 0; }
.js [data-reveal="pop"][data-visible] .swatches span { animation: pop 300ms var(--ease-out) both; animation-delay: calc(var(--i) * 40ms); }

/* Segmented controls. The active look is a second copy of the row, revealed with clip-path,
   so text and background change as one piece instead of two colours cross-fading. */
.seg { position: relative; display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.seg label, .seg-on span { padding: 0.5rem 0.85rem; font-weight: 500; font-size: 0.95rem; line-height: 1.4; white-space: nowrap; }
.seg label { color: var(--muted); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-on {
  position: absolute; inset: 0; display: flex; pointer-events: none;
  background: var(--accent); color: var(--accent-ink); border-radius: 7px;
  clip-path: inset(0 100% 0 0 round 7px);
  transition: clip-path 220ms var(--ease-in-out), opacity 150ms ease;
}
.seg[data-empty] .seg-on { opacity: 0; }
.seg.scale label, .seg.scale .seg-on span { width: 2.5rem; padding-inline: 0; text-align: center; }
/* Keyboard changes happen instantly: no animation on keyboard-driven actions */
[data-kbd] .seg-on { transition: none; }

/* Compare: videos */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.75rem; }
.sound { display: inline-flex; align-items: center; gap: 0.6rem; }
.seg-title { font-size: 0.95rem; color: var(--muted); }
/* Jump buttons: pressed many times while comparing, so feedback is quick and nothing slides */
.jumps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.9rem; }
.jumps .seg-title { margin-right: 0.35rem; }
.chip {
  min-width: 2.5rem; padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); font: 600 0.9rem var(--font-body); cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip[disabled] { opacity: 0.5; cursor: default; transform: none; }
.repeat { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: 0.5rem; font-size: 0.95rem; color: var(--muted); cursor: pointer; }
.repeat input { accent-color: var(--accent); width: 1rem; height: 1rem; }
@media (hover: hover) and (pointer: fine) {
  .chip:not([disabled]):not([aria-pressed="true"]):hover { background: var(--surface-2); }
}
@media (prefers-reduced-motion: reduce) {
  .chip { transition: none; }
  .chip:active { transform: none; }
}

.videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.frame .wait {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 0.5rem; padding: 1rem; text-align: center;
  color: var(--muted); background: var(--surface-2); transition: opacity 250ms ease;
}
.frame .wait[data-done] { opacity: 0; pointer-events: none; }
.vid-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.7rem; }
.vid-row h3 { font-size: 1.35rem; font-weight: 600; }
.vid-tools { display: flex; align-items: center; gap: 0.4rem; }
.vid-tools a { margin-left: 0.4rem; font-size: 0.92rem; color: var(--muted); }

/* Compare: value */
.summary { margin-top: 1.5rem; max-width: 62ch; font-size: 1.2rem; line-height: 1.5; }
.table-scroll { overflow-x: auto; margin-top: 1.75rem; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 0.7rem 1rem; text-align: left; vertical-align: top; }
thead th { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
tbody th { font-weight: 400; color: var(--muted); }
tbody tr:nth-child(odd) { background: var(--surface); }
tbody td { font-weight: 600; }
tbody td.no { color: var(--muted); font-weight: 400; }
.chromas { display: grid; gap: 0.6rem; margin-top: 1.25rem; }
.chroma-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.swatches span { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); transition: transform 160ms var(--ease-out); }

.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem 3rem; margin-top: 3rem; align-items: end; }
.calc h3 { grid-column: 1 / -1; font-size: 1.5rem; font-weight: 600; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fields .help { grid-column: 1 / -1; font-size: 0.92rem; color: var(--muted); }
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.results dt { color: var(--muted); font-size: 0.95rem; }
.results dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 2.8vw, 2.2rem); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* Compare: feel */
.rate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 3rem; margin-top: 2rem; }
.rate fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.rate legend { padding: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; }
.crit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-block: 0.7rem; }
.crit + .crit { border-top: 1px solid var(--line); }
.crit .q { flex: 1 1 12rem; min-width: 0; font-weight: 500; }
.crit .seg { flex: none; }
.crit .q small { display: block; font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.crit .q .avg { color: var(--fg); font-weight: 500; }
.crit .q .avg:empty, .crowd:empty { display: none; }
.mine { margin-top: 1rem; font-weight: 500; }
.crowd { margin-top: 0.35rem; color: var(--muted); }
.feel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; }

.status { padding-block: 4rem; color: var(--muted); }

footer { border-top: 1px solid var(--line); padding-block: 2rem 3rem; color: var(--muted); font-size: 0.92rem; }
footer p { max-width: 80ch; }
footer p + p { margin-top: 0.6rem; }

@media (max-width: 820px) {
  .home { padding-block: 2rem 3rem; }
  .hero { padding-block: 1.5rem 3rem; }
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .stage { aspect-ratio: 4 / 3; }
  .bar nav { gap: 1rem; font-size: 0.95rem; }
  section.block { padding-block: 3rem; }
  .videos, .rate, .calc { grid-template-columns: 1fr; }
  .calc { gap: 1.5rem; }
  th, td { padding: 0.6rem 0.6rem; }
  .skins { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .champs { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}
@media (max-width: 420px) {
  .results { grid-template-columns: 1fr 1fr; }
  .crit { flex-direction: column; align-items: flex-start; }
}

/* Reduced motion: keep the fades that aid comprehension, drop movement */
@media (prefers-reduced-motion: reduce) {
  .hero-text > *, .versus { animation-name: fade; }
  .js [data-reveal="block"] { transform: none; transition: opacity 300ms ease; }
  .js [data-reveal="rows"][data-visible] tbody tr > *,
  .js [data-reveal="pop"][data-visible] .swatches span { animation-name: fade; animation-delay: 0ms; }
  .seg-on { transition: opacity 150ms ease; }
  .btn, .grip, .swatches span, .tile, .tile img, .tile .order, .champs a, .champs img { transition: none; }
  .btn:active, .tile:active, .champs a:active { transform: none; }
  .comparebar { transition: none; }
}
