:root {
  --ink: #191a1c;
  --muted: #63676f;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #ded8cf;
  --gold: #eeb648;
  --gold-dark: #a86919;
  --teal: #2f8d97;
  --green: #4c8b5f;
  --charcoal: #23262a;
  --shadow: 0 18px 50px rgba(25, 26, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 56px);
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0));
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  display: block;
  width: clamp(164px, 18vw, 230px);
  height: auto;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
}

.nav-links a {
  padding: 8px 2px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: #fff;
}

.nav-links a.active {
  color: var(--gold);
}

.site-header.solid {
  position: sticky;
  background: rgba(35, 38, 42, 0.96);
  box-shadow: 0 10px 30px rgba(16, 17, 18, 0.18);
}

.hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(8, 8, 9, 0.28), rgba(8, 8, 9, 0.08)),
    url("assets/campaign-hero.png") center / cover no-repeat;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 90px;
  content: "";
  background: linear-gradient(0deg, var(--paper), rgba(251, 250, 247, 0));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 36px));
  margin-left: clamp(18px, 6vw, 88px);
  padding-top: 84px;
  padding-bottom: 96px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(3.1rem, 8vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2.1vw, 1.36rem);
  line-height: 1.55;
}

.hero-actions,
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  padding: 12px 18px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--gold);
  color: #211503;
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.button.neutral {
  border-color: #d8d1c6;
  color: var(--ink);
  background: #fff;
}

.button.small {
  min-height: 42px;
  margin-top: 14px;
  font-size: 0.95rem;
}

.hero-stats {
  margin-top: 42px;
}

.hero-stats div {
  min-width: 165px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.hero-stats span {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.section-band,
.qr-section {
  padding: clamp(58px, 8vw, 104px) clamp(18px, 5vw, 72px);
}

.section-band {
  background: var(--paper);
}

.section-head {
  width: min(980px, 100%);
  margin: 0 auto 30px;
}

.section-head.compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 26px 46px;
  align-items: end;
}

.section-head.compact .eyebrow,
.section-head.compact h2 {
  grid-column: 1;
}

.section-head.compact p:not(.eyebrow) {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.55;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 4vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.rules-grid {
  display: grid;
  width: min(1180px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.rule-card {
  min-height: 245px;
  padding: 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.rule-number {
  display: block;
  margin-bottom: 46px;
  color: var(--teal);
  font-weight: 900;
}

.rule-card h3 {
  margin-bottom: 10px;
  font-size: 1.28rem;
}

.rule-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.qr-section {
  background: #f1eee7;
}

.qr-section.standalone {
  padding-top: clamp(42px, 6vw, 76px);
}

.competition {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.14fr);
  gap: clamp(26px, 5vw, 72px);
  align-items: center;
  background: #f1eee7;
}

.competition-copy {
  max-width: 640px;
  justify-self: end;
}

.competition-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.competition-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #d8d1c6;
  border-left: 1px solid #d8d1c6;
  background: #fff;
  box-shadow: var(--shadow);
}

.competition-steps div {
  min-height: 190px;
  padding: 22px;
  border-right: 1px solid #d8d1c6;
  border-bottom: 1px solid #d8d1c6;
}

.competition-steps strong,
.competition-steps span {
  display: block;
}

.competition-steps strong {
  margin-bottom: 46px;
  color: var(--teal);
  font-size: 1.4rem;
  line-height: 1;
}

.competition-steps span {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.3;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(92px, 13vw, 150px) clamp(18px, 5vw, 72px) clamp(44px, 7vw, 82px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(18, 19, 21, 0.92), rgba(18, 19, 21, 0.68)),
    url("assets/campaign-hero.png") center / cover no-repeat;
}

.page-hero > div {
  width: min(860px, 100%);
}

.page-hero h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 7vw, 5.8rem);
}

.page-hero p:not(.eyebrow) {
  max-width: 670px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.03rem, 2vw, 1.25rem);
  line-height: 1.55;
}

.review-assistant {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(360px, 1.22fr);
  gap: clamp(26px, 5vw, 72px);
  align-items: start;
  background: var(--paper);
}

.review-copy {
  max-width: 620px;
  justify-self: end;
}

.review-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.review-tool {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.review-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 20px;
  border: 0;
  border-bottom: 1px solid #ece7df;
}

.review-options legend {
  grid-column: 1 / -1;
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-options label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2dcd3;
  padding: 10px 12px;
  font-weight: 800;
}

.review-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #ece7df;
}

.review-output {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.review-output span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-output textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid #d8d1c6;
  padding: 14px;
  color: var(--ink);
  background: #fbfaf7;
  font: inherit;
  line-height: 1.55;
}

.copy-status {
  min-height: 24px;
  margin: 0;
  padding: 0 20px 18px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 800;
}

