:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --ink: #171819;
  --muted: #66625b;
  --paper: #fffaf0;
  --line: #d8cdbb;
  --teal: #12646a;
  --red: #cc4b37;
  --mustard: #d9a528;
  --shadow: 0 22px 60px rgba(33, 31, 28, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(217, 165, 40, 0.18), transparent 36rem),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 56%, #ece3d4 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: rgba(246, 241, 232, 0.9);
  border-bottom: 1px solid rgba(23, 24, 25, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 2.3rem;
  aspect-ratio: 1;
  place-items: center;
  background: var(--ink);
  border: 2px solid var(--mustard);
  color: #fffaf0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  background: rgba(255, 250, 240, 0.8);
  border: 1px solid var(--line);
}

.tab,
.button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.tab {
  min-height: 2.35rem;
  padding: 0 0.9rem;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab:hover,
.tab:focus-visible,
.tab.is-active {
  background: var(--ink);
  color: #fffaf0;
  outline: none;
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.view {
  display: none;
  padding: clamp(1.4rem, 4vw, 3rem) 0 3rem;
}

.view.is-visible {
  display: block;
}

.hero {
  position: relative;
  min-height: clamp(470px, 72vh, 690px);
  overflow: hidden;
  background: #201d19;
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(11, 12, 12, 0.85) 0%, rgba(11, 12, 12, 0.62) 38%, rgba(11, 12, 12, 0.1) 100%),
    linear-gradient(0deg, rgba(11, 12, 12, 0.38), transparent 36%);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: inherit;
  width: min(620px, 100%);
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 7vw, 5.5rem);
  color: #fffaf0;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: #f1c24c;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  letter-spacing: 0;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3.4rem, 8vw, 6.7rem);
  line-height: 0.86;
}

h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.95;
}

h3 {
  font-size: clamp(1.5rem, 4vw, 3.15rem);
  line-height: 1.08;
}

.hero-copy p:not(.eyebrow) {
  max-width: 34rem;
  margin: 1.35rem 0 0;
  color: rgba(255, 250, 240, 0.86);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  min-height: 3rem;
  padding: 0 1.1rem;
  border: 2px solid transparent;
  font-weight: 800;
}

.button-primary {
  background: var(--red);
  color: #fffaf0;
}

.button-secondary {
  background: #fffaf0;
  border-color: var(--ink);
  color: var(--ink);
}

.button:hover,
.button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
  outline: 3px solid rgba(18, 100, 106, 0.24);
}

.button:disabled,
.icon-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 1rem 0 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.snapshot div {
  min-height: 8rem;
  padding: 1.2rem;
  background: rgba(255, 250, 240, 0.82);
}

.stat-number,
.stat-label {
  display: block;
}

.stat-number {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.voting-panel {
  padding: clamp(1rem, 3vw, 1.8rem);
  background:
    linear-gradient(135deg, rgba(18, 100, 106, 0.12), transparent 42%),
    var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.meter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-weight: 800;
}

#rating-value {
  display: inline-grid;
  min-width: 3.2rem;
  aspect-ratio: 1;
  place-items: center;
  background: var(--teal);
  color: #fffaf0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.5rem;
}

.rating-slider {
  --thumb-size: 4.25rem;
  --track-height: 0.85rem;
  --rating-fill: 44.44%;
  appearance: none;
  width: 100%;
  height: var(--thumb-size);
  margin: 0.8rem 0 1.05rem;
  background: transparent;
  cursor: pointer;
}

.rating-slider:focus {
  outline: none;
}

.rating-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 0.28rem rgba(222, 74, 50, 0.28), 0 0.55rem 1.2rem rgba(45, 34, 28, 0.24);
}

.rating-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 0.28rem rgba(222, 74, 50, 0.28), 0 0.55rem 1.2rem rgba(45, 34, 28, 0.24);
}

.rating-slider::-webkit-slider-runnable-track {
  height: var(--track-height);
  background:
    linear-gradient(
      90deg,
      var(--red) 0%,
      var(--red) var(--rating-fill),
      #f0dfbd var(--rating-fill),
      #f0dfbd 100%
    );
  border: 1px solid rgba(45, 34, 28, 0.18);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.rating-slider::-webkit-slider-thumb {
  appearance: none;
  width: var(--thumb-size);
  height: var(--thumb-size);
  margin-top: calc((var(--track-height) - var(--thumb-size)) / 2);
  border: 0;
  border-radius: 50%;
  background: url("assets/bald-head-slider.png") center / cover no-repeat;
  box-shadow: 0 0.55rem 1.2rem rgba(45, 34, 28, 0.24);
}

.rating-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.04);
}

.rating-slider::-moz-range-track {
  height: var(--track-height);
  background: #f0dfbd;
  border: 1px solid rgba(45, 34, 28, 0.18);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.rating-slider::-moz-range-progress {
  height: var(--track-height);
  background: var(--red);
  border-radius: 999px;
}

.rating-slider::-moz-range-thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  border: 0;
  border-radius: 50%;
  background: url("assets/bald-head-slider.png") center / cover no-repeat;
  box-shadow: 0 0.55rem 1.2rem rgba(45, 34, 28, 0.24);
}

.rating-slider:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.04);
}

.incident-card {
  min-height: 18rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: clamp(1.2rem, 4vw, 3rem);
  background: #fffaf0;
  border: 1px solid var(--line);
}

.progress-text {
  margin: 0;
  color: var(--teal);
  font-weight: 800;
}

.sync-status {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.vote-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.icon-button {
  display: inline-grid;
  width: 3rem;
  aspect-ratio: 1;
  place-items: center;
  background: var(--ink);
  color: #fffaf0;
  font-size: 1.35rem;
  font-weight: 800;
}

.rank-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-field {
  display: grid;
  gap: 0.35rem;
  width: min(28rem, 100%);
  color: var(--muted);
  font-weight: 800;
}

.search-field input {
  min-height: 3rem;
  width: 100%;
  padding: 0 0.9rem;
  background: #fffaf0;
  border: 1px solid var(--line);
  color: var(--ink);
}

.ranking-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-item {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  min-height: 5.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

.rank-score {
  display: grid;
  place-items: center;
  gap: 0.1rem;
  background: var(--ink);
  color: #fffaf0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.rank-score small {
  color: rgba(255, 250, 240, 0.72);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rank-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 1rem 1rem 1rem 0;
  line-height: 1.45;
}

.empty-state {
  padding: 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .site-header,
  .rank-toolbar,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab {
    padding-inline: 0.35rem;
  }

  .hero {
    min-height: 560px;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(11, 12, 12, 0.78), rgba(11, 12, 12, 0.42));
  }

  .hero-copy {
    justify-content: end;
    padding: 1.3rem;
  }

  .snapshot {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .ranking-item {
    grid-template-columns: 3.8rem minmax(0, 1fr);
  }
}
