/* Security research tier list. Loaded on that page only. Everything here is the site's own vocabulary from
   site.css: square corners, hairlines, slate ink, and the pulse map's single cyan scale for the five tiers. */

/* One place that says which shade a tier is; rows, tiles, chips and bars all read --tier from it. */
.tier-S, .in-S, .mine-S, .chip-S { --tier: var(--trend-p2); --on-tier: var(--trend-ink-p2); }
.tier-A, .in-A, .mine-A, .chip-A { --tier: var(--trend-p1); --on-tier: var(--ink); }
.tier-B, .in-B, .mine-B, .chip-B { --tier: var(--trend-0); --on-tier: var(--ink); }
.tier-C, .in-C, .mine-C, .chip-C { --tier: var(--trend-m1); --on-tier: var(--ink); }
.tier-D, .in-D, .mine-D, .chip-D { --tier: var(--trend-m2); --on-tier: var(--ink); }

/* Header */
.tier-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px 40px;
  padding: 44px 0 30px;
  border-top: 1px solid var(--rule);
}

.tier-head > div:first-child {
  min-width: 0;
  flex: 1 1 320px;
}

.tier-head h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.tier-head h1 span {
  color: var(--brand);
}

/* Whose work is on the list: their logos, running past as a slow ticker that stops under the pointer. */
.tier-finders {
  max-width: min(640px, 100%);
  margin: 22px 0 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.tier-finders-track {
  display: flex;
  width: max-content;
  animation: tier-ticker 70s linear infinite;
}

.tier-finders:hover .tier-finders-track {
  animation-play-state: paused;
}

/* Every logo carries its own gap, so half the track is exactly one full pass and the loop is seamless. */
.tier-finders img {
  width: 28px;
  height: 28px;
  flex: none;
  margin-right: 12px;
  background: var(--logo-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  object-fit: contain;
}

@keyframes tier-ticker {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .tier-finders-track {
    animation: none;
  }
}

.tier-session {
  display: grid;
  gap: 8px;
  justify-items: end;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.tier-session p {
  margin: 0;
}

.tier-session strong {
  color: var(--ink);
  font-weight: 500;
}

/* The one thing a visitor is asked to do: the brand cyan, larger than anything else that can be clicked. */
.tier-signin {
  display: inline-block;
  padding: 14px 22px;
  background: var(--link);
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.tier-signin:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Several providers: one button each, with the provider's own mark, behind a single label. */
.tier-signin-set {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.tier-signin-label {
  margin-right: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.tier-signin-set .tier-signin {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  font-size: 14px;
}

.tier-signin img {
  width: 18px;
  height: 18px;
  background: var(--logo-bg);
  object-fit: contain;
}

.tier-callout.is-asking {
  animation: tile-bump 1.4s ease-out;
}

/* For visitors who are not signed in, the same call stays in reach at the bottom of the window. */
.tier-callout {
  position: fixed;
  z-index: 55;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
  padding: 12px 16px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
  font-size: 14px;
}

.tier-callout strong {
  font-weight: 600;
}

.tier-callout .tier-signin {
  padding: 11px 18px;
  font-size: 14px;
}

/* Room for that bar, so it never covers the end of the page. */
body:has(.tier-callout) .site-footer {
  padding-bottom: 72px;
}

.tier-plain {
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft);
  font-size: 11px;
  cursor: pointer;
}

.tier-plain:hover {
  color: var(--link);
}

/* The board: five bands in the pulse map's cyan steps, strongest at the top. */
.tier-board {
  padding: 18px 0 30px;
  border-top: 1px solid var(--rule);
}

.tier-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 18px 0 10px;
  color: var(--quiet);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.tier-caption a {
  color: var(--link);
}

.tier-saved {
  color: var(--link);
  font-weight: 500;
}

.tier-rows {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.tier-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.tier-label {
  display: flex;
  min-height: 64px;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 9px;
  background: var(--tier);
  color: var(--on-tier);
}

.tier-label b {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.tier-label span {
  font-size: 10px;
  line-height: 1.15;
}

.tier-label .tier-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.tier-row-pool .tier-label {
  background: none;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--quiet);
}

.tier-row.is-drop {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.tier-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: 2px;
  align-content: start;
}

.tier-empty {
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  padding-left: 10px;
  color: var(--quiet);
  font-size: 11px;
}

/* A tile: product logo, then what it hit, its name and who found it. Filled with its tier's shade. */
.tier-tile {
  position: relative;
  display: grid;
  min-height: 64px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--tier, var(--paper));
  color: var(--on-tier, var(--ink));
}

.tier-row-pool .tier-tile {
  box-shadow: inset 0 0 0 1px var(--line);
}

.tier-tile:hover,
.tier-tile:focus-visible,
.tier-tile.is-focus,
.tier-tile.is-picked {
  z-index: 2;
  color: var(--on-tier, var(--ink));
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.tier-tile[draggable="true"] {
  cursor: grab;
}

.tier-tile.is-moved {
  animation: tile-bump 1.4s ease-out;
}

.tile-logo {
  width: 30px;
  height: 30px;
  background: var(--logo-bg);
  object-fit: contain;
}

.tile-logo-none {
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px var(--line);
  color: #667080;
  font-family: var(--mono);
  font-size: 13px;
}

.tile-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.tier-tile .tile-cve {
  overflow: hidden;
  padding-right: 20px;
  font-family: var(--sans);
  font-size: 10px;
  text-overflow: ellipsis;
}

.tier-tile .tile-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-by {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-by img {
  width: 14px;
  height: 14px;
  margin-right: 5px;
  background: var(--logo-bg);
  object-fit: contain;
  vertical-align: -3px;
}

.tile-by img + img {
  margin-left: -2px;
}

/* The top tiers read larger, like the big tiles of the pulse map. */
.tier-S .tier-label,
.tier-S .tier-tile {
  min-height: 88px;
}

.tier-S .tier-label b {
  font-size: 44px;
}

.tier-S .tier-items {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.tier-S .tier-tile {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
}

.tier-S .tile-logo {
  width: 40px;
  height: 40px;
}

.tier-S .tile-title {
  font-size: 18px;
  letter-spacing: -0.025em;
}

.tier-S .tile-cve,
.tier-S .tile-by {
  font-size: 11px;
}

.tier-A .tier-label,
.tier-A .tier-tile {
  min-height: 74px;
}

.tier-A .tier-label b {
  font-size: 36px;
}

.tier-A .tier-items {
  grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
}

.tier-A .tile-title {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.tier-A .tile-logo {
  width: 34px;
  height: 34px;
}

.tier-A .tier-tile {
  grid-template-columns: 34px minmax(0, 1fr);
}

/* Exploited in the wild: the site's coral, as a dot. */
.tile-hot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--paper);
  vertical-align: 1px;
}

/* How many votes stand behind the tile's place. */
.tile-votes {
  position: absolute;
  right: 8px;
  bottom: 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.tier-tile:has(.tile-votes) .tile-by {
  padding-right: 58px;
}

.tier-S .tile-votes {
  font-size: 11px;
}

/* What you voted on yourself stands out: an ink frame and a "you S" tag on the tile, an ink bar on the row. */
.tier-tile.is-mine {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.tile-mine {
  position: absolute;
  top: 0;
  right: 0;
  padding: 1px 5px 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 13px;
  white-space: nowrap;
}

.tier-tile:has(.tile-mine) .tile-cve {
  padding-right: 44px;
}

/* Click a tile, then a tier: the way to vote without dragging. */
.tier-picker {
  position: fixed;
  z-index: 60;
  bottom: 20px;
  left: 50%;
  display: flex;
  max-width: calc(100vw - 32px);
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  padding: 12px 16px;
  translate: -50% 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
}

.tier-picker-name span {
  color: var(--quiet);
}

.tier-picker-name strong {
  font-weight: 600;
}

/* Tier buttons, on the picker and in the list. */
.tier-vote {
  display: flex;
}

.tier-vote button {
  position: relative;
  width: 32px;
  height: 30px;
  margin-left: -1px;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

.tier-vote button:first-of-type {
  margin-left: 0;
}

.tier-vote button:hover:not(:disabled),
.tier-vote button:focus-visible {
  z-index: 1;
  border-color: var(--ink);
  color: var(--ink);
}

.tier-vote button[aria-pressed="true"],
.tier-vote button[aria-pressed="true"]:hover:not(:disabled),
.tier-vote button[aria-pressed="true"]:focus-visible {
  z-index: 1;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.tier-vote button:disabled {
  color: var(--mark);
  cursor: default;
}

.tier-vote.is-saving {
  opacity: 0.6;
}

.tier-picker .tier-vote button {
  width: 38px;
  height: 34px;
  font-size: 13px;
}

/* The list: every entry as one row, with its vote on the right. */
.tier-ballot .index-controls {
  gap: 12px 24px;
}

.tier-status {
  flex: none;
  margin: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tier-filters {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 6px;
  padding: 10px 0;
}

.disclosure {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 160px;
  gap: 16px;
  align-items: start;
  margin-left: -15px;
  padding: 20px 0 20px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  outline: none;
  scroll-margin-top: 68px;
}

.disclosure.is-mine {
  border-left-color: var(--ink);
}

.disclosure-body {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.disclosure-body p {
  margin: 0;
}

.disclosure h3 {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.disclosure h3 img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: var(--logo-bg);
  object-fit: contain;
}

.disclosure h3 a {
  color: inherit;
}

.disclosure h3 a:hover,
.disclosure:target h3,
.disclosure.is-active h3 {
  color: var(--link);
}

.disclosure-by {
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.5;
}

.disclosure-by img {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  background: var(--logo-bg);
  object-fit: contain;
  vertical-align: -3px;
}

.disclosure-by strong {
  color: var(--ink);
  font-weight: 500;
}

.disclosure-share {
  display: flex;
  gap: 16px;
  font-size: 11px;
}

.disclosure-share a {
  color: var(--soft);
}

.disclosure-share a:hover {
  color: var(--link);
}

.disclosure-summary {
  max-width: 700px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.disclosure .entry-facts .fact-value {
  font-family: var(--sans);
}

.disclosure-vote {
  display: grid;
  gap: 7px;
  justify-items: end;
  padding-top: 2px;
}

.tier-standing {
  margin: 0;
  color: var(--quiet);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.tier-standing b {
  display: inline-block;
  min-width: 16px;
  padding: 0 3px;
  background: var(--tier);
  color: var(--on-tier);
  font-family: var(--mono);
  font-weight: 500;
  line-height: 15px;
  text-align: center;
}

.tier-spread {
  display: block;
  width: 156px;
  height: 4px;
}

.tier-spread .in-S { fill: var(--trend-p2); }
.tier-spread .in-A { fill: var(--trend-p1); }
.tier-spread .in-B { fill: var(--trend-0); }
.tier-spread .in-C { fill: var(--trend-m1); }
.tier-spread .in-D { fill: var(--trend-m2); }
.tier-spread .spread-none { fill: var(--line); }

/* What just happened (saved, limit reached), shown at the top of the window for a few seconds. */
.tier-toast {
  position: fixed;
  z-index: 70;
  top: 12px;
  left: 50%;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 9px 14px;
  translate: -50% 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  text-align: center;
}

.tier-method {
  margin: 0;
  padding: 22px 0 0;
  color: var(--quiet);
  font-size: 11px;
}

.tier-method a {
  color: var(--link);
}

/* Phones. The board becomes five strips that scroll sideways, so all of it fits on one screen; voting is tap a
   tile, then a tier; in the list the tier buttons span the row. */
@media (max-width: 760px) {
  .tier-head {
    gap: 16px;
    padding: 26px 0 20px;
  }

  .tier-head h1 {
    font-size: clamp(30px, 9.6vw, 40px);
  }

  .tier-finders {
    margin-top: 16px;
  }

  .tier-session {
    width: 100%;
    justify-items: stretch;
    text-align: left;
  }

  .tier-session .tier-signin {
    text-align: center;
  }

  .tier-board {
    padding: 14px 0 22px;
  }

  .tier-caption {
    margin: 12px 0 8px;
  }

  .tier-row {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 6px 0;
  }

  .tier-label,
  .tier-S .tier-label,
  .tier-A .tier-label {
    min-height: 60px;
    align-items: center;
    justify-content: center;
    padding: 6px;
  }

  .tier-label b,
  .tier-S .tier-label b,
  .tier-A .tier-label b {
    font-size: 22px;
  }

  .tier-label span {
    display: none;
  }

  .tier-items,
  .tier-S .tier-items,
  .tier-A .tier-items {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .tier-items::-webkit-scrollbar {
    display: none;
  }

  .tier-tile,
  .tier-S .tier-tile,
  .tier-A .tier-tile {
    min-height: 60px;
    flex: 0 0 172px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 9px;
    scroll-snap-align: start;
  }

  .tier-S .tier-tile {
    flex-basis: 204px;
  }

  .tile-logo,
  .tier-S .tile-logo,
  .tier-A .tile-logo {
    width: 28px;
    height: 28px;
  }

  .tier-tile .tile-title,
  .tier-A .tile-title {
    font-size: 13px;
  }

  .tier-S .tile-title {
    font-size: 15px;
  }

  .tier-S .tile-cve,
  .tier-S .tile-by {
    font-size: 10px;
  }

  .tier-empty {
    padding: 0 8px;
  }

  /* The picker and the sign-in bar sit on the bottom edge, full width, with buttons a thumb can hit. */
  .tier-picker {
    right: 0;
    bottom: 0;
    left: 0;
    max-width: none;
    justify-content: space-between;
    gap: 10px 14px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    translate: none;
    border-width: 1px 0 0;
  }

  .tier-picker-name {
    overflow: hidden;
    flex: 1 0 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tier-picker .tier-vote {
    flex: 1 0 100%;
  }

  .tier-picker .tier-vote button {
    width: auto;
    height: 46px;
    flex: 1;
    font-size: 15px;
  }

  .tier-picker .tier-plain {
    padding: 6px 0;
    font-size: 13px;
  }

  .tier-callout {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }

  .tier-callout .tier-signin {
    flex: 1 1 100%;
    padding: 13px 16px;
    font-size: 15px;
    text-align: center;
  }

  .tier-signin-set {
    width: 100%;
    justify-content: flex-start;
  }

  .tier-signin-label {
    flex: 1 0 100%;
    margin: 0 0 2px;
  }

  .tier-signin-set .tier-signin,
  .tier-callout .tier-signin-set .tier-signin {
    flex: 1 1 0;
    justify-content: center;
    padding: 12px 8px;
    font-size: 14px;
  }

  .tier-callout .tier-signin-label {
    display: none;
  }

  /* The list: one sticky line of filters, then entries at full width with their vote underneath. */
  .tier-ballot .index-controls {
    display: block;
    min-height: 0;
  }

  .tier-status {
    display: none;
  }

  .tier-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
    padding: 15px 0;
    font-size: 13px;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .tier-filters::-webkit-scrollbar {
    display: none;
  }

  .disclosure {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 18px 0 18px 12px;
    scroll-margin-top: 60px;
  }

  .disclosure .entry-rank {
    display: none;
  }

  .disclosure h3 {
    font-size: 18px;
  }

  .disclosure-vote {
    justify-items: stretch;
    gap: 8px;
    padding-top: 0;
  }

  .disclosure .tier-vote button {
    width: auto;
    height: 44px;
    flex: 1;
    font-size: 14px;
  }

  .tier-standing {
    font-size: 11px;
  }

  .tier-spread {
    width: 100%;
  }

  .disclosure-share {
    gap: 22px;
    font-size: 12px;
  }
}
