:root {
  --ink: #171821;
  --paper: #fff8e8;
  --cream: #fff3cf;
  --red: #e63d2e;
  --deep-red: #8f1738;
  --blue: #193b70;
  --sky: #93d8ff;
  --teal: #117b72;
  --yellow: #ffd34d;
  --green: #4d9f55;
  --shadow: 0 20px 60px rgba(23, 24, 33, 0.18);
  --border: 3px solid var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Arial Black", "Arial", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 211, 77, 0.38), transparent 26rem),
    radial-gradient(circle at 84% 12%, rgba(147, 216, 255, 0.5), transparent 24rem),
    linear-gradient(135deg, #fff8e8 0%, #f7e2b5 52%, #b9e4e0 100%);
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.24;
  background-image:
    linear-gradient(45deg, rgba(23, 24, 33, 0.09) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 24, 33, 0.08) 25%, transparent 25%);
  background-size: 42px 42px;
}

button,
a {
  font: inherit;
}

.ticker {
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: hidden;
  color: var(--paper);
  background: var(--ink);
  border-bottom: 3px solid var(--yellow);
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: crawl 24s linear infinite;
}

.ticker span {
  padding: 0.75rem 1.6rem;
  white-space: nowrap;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(22rem, 1.1fr);
  gap: 2rem;
  align-items: center;
  min-height: 86vh;
  padding: 3rem max(1rem, calc((100vw - 1180px) / 2)) 2rem;
}

.hero__copy {
  display: grid;
  gap: 1.25rem;
}

.eyebrow {
  margin: 0;
  color: var(--deep-red);
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  max-width: 10ch;
  font-size: 5.8rem;
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0.09em 0.09em 0 var(--yellow);
}

h2 {
  margin-bottom: 0.55rem;
  font-size: 2.1rem;
  line-height: 1.04;
}

