:root {
  --ink: #000000;
  --paper: #f3f5f7;
  --white: #ffffff;
  --navy: #001d3c;
  --blue: #003369;
  --impact-blue: #0074ee;
  --red: #d50a0a;
  --border: #cbd2d9;
  --line: 3px solid var(--navy);
  --shadow: 0 8px 0 rgba(0, 29, 60, 0.16);
  color: var(--ink);
  background: var(--paper);
  font-family: "Barlow", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  min-height: 48px;
}

button,
summary,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

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

h1,
h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 30px;
  font-size: clamp(3.3rem, 8vw, 6.7rem);
}

h2 {
  margin-bottom: 28px;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
}

h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 70px;
  border-bottom: 5px solid var(--red);
  background: var(--navy);
  color: var(--white);
}

.site-name {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-header nav {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: stretch;
  align-self: stretch;
}

.vote-deadline {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  margin: 0;
  padding: 0 18px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-transform: uppercase;
}

.site-header nav a {
  display: flex;
  align-items: center;
  padding: 0 17px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  background: var(--red);
}

@media (max-width: 1100px) {
  .site-header nav {
    display: none;
  }
}

main {
  overflow: hidden;
}

.ideas-home {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  min-height: calc(100svh - 70px);
  border-bottom: var(--line);
  background: var(--navy);
}

.submission-panel,
.shared-panel {
  padding: clamp(30px, 5vw, 72px);
}

.shared-panel h2 {
  max-width: 100%;
}

.submission-panel {
  border-top: 8px solid var(--red);
  border-right: 8px solid var(--navy);
  background: var(--white);
}

.shared-panel {
  border-top: 8px solid var(--blue);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(90deg, rgba(0, 29, 60, 0.045) 0 1px, transparent 1px 72px);
}

form,
.shared-panel {
  min-width: 0;
}

label {
  display: block;
  margin: 0 0 8px;
  color: var(--navy);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

select,
textarea {
  width: 100%;
  margin: 0 0 22px;
  border: 2px solid var(--navy);
  border-radius: 0;
  background: var(--white);
}

select {
  padding: 0 42px 0 14px;
}

textarea {
  min-height: 132px;
  padding: 14px;
  line-height: 1.45;
  resize: vertical;
}

select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 4px solid var(--impact-blue);
  outline-offset: 2px;
}

.button {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 3px solid var(--navy);
  border-radius: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.button-primary {
  border-top-color: var(--red);
  background: var(--blue);
  color: var(--white);
}

.button-primary:hover {
  background: var(--impact-blue);
  color: var(--white);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.idea-list {
  display: grid;
  gap: 18px;
}

.idea-card {
  border: 2px solid var(--navy);
  border-top: 5px solid var(--red);
  background: var(--white);
  box-shadow: 0 5px 0 rgba(0, 29, 60, 0.16);
}

.idea-copy {
  padding: 20px;
  border-bottom: 2px solid var(--navy);
}

.idea-copy p {
  margin-bottom: 12px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.idea-copy small {
  font-size: 0.9rem;
  font-weight: 600;
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.vote-actions button {
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: var(--impact-blue);
  color: var(--white);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.vote-actions button + button {
  border-left: 2px solid var(--navy);
}

.vote-actions button:hover {
  background: var(--blue);
}

.vote-actions button[data-decision="decline"],
.vote-actions button[data-decision="decline"]:hover {
  background: var(--red);
  color: var(--white);
}

.vote-actions button[data-decision="decline"]:hover {
  background: #a60808;
}

.vote-record {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--navy);
  background: #e8edf2;
}

.vote-record p {
  min-width: 0;
  margin: 0;
  padding: 13px 15px;
  font-size: 0.83rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.vote-record p + p {
  border-left: 2px solid var(--navy);
}

.empty-state {
  margin: 0;
  padding: 22px 0;
  border-top: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
}

.page-section {
  padding: clamp(54px, 8vw, 110px) clamp(18px, 6vw, 90px);
  border-bottom: var(--line);
  background: var(--white);
}

.page-section > h2,
.section-title h2 {
  padding-left: 18px;
  border-left: 8px solid var(--red);
}

#schedule {
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  color: var(--white);
}

#tracker,
#rules {
  background: var(--paper);
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.text-button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid var(--navy);
  border-radius: 0;
  background: var(--white);
  color: var(--navy);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.text-button:hover {
  background: var(--impact-blue);
  color: var(--white);
}

.current-week {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  border: var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.current-week > div {
  padding: clamp(22px, 4vw, 42px);
}

.current-week > div + div {
  border-left: var(--line);
}

.current-week h3 {
  margin-bottom: 24px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 0.95;
  text-transform: uppercase;
}

.punishment-block {
  background: var(--red);
  color: var(--white);
}

.punishment-block p {
  font-size: 1.05rem;
  line-height: 1.55;
}

#current-assignee {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 2px solid currentColor;
  font-weight: 700;
}

#current-assignee:empty {
  display: none;
}

.fact-list {
  margin: 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--navy);
}

.fact-list dt {
  color: var(--blue);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.fact-list dd {
  margin: 0;
  line-height: 1.45;
}

.week-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.week-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  min-width: 0;
  border: 2px solid var(--white);
  border-top: 5px solid var(--red);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
}

.week-number {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid var(--navy);
  background: var(--blue);
  color: var(--white);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2.3rem;
  font-weight: 800;
}

.week-body {
  min-width: 0;
  padding: 18px;
}

.week-body h3 {
  margin-bottom: 7px;
  font-size: 1.1rem;
}

.week-body p {
  margin-bottom: 14px;
  color: #44505c;
  font-size: 0.9rem;
  line-height: 1.4;
}

.week-body strong {
  display: block;
  margin-bottom: 14px;
}

.week-body button {
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--navy);
  border-radius: 0;
  background: var(--navy);
  color: var(--white);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.week-body button:hover {
  background: var(--impact-blue);
}

.tracker-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid var(--navy);
  background: var(--white);
}

.tracker-table th,
.tracker-table td {
  padding: 15px;
  border: 1px solid var(--navy);
  text-align: left;
}

.tracker-table th {
  background: var(--navy);
  color: var(--white);
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.lineup-art {
  margin: 0 0 30px;
  border: var(--line);
  border-top: 7px solid var(--red);
  background: var(--navy);
  box-shadow: var(--shadow);
}

.lineup-art img {
  display: block;
  width: 100%;
  height: auto;
}

.member-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--navy);
  border-left: 2px solid var(--navy);
  list-style: none;
}

.member-list li {
  min-width: 0;
  padding: 15px;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  background: var(--white);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.rules-list {
  border-top: 2px solid var(--navy);
}

.rules-list details {
  border-bottom: 2px solid var(--navy);
}

.rules-list summary {
  padding: 18px 52px 18px 0;
  color: var(--navy);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rules-list p {
  max-width: 850px;
  padding-bottom: 18px;
  line-height: 1.55;
}

.sources {
  margin-top: 42px;
}

.sources h3 {
  margin-bottom: 12px;
}

.sources a {
  display: block;
  width: fit-content;
  margin: 8px 0;
}

footer {
  padding: 24px;
  border-top: 5px solid var(--red);
  background: var(--navy);
  color: var(--white);
  text-align: center;
}

dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: var(--line);
  border-radius: 0;
  border-top: 7px solid var(--red);
  background: var(--white);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 29, 60, 0.78);
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--line);
}

