/* TFT PBE patch notes.
 *
 * The page has one job: let a player find their champions and tell in a glance
 * whether a change helps or hurts. Everything is subordinate to the diff row,
 * which is the only place colour appears.
 */

:root {
  /* Slate rather than neutral black -- TFT's own UI sits in dark blue-grey,
     and a true black background makes the coral nerf colour vibrate. */
  --bg: #12151c;
  --surface: #191d26;
  --surface-raised: #1f2430;
  --line: #262c38;

  /* Contrast ratios against --bg. The previous --text-faint (#59606d) sat at
     about 3.2:1, below the 4.5:1 needed for body-size text, and it was being
     used for stat units and labels -- the two things on the page that most
     need reading. Every tone below now clears 4.5:1. */
  --text: #eef0f3; /* 15.1:1 */
  --text-dim: #a8b0bd; /* 8.2:1  labels, metadata */
  --text-faint: #8a93a2; /* 5.9:1  units, captions */

  /* Gold is reserved for section headings. Restricting it to one role makes it
     structural information rather than decoration. */
  --gold: #c8a45c;

  /* Mint rather than acid green, coral rather than pure red: both stay legible
     on slate and remain distinguishable from each other at low saturation. */
  --buff: #3dd68c;
  --nerf: #f4626b;

  /* Marks the developer's own words. Deliberately not gold -- that is reserved
     for section structure -- and deliberately not buff/nerf, which carry
     meaning about changes. A cool slate-blue reads as "quoted" without
     competing with either. */
  --quote: #6f9fd8;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo,
    Consolas, monospace;

  --sidebar-w: 264px;
  --content-w: 780px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* The rail must span the full document, not just the first viewport: patch
   pages are long, and a sticky element with a fixed height leaves the column
   visibly unpainted below the fold. The background lives on the grid cell and
   the sticky behaviour on the inner element. */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar__inner {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 28px 0 32px;
}

/* Available to assistive technology, never painted. Polarity is shown
   visually by the glyph and colour together; this carries the same meaning
   for screen readers without duplicating it on screen. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.main {
  padding: 44px 32px 96px;
}

.content {
  max-width: var(--content-w);
  margin: 0 auto;
}

/* --------------------------------------------------------------- sidebar */

.brand {
  padding: 0 22px 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.brand__name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  margin: 0;
}

.brand__tag {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-faint);
}

.patch-nav__heading {
  padding: 0 22px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.patch-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.patch-nav__link {
  display: block;
  padding: 8px 22px;
  text-decoration: none;
  border-left: 2px solid transparent;
  color: var(--text-dim);
}

.patch-nav__link:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.patch-nav__link[aria-current="page"] {
  border-left-color: var(--gold);
  background: var(--surface-raised);
  color: var(--text);
}

.patch-nav__date {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.patch-nav__meta {
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ patch head */

.patch-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 34px;
}

.patch-head__title {
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

.patch-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 14px;
  color: var(--text-dim);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: var(--surface);
}

.badge--warn {
  border-color: color-mix(in srgb, var(--nerf) 45%, var(--line));
  color: var(--nerf);
}

/* --------------------------------------------------------------- section */

.section {
  margin: 0 0 40px;
}

.section__name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}

.section__rule {
  height: 1px;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--gold) 40%, transparent),
    transparent
  );
  margin-bottom: 18px;
}

.group {
  margin-bottom: 22px;
}

.group__name {
  font-size: 15px;
  font-weight: 640;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.subgroup__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-faint);
  margin: 0 0 8px;
  padding-left: 2px;
}

/* ---------------------------------------------------------------- entity */