.lede {
  max-width: 44rem;
  font-family: Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.15rem;
  padding: 0.78rem 1.05rem;
  color: var(--ink);
  text-decoration: none;
  border: var(--border);
  border-radius: 8px;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.route-card:hover,
.checklist button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.button:active,
.route-card:active,
.checklist button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button--primary {
  background: var(--yellow);
}

.button--secondary {
  width: fit-content;
  background: var(--sky);
}

.button--trap {
  background: #ffffff;
  animation: trapPulse 1.3s infinite steps(2, jump-none);
}

.evacuation-board {
  position: relative;
  min-height: 31rem;
  padding: 1rem;
}

.texas-map {
  width: 100%;
  min-height: 29rem;
  overflow: visible;
}

.state-shape {
  transform-origin: center;
  animation: texasJiggle 1.6s ease-in-out infinite;
  stroke: var(--ink);
  stroke-width: 7;
}

.route {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 16 15;
}

.route--escape {
  stroke: #24a35a;
  animation: routeDash 1s linear infinite;
}

.route--home {
  stroke: var(--red);
  animation: blockedDash 0.6s linear infinite;
}

.route-label rect {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 4;
}

.route-label text {
  font-size: 18px;
  text-anchor: middle;
  font-weight: 900;
  fill: var(--ink);
}

.escape-car {
  fill: var(--blue);
  stroke: var(--ink);
  stroke-width: 4;
  offset-path: path("M302 253 C242 205 202 172 164 129 C125 86 94 65 42 48");
  animation: driveAway 4.2s ease-in-out infinite;
}

.blocked-home line {
  stroke: var(--ink);
  stroke-width: 14;
  stroke-linecap: round;
  animation: slamX 0.75s infinite;
}

.map-warning {
  font-size: 28px;
  font-weight: 900;
  text-anchor: middle;
  fill: #fff9dc;
  stroke: var(--ink);
  stroke-width: 1;
  animation: warningFlash 0.9s infinite;
}

.map-small {
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 900;
  text-anchor: middle;
  fill: var(--ink);
}

.sign {
  position: absolute;
  z-index: 2;
  width: 9.5rem;
  padding: 0.55rem 0.7rem;
  text-align: center;
  background: var(--yellow);
  border: var(--border);
  border-radius: 8px;
  box-shadow: 6px 6px 0 var(--ink);
  animation: signSwing 1.8s ease-in-out infinite alternate;
}

.sign--left {
  left: 1rem;
  top: 2rem;
}

.sign--right {
  right: 0.8rem;
  bottom: 3rem;
  background: #ffffff;
  animation-delay: -0.7s;
}

main {
  display: grid;
  gap: 1.5rem;
  padding: 0 max(1rem, calc((100vw - 1180px) / 2)) 4rem;
}

.notice,
.dashboard,
.destinations,
.briefing {
  border: var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.notice {
  position: relative;
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem;
  background: #ffffff;
  overflow: hidden;
}

.notice p:not(.eyebrow) {
  margin-bottom: 0;
  font-family: Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
}

.stamp {
  display: grid;
  place-items: center;
  min-height: 8rem;
  color: var(--red);
  text-align: center;
  border: 6px double var(--red);
  border-radius: 8px;
  transform: rotate(-8deg);
  animation: stampSlam 2.6s ease-in-out infinite;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  background: var(--paper);
}

.meter-panel,
.checklist-panel {
  padding: 1.4rem;
}

.meter-panel {
  border-right: var(--border);
}

.panel-heading {
  margin-bottom: 1rem;
}

.meter {
  height: 4rem;
  overflow: hidden;
  background: #ffffff;
  border: var(--border);
  border-radius: 8px;
}

.meter__fill {
  width: 72%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, var(--yellow) 0 18px, var(--red) 18px 36px),
    var(--red);
  border-right: var(--border);
  animation: meterBuzz 0.9s linear infinite;
  transition: width 260ms ease;
}

.meter__status {
  min-height: 3.3rem;
  margin: 1rem 0;
  font-family: Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
}

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

.checklist button {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.75rem 0.9rem;
  text-align: left;
  background: #ffffff;
  border: var(--border);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}

.checklist button.is-packed {
  color: #ffffff;
  background: var(--green);
}

.destinations,
.briefing {
  padding: 1.4rem;
  background: #ffffff;
}

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

.section-heading h2 {
  margin-bottom: 0;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.route-card {
  display: grid;
  gap: 0.6rem;
  min-height: 13rem;
  padding: 1rem;
  text-align: left;
  background: var(--cream);
  border: var(--border);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.route-card strong {
  font-size: 1.25rem;
  line-height: 1.05;
}

.route-card span:last-child {
  font-family: Arial, sans-serif;
  font-weight: 800;
}

.route-card__code {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: #ffffff;
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.route-card--forbidden {
  background: #ffd6d1;
  animation: forbiddenShake 1.8s infinite;
}

.verdict {
  min-height: 3.4rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  font-family: Arial, sans-serif;
  font-weight: 900;
  background: var(--sky);
  border: var(--border);
  border-radius: 8px;
}

.briefing-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.briefing-list p {
  min-height: 9rem;
  margin: 0;
  padding: 1rem;
  font-family: Arial, sans-serif;
  font-weight: 900;
  background: var(--cream);
  border: var(--border);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  max-width: min(25rem, calc(100vw - 2rem));
  padding: 1rem;
  color: #ffffff;
  background: var(--deep-red);
  border: var(--border);
  border-color: var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(140%);
  transition: transform 240ms ease;
}

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

.noscript {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 40;
  max-width: 24rem;
  padding: 1rem;
  background: var(--yellow);
  border: var(--border);
  border-radius: 8px;
}

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

@keyframes texasJiggle {
  0%,
  100% {
    transform: rotate(-1deg) scale(1);
  }
  50% {
    transform: rotate(1deg) scale(1.015);
  }
}

@keyframes routeDash {
  to {
    stroke-dashoffset: -31;
  }
}

@keyframes blockedDash {
  to {
    stroke-dashoffset: 31;
  }
}

@keyframes driveAway {
  0% {
    offset-distance: 0%;
    transform: scale(0.7);
  }
  18% {
    offset-distance: 20%;
  }
  70% {
    offset-distance: 100%;
    transform: scale(1);
  }
  100% {
    offset-distance: 100%;
    transform: scale(1);
  }
}

@keyframes slamX {
  50% {
    transform: scale(1.04);
  }
}

@keyframes warningFlash {
  50% {
    fill: var(--yellow);
  }
}

@keyframes signSwing {
  from {
    transform: rotate(-5deg);
  }
  to {
    transform: rotate(5deg);
  }
}

@keyframes stampSlam {
  0%,
  62%,
  100% {
    transform: rotate(-8deg) scale(1);
  }
  70% {
    transform: rotate(-8deg) scale(1.15);
  }
  76% {
    transform: rotate(-8deg) scale(0.96);
  }
}

@keyframes meterBuzz {
  to {
    background-position: 36px 0;
  }
}

@keyframes trapPulse {
  50% {
    background: #ffd6d1;
  }
}

@keyframes forbiddenShake {
  0%,
  88%,
  100% {
    transform: translateX(0);
  }
  91% {
    transform: translateX(-4px) rotate(-1deg);
  }
  94% {
    transform: translateX(4px) rotate(1deg);
  }
}

@media (max-width: 960px) {
  .hero,
  .dashboard,
  .notice {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 12ch;
    font-size: 4.2rem;
  }

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

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

@media (max-width: 640px) {
  .ticker span {
    padding-inline: 1rem;
    font-size: 0.78rem;
  }

  .hero {
    min-height: auto;
    padding-top: 2rem;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .lede {
    font-size: 1.05rem;
  }

  .hero__actions,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .evacuation-board {
    min-height: 22rem;
    padding: 0;
  }

  .texas-map {
    min-height: 22rem;
  }

  .sign {
    width: 7.8rem;
    font-size: 0.76rem;
  }

  .route-grid,
  .briefing-list {
    grid-template-columns: 1fr;
  }

  .route-card,
  .briefing-list p {
    min-height: auto;
  }

  .stamp {
    min-height: 6.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