.brigade-grid {
  display: grid;
  width: min(1240px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.brigade-card {
  min-width: 0;
  border: 1px solid #d8d1c6;
  background: var(--panel);
  box-shadow: 0 6px 22px rgba(24, 25, 27, 0.06);
}

.brigade-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  gap: 10px;
}

.brigade-card h3 {
  margin: 0;
  font-size: 1rem;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(47, 141, 151, 0.35);
  padding: 4px 8px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.qr-frame {
  display: grid;
  width: calc(100% - 28px);
  aspect-ratio: 1;
  margin: 0 14px 14px;
  place-items: center;
  border: 1px solid #e7e1d8;
  background: #fff;
}

.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.qr-placeholder {
  display: grid;
  width: 72%;
  aspect-ratio: 1;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, var(--charcoal) 8px, transparent 8px) 0 0 / 24px 24px,
    linear-gradient(var(--charcoal) 8px, transparent 8px) 0 0 / 24px 24px,
    linear-gradient(90deg, transparent 11px, rgba(35, 38, 42, 0.9) 11px 16px, transparent 16px) 0
      0 / 32px 32px,
    #fff;
  box-shadow: inset 0 0 0 12px #fff;
  color: var(--charcoal);
  font-weight: 900;
}

.brigade-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.brigade-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin: 0 14px 14px;
  border: 1px solid rgba(47, 141, 151, 0.35);
  color: #fff;
  background: var(--teal);
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.brigade-link:hover,
.brigade-link:focus-visible {
  background: #24747d;
  transform: translateY(-1px);
}

.results {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(420px, 1.28fr);
  gap: clamp(26px, 5vw, 72px);
  align-items: start;
}

.results-copy {
  max-width: 560px;
  justify-self: end;
}

.results-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.results-panel {
  width: min(900px, 100%);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.results-toolbar,
.ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.results-toolbar {
  padding: 18px;
  border-bottom: 1px solid #ece7df;
  background: #fbfaf7;
}

.view-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #d8d1c6;
  background: #fff;
}

.toggle-button {
  min-width: 94px;
  border: 0;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.toggle-button.is-active {
  color: #221603;
  background: var(--gold);
}

.week-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.week-picker select {
  min-height: 40px;
  border: 1px solid #d8d1c6;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #ece7df;
}

.summary-card {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid #ece7df;
}

.summary-card:last-child {
  border-right: 0;
}

.summary-card span,
.ranking-header span,
.ranking-row span {
  min-width: 0;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1;
}

.ranking-header {
  padding: 18px;
  border-bottom: 1px solid #ece7df;
}

.ranking-header div {
  min-width: 0;
}

.ranking-header strong,
.ranking-header span {
  display: block;
}

.ranking-header strong {
  margin-top: 5px;
  font-size: 1.15rem;
}

.ranking-header > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.ranking-table {
  overflow: hidden;
}

.ranking-row {
  display: grid;
  grid-template-columns: 0.62fr 1.2fr 0.72fr 0.88fr 0.88fr 0.95fr;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #ece7df;
}

.ranking-row:last-child {
  border-bottom: 0;
}

.ranking-row-head {
  color: #fff;
  background: var(--charcoal);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ranking-row:not(.ranking-row-head) {
  position: relative;
  background:
    linear-gradient(90deg, rgba(47, 141, 151, 0.12) var(--bar-width), transparent 0),
    #fff;
}

.ranking-row:not(.ranking-row-head) span:nth-child(2) {
  font-weight: 800;
}

.ranking-row:not(.ranking-row-head) span:last-child {
  color: var(--green);
  font-weight: 900;
}

.rank-badge {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #d8d1c6;
  background: #fbfaf7;
  color: var(--gold-dark);
  font-weight: 900;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 72px);
  color: rgba(255, 255, 255, 0.72);
  background: var(--charcoal);
  font-size: 0.92rem;
}

.footer a {
  color: #fff;
  text-decoration: none;
}

code {
  padding: 2px 5px;
  background: rgba(47, 141, 151, 0.12);
  color: #1d6870;
  font-size: 0.9em;
}

@media (max-width: 1080px) {
  .rules-grid,
  .brigade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results,
  .competition,
  .review-assistant,
  .section-head.compact {
    grid-template-columns: 1fr;
  }

  .section-head.compact .eyebrow,
  .section-head.compact h2,
  .section-head.compact p:not(.eyebrow) {
    grid-column: auto;
    grid-row: auto;
  }

  .results-copy {
    justify-self: start;
  }

  .competition-copy {
    justify-self: start;
  }

  .review-copy {
    justify-self: start;
  }

  .competition-steps {
    grid-template-columns: 1fr;
  }

  .competition-steps div {
    min-height: 0;
  }

  .competition-steps strong {
    margin-bottom: 24px;
  }

  .page-hero {
    display: grid;
    align-items: end;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
    padding: 16px;
  }

  .nav-links {
    display: none;
  }

  .site-header.solid {
    position: static;
  }

  .brand img {
    width: 166px;
  }

  .hero {
    min-height: 88svh;
    align-items: flex-end;
    background-position: 58% center;
  }

  .hero-content {
    width: calc(100% - 32px);
    margin: 0 16px;
    padding-top: 92px;
    padding-bottom: 72px;
  }

  h1 {
    font-size: clamp(2.75rem, 15vw, 4rem);
  }

  .hero-actions,
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-stats div {
    min-width: 0;
  }

  .rules-grid,
  .brigade-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: 74px 16px 52px;
  }

  .review-options {
    grid-template-columns: 1fr;
  }

  .review-actions {
    display: grid;
  }

  .rule-card {
    min-height: 0;
  }

  .rule-number {
    margin-bottom: 24px;
  }

  .results-panel {
    overflow: hidden;
  }

  .results-toolbar,
  .ranking-header {
    align-items: stretch;
    flex-direction: column;
  }

  .view-toggle,
  .week-picker,
  .week-picker select {
    width: 100%;
  }

  .toggle-button {
    min-width: 0;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card {
    border-bottom: 1px solid #ece7df;
  }

  .summary-card:nth-child(2n) {
    border-right: 0;
  }

  .summary-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .ranking-table {
    overflow-x: auto;
  }

  .ranking-row {
    min-width: 680px;
    grid-template-columns: 0.55fr 1.05fr 0.72fr 0.86fr 0.86fr 0.9fr;
    padding: 13px 12px;
    font-size: 0.86rem;
  }

  .footer {
    flex-direction: column;
  }
}