.entity {
  margin: 0 0 16px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.entity--buff {
  border-left-color: color-mix(in srgb, var(--buff) 55%, transparent);
}

.entity--nerf {
  border-left-color: color-mix(in srgb, var(--nerf) 55%, transparent);
}

.entity__name {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 17.5px;
  font-weight: 640;
  margin: 0 0 5px;
}

/* Polarity is never carried by colour alone: the glyph keeps the meaning
   available when colour is unavailable or indistinguishable. */
.entity__mark {
  font-size: 10px;
  line-height: 1;
}

.entity--buff .entity__mark {
  color: var(--buff);
}

.entity--nerf .entity__mark {
  color: var(--nerf);
}

.entity__unverified {
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.detail__label {
  font-size: 13.5px;
  color: var(--text-faint);
  margin: 10px 0 4px;
}

.lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lines li {
  padding: 3.5px 0;
}

/* -------------------------------------------------------------- diff row */

/* The signature element. Tabular figures are load-bearing: without aligned
   digits, `40/60/100% -> 50/75/120%` cannot be read at a glance. */
.diff {
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 7px;
}

.diff__label {
  font-family: var(--font-body);
  color: var(--text-dim);
  font-size: 15.5px;
}

.diff__before {
  color: var(--text);
}

.diff__arrow {
  color: var(--text-faint);
  padding: 0 1px;
}

.diff__after .v--same {
  color: var(--text);
}

/* Only values that actually moved are coloured. Marking the whole side would
   hide which tiers changed, which is the most useful thing on the line. */
.diff__after .v--changed {
  font-weight: 600;
}

/* Colour comes from the line's own verdict, not the entity's. A champion the
   dev marked as buffed can still lose damage on one line, and painting that
   line green would assert something false about it. */
.diff__after--good .v--changed {
  color: var(--buff);
}

.diff__after--bad .v--changed {
  color: var(--nerf);
}

.diff__after--unknown .v--changed {
  color: var(--gold);
}

.diff__sep,
.diff__unit {
  color: var(--text-faint);
}

.prose {
  font-size: 15.5px;
  color: var(--text);
}

.flag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--nerf);
  cursor: help;
  border-bottom: 1px dotted currentColor;
}

/* ------------------------------------------------------------- dev notes */

.dev-notes {
  /* The one editorial block on a page of data -- the developer's own voice,
     and usually the most interesting thing here. It previously read as the
     dimmest element on the page, which inverted its importance. It now sits
     on a raised surface at full text weight, with a quiet rule to anchor it. */
  margin: 0 0 36px;
  padding: 20px 24px 22px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--quote);
  border-radius: 5px;
}

/* The screenshot is shown as-is. It already carries the dev's name, handle and
   voice, and transcribing prose would only add OCR errors to the one part of
   the page that is not data. */
.dev-notes__image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.dev-notes__image + .dev-notes__image {
  margin-top: 12px;
}

.dev-notes__heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--quote);
  margin: 0 0 12px;
}

.dev-note__author {
  font-size: 13px;
  font-weight: 620;
  margin: 0 0 6px;
}

.dev-note__handle {
  color: var(--text-faint);
  font-weight: 400;
}

.dev-note__body {
  margin: 0;
  /* Preserves the paragraph breaks and `-` bullets the developer wrote. */
  white-space: pre-wrap;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.7;
}

/* ----------------------------------------------------------------- index */

.patch-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  text-decoration: none;
  margin-bottom: 10px;
}

.patch-card:hover {
  border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
}

.patch-card__title {
  font-size: 16px;
  font-weight: 640;
  margin: 0 0 5px;
}

.patch-card__meta {
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.tally {
  font-variant-numeric: tabular-nums;
}

.tally--buff {
  color: var(--buff);
}

.tally--nerf {
  color: var(--nerf);
}

.empty {
  color: var(--text-dim);
  padding: 40px 0;
}

.footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-faint);
}

.footer a {
  color: var(--text-dim);
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar__inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 18px 0 12px;
  }

  .patch-nav__list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px 4px;
  }

  .patch-nav__link {
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: 6px 10px;
  }

  .patch-nav__link[aria-current="page"] {
    border-left: 0;
    border-bottom-color: var(--gold);
  }

  .main {
    padding: 26px 18px 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------ nav links */

.nav-links {
  list-style: none;
  margin: 0 0 20px;
  padding: 0 22px;
  display: flex;
  gap: 14px;
  font-size: 13px;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow a {
  color: var(--text-faint);
  text-decoration: none;
}

.eyebrow a:hover {
  color: var(--gold);
}

/* -------------------------------------------------------------- timeline */

/* An entity page answers "what has happened to this champion", so the patch
   is the anchor for each block rather than the change itself. */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__item {
  padding: 0 0 20px 16px;
  border-left: 2px solid var(--line);
  margin-bottom: 4px;
}

.timeline__item--buff {
  border-left-color: color-mix(in srgb, var(--buff) 55%, transparent);
}

.timeline__item--nerf {
  border-left-color: color-mix(in srgb, var(--nerf) 55%, transparent);
}

.timeline__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline__patch {
  font-size: 15px;
  font-weight: 640;
  color: var(--text);
  text-decoration: none;
}

.timeline__patch:hover {
  color: var(--gold);
}

.timeline__item--buff .entity__mark {
  color: var(--buff);
}

.timeline__item--nerf .entity__mark {
  color: var(--nerf);
}

.timeline__where {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------------------------------------------------------- entity index */

.entity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px 16px;
}

.entity-list__link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 10px;
  text-decoration: none;
  border-radius: 4px;
}

.entity-list__link:hover {
  background: var(--surface);
}

.entity-list__name {
  font-size: 15px;
  color: var(--text);
}

.entity-list__counts {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
}