.dialog-heading h2 {
  margin: 0;
  padding: 18px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.dialog-heading button {
  width: 58px;
  border: 0;
  border-left: var(--line);
  border-radius: 0;
  background: var(--white);
  font-size: 1.8rem;
}

#week-form,
#vote-form {
  padding: 24px;
}

.vote-idea-title {
  margin-bottom: 22px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
}

.button-decline {
  background: var(--red);
}

.toast {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 14px 18px;
  border: 2px solid var(--white);
  background: var(--navy);
  color: var(--white);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: var(--red);
}

.noscript {
  margin: 0;
  padding: 16px;
  border-top: var(--line);
  background: var(--red);
  color: var(--white);
  text-align: center;
}

@media (max-width: 800px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
  }

  .site-name {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
  }

  .site-header nav {
    display: none;
  }

  .vote-deadline {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    padding: 8px 14px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    text-align: center;
  }

  .ideas-home {
    display: block;
    min-height: 0;
  }

  .submission-panel,
  .shared-panel {
    padding: 30px 18px 38px;
  }

  .submission-panel {
    border-right: 0;
    border-bottom: var(--line);
  }

  h1 {
    margin-bottom: 22px;
    font-size: clamp(3rem, 15vw, 3.6rem);
  }

  h2 {
    margin-bottom: 22px;
    font-size: clamp(2.7rem, 14vw, 3.2rem);
  }

  .current-week {
    display: block;
  }

  .current-week > div + div {
    border-top: var(--line);
    border-left: 0;
  }

  .week-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .section-title {
    display: block;
  }

  .section-title .text-button {
    width: 100%;
    margin: -8px 0 20px;
  }

  .fact-list div {
    display: block;
  }

  .fact-list dt {
    margin-bottom: 6px;
  }

  .tracker-table,
  .tracker-table tbody,
  .tracker-table tr,
  .tracker-table th,
  .tracker-table td {
    display: block;
  }

  .tracker-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .tracker-table tr {
    border-bottom: 2px solid var(--navy);
  }

  .tracker-table tr:last-child {
    border-bottom: 0;
  }

  .tracker-table td {
    border: 0;
  }

  .tracker-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .toast {
    transition: none;
  }
}
