:root {
  --bg: #eef2ec;
  --panel: #ffffff;
  --panel-soft: #f7f9f5;
  --ink: #1d2b26;
  --muted: #65736c;
  --line: #d8e0da;

  --green: #245f46;
  --green-dark: #173e30;

  --accent: #ef7d32;
  --accent-dark: #bf5421;
  --danger: #bd3f2d;

  --shadow: 0 18px 45px rgba(39, 59, 47, 0.1);
  --radius: 22px;

  --forest: #4f7f52;
  --grass: #a6bf62;
  --shrub: #8d9c50;
  --soil: #b99168;
  --rock: #8d9693;
  --water: #68a8c8;
  --town: #d5c8b6;

  --burning: #f2552c;
  --burned: #3d3936;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);

  background:
    radial-gradient(
      circle at top left,
      rgba(121, 161, 125, 0.18),
      transparent 32%
    ),
    linear-gradient(
      180deg,
      #f3f6f1 0%,
      var(--bg) 100%
    );

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

select:focus,
input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(239, 125, 50, 0.26);
  outline-offset: 2px;
}

/* =====================================================
   VARIABLEVISTA PLATFORM HEADER
===================================================== */

.platform-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.9rem clamp(1rem, 4vw, 4rem);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(17, 64, 72, 0.08);
  position: relative;
  z-index: 80;
}

.platform-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: max-content;
  color: var(--ink);
}

.platform-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0.85rem;
  color: white;
  background:
    linear-gradient(
      145deg,
      #147f8c,
      #0b626d
    );
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  box-shadow:
    0 7px 16px rgba(11, 98, 109, 0.2);
}

.platform-brand-text {
  display: grid;
  gap: 0.12rem;
}

.platform-brand-text strong {
  font-size: 1.08rem;
  line-height: 1;
}

.platform-brand-text span {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.2;
}

.platform-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.platform-navigation a {
  padding: 0.62rem 0.78rem;
  border-radius: 0.65rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    transform 0.15s ease;
}

.platform-navigation a:hover {
  color: #0b626d;
  background: #e8f5f6;
}

.platform-navigation .model-library-link {
  margin-left: 0.35rem;
  padding-inline: 0.95rem;
  color: white;
  background: #147f8c;
}

.platform-navigation .model-library-link:hover {
  color: white;
  background: #0b626d;
  transform: translateY(-1px);
}

.platform-header a:focus-visible,
.platform-footer a:focus-visible {
  outline: 3px solid rgba(20, 127, 140, 0.38);
  outline-offset: 3px;
}

/* =====================================================
   MODEL INTRODUCTION HEADER
===================================================== */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  margin: 0;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  color: white;

  background:
    linear-gradient(
      120deg,
      rgba(23, 62, 48, 0.98),
      rgba(36, 95, 70, 0.95)
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.15),
      transparent 20rem
    );

  border-radius: 0;
  box-shadow:
    0 10px 28px rgba(23, 62, 48, 0.14);
}

.model-introduction {
  max-width: 900px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.site-header .eyebrow {
  margin: 0;
  color: #cee8d1;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header h1,
.panel-heading h2,
.modal h2 {
  margin: 0;
}

.site-header h1 {
  margin: 0.15rem 0 0.45rem;
  color: white;
  font-size: clamp(1.85rem, 4vw, 3.1rem);
  line-height: 1.08;
}

.subtitle {
  max-width: 830px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  line-height: 1.55;
}

.model-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.model-details span {
  padding: 0.38rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 750;
  backdrop-filter: blur(5px);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: max-content;
  padding: 10px 14px;
  color: #f2f8f3;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #b9df8d;
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(185, 223, 141, 0.13);
}

.status-dot.running {
  background: #ff9c55;
  box-shadow:
    0 0 0 5px rgba(255, 156, 85, 0.15);
  animation: pulse 1.1s infinite;
}

/* =====================================================
   APPLICATION LAYOUT
===================================================== */

.app-shell {
  width: min(1600px, calc(100% - 32px));
  margin: 16px auto 28px;
}

.dashboard {
  display: grid;
  grid-template-columns:
    minmax(240px, 0.82fr)
    minmax(560px, 1.8fr)
    minmax(250px, 0.88fr);
  gap: 16px;
  align-items: start;
}

.panel,
.teacher-strip {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 224, 218, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-kicker {
  color: var(--accent-dark);
  text-transform: uppercase;
}

.panel-heading h2 {
  font-size: 1.25rem;
}

.step-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 11px;
  font-weight: 850;
}

.controls-panel,
.results-panel {
  position: sticky;
  top: 16px;
}

/* =====================================================
   ENVIRONMENT CONTROLS
===================================================== */

.control-group {
  margin-bottom: 18px;
}

.control-group label,
.label-row label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 800;
}

.label-row,
.meter-label-row,
.risk-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-row output {
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 850;
}

select {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.wind-control {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 10px;
}

.wind-compass {
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 14px;
}

.wind-arrow {
  display: inline-block;
  font-size: 1.55rem;
  transition: transform 220ms ease;
}

.helper-text {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

/* =====================================================
   METERS AND INFORMATION CARDS
===================================================== */

.risk-card,
.analysis-card,
.trial-note {
  padding: 15px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.risk-card-topline {
  font-size: 0.78rem;
}

.risk-card-topline strong {
  color: var(--accent-dark);
}

.meter-track {
  height: 10px;
  margin: 10px 0 8px;
  overflow: hidden;
  background: #e1e7e1;
  border-radius: 999px;
}

.meter-track.compact {
  height: 9px;
}

.meter-fill {
  width: 45%;
  height: 100%;
  background:
    linear-gradient(
      90deg,
      #7fb56c,
      #f2c14e,
      #e66f35,
      #b9342a
    );
  border-radius: inherit;
  transition: width 240ms ease;
}

.risk-card p,
.trial-note p,
.analysis-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* =====================================================
   MODEL PANEL AND TERRAIN TOOLS
===================================================== */

.model-panel {
  min-width: 0;
}

.toolbar-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.terrain-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.terrain-tool,
.secondary-btn,
.control-btn,
.primary-btn {
  border-radius: 11px;
  font-weight: 800;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.terrain-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fafbf9;
  border: 1px solid var(--line);
  font-size: 0.76rem;
}

.terrain-tool:hover,
.secondary-btn:hover,
.control-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
}

.terrain-tool.active {
  color: white;
  background: var(--green);
  border-color: var(--green);
  box-shadow:
    0 8px 18px rgba(36, 95, 70, 0.18);
}

.ignition-tool.active {
  background: var(--danger);
  border-color: var(--danger);
}

.tool-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

.forest-swatch {
  background: var(--forest);
}

.grass-swatch {
  background: var(--grass);
}

.shrub-swatch {
  background: var(--shrub);
}

.soil-swatch {
  background: var(--soil);
}

.rock-swatch {
  background: var(--rock);
}

.water-swatch {
  background: var(--water);
}

.town-swatch {
  background: var(--town);
}

.grid-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 190px;
}

.secondary-btn,
.control-btn {
  padding: 9px 11px;
  color: var(--green-dark);
  background: white;
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

/* =====================================================
   SIMULATION GRID
===================================================== */

.simulation-stage {
  position: relative;
  padding: 14px;
  overflow: hidden;

  background:
    linear-gradient(
      rgba(255, 255, 255, 0.38),
      rgba(255, 255, 255, 0.38)
    ),
    repeating-linear-gradient(
      45deg,
      #e7ede5 0,
      #e7ede5 12px,
      #edf2eb 12px,
      #edf2eb 24px
    );

  border: 1px solid var(--line);
  border-radius: 20px;
}

.grid-frame {
  width: min(100%, 690px);
  margin: 0 auto;
  padding: 8px;
  background: rgba(30, 50, 40, 0.12);
  border-radius: 18px;
}

.wildfire-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  aspect-ratio: 1;
  user-select: none;
  touch-action: none;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  transition:
    filter 120ms ease,
    transform 120ms ease,
    background 160ms ease;
}

.cell:hover {
  z-index: 2;
  filter: brightness(1.08);
  transform: scale(1.035);
}

.cell::before,
.cell::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

/* =====================================================
   TERRAIN COLORS
===================================================== */

.cell.terrain-forest {
  background: var(--forest);
}

.cell.terrain-grass {
  background: var(--grass);
}

.cell.terrain-shrub {
  background: var(--shrub);
}

.cell.terrain-soil {
  background: var(--soil);
}

.cell.terrain-rock {
  background: var(--rock);
}

.cell.terrain-water {
  background: var(--water);
}

.cell.terrain-town {
  background: var(--town);
}

/* Water symbol */

.cell.terrain-water::before {
  width: 72%;
  height: 18%;
  border-top: 3px solid rgba(255, 255, 255, 0.62);
  border-bottom: 3px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

/* Forest symbol */

.cell.terrain-forest::before {
  width: 0;
  height: 0;
  border-right: 10px solid transparent;
  border-bottom: 22px solid rgba(20, 65, 35, 0.58);
  border-left: 10px solid transparent;
  transform: translateY(-2px);
}

.cell.terrain-forest::after {
  width: 4px;
  height: 10px;
  background: rgba(73, 46, 28, 0.58);
  transform: translateY(13px);
}

/* Grass symbol */

.cell.terrain-grass::before {
  width: 48%;
  height: 40%;
  border-left: 3px solid rgba(72, 101, 35, 0.45);
  border-right: 3px solid rgba(72, 101, 35, 0.45);
  transform: skew(-14deg);
}

/* Shrub symbol */

.cell.terrain-shrub::before {
  width: 46%;
  height: 46%;
  background: rgba(55, 83, 30, 0.45);
  border-radius: 50% 46% 52% 44%;
  box-shadow:
    10px 3px 0 rgba(55, 83, 30, 0.28),
    -8px 4px 0 rgba(55, 83, 30, 0.28);
}

/* Rock symbol */

.cell.terrain-rock::before {
  width: 50%;
  height: 40%;
  background: rgba(240, 243, 242, 0.45);

  clip-path:
    polygon(
      20% 0,
      82% 14%,
      100% 72%,
      70% 100%,
      4% 82%,
      0 30%
    );
}

/* Soil symbol */

.cell.terrain-soil::before {
  width: 7px;
  height: 7px;
  background: rgba(83, 56, 35, 0.38);
  border-radius: 50%;
  box-shadow:
    13px 9px 0 rgba(83, 56, 35, 0.25),
    -11px 8px 0 rgba(83, 56, 35, 0.25);
}

/* Town symbol */

.cell.terrain-town::before {
  width: 56%;
  height: 44%;
  background: rgba(248, 244, 236, 0.88);
  border-radius: 3px;
  transform: translateY(5px);
}

.cell.terrain-town::after {
  width: 45%;
  height: 45%;
  background: #8d5f4d;

  clip-path:
    polygon(
      50% 0,
      100% 55%,
      82% 55%,
      82% 100%,
      18% 100%,
      18% 55%,
      0 55%
    );

  transform: translateY(-4px);
}

/* =====================================================
   FIRE STATES
===================================================== */

.cell.ignition-marker {
  outline: 4px solid rgba(255, 236, 170, 0.95);
  outline-offset: -4px;
}

.cell.ignition-marker .cell-icon {
  display: block;
}

.cell.burning {
  background:
    radial-gradient(
      circle at 50% 60%,
      #ffd562 0 18%,
      #f47931 32%,
      #d64227 72%,
      #7d201e 100%
    );

  animation:
    burnFlicker 540ms infinite alternate;
}

.cell.burning::before,
.cell.burning::after,
.cell.burned::before,
.cell.burned::after {
  display: none;
}

.cell.burned {
  background:
    linear-gradient(
      135deg,
      #4a4641,
      #2f2d2a
    );

  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.cell.burned .cell-icon {
  color: rgba(255, 255, 255, 0.28);
}

.cell-icon {
  position: relative;
  z-index: 3;
  display: none;
  font-size: clamp(0.7rem, 1.8vw, 1.35rem);
  filter:
    drop-shadow(
      0 2px 2px rgba(0, 0, 0, 0.18)
    );
}

.cell.burning .cell-icon {
  display: block;
}

/* =====================================================
   WIND OVERLAY
===================================================== */

.wind-overlay {
  position: absolute;
  top: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: white;
  background: rgba(23, 62, 48, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.wind-overlay-arrow {
  display: inline-block;
  font-size: 1.15rem;
  transition: transform 220ms ease;
}

/* =====================================================
   SIMULATION BUTTONS
===================================================== */

.transport-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 15px;
}

.primary-btn,
.control-btn {
  padding: 10px 15px;
}

.primary-btn {
  color: white;

  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-dark)
    );

  border: 0;
  box-shadow:
    0 9px 20px rgba(191, 84, 33, 0.2);
}

.danger-outline {
  color: var(--danger);
  border-color: rgba(189, 63, 45, 0.35);
}

/* =====================================================
   LEGEND
===================================================== */

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.72rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.ignition-dot {
  background: #ffd66b;
  border: 1px solid #aa6c1a;
}

.burning-dot {
  background: var(--burning);
}

.burned-dot {
  background: var(--burned);
}

.barrier-dot {
  background: var(--water);
}

/* =====================================================
   RESULTS
===================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.stat-card {
  padding: 13px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stat-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}

.stat-card strong {
  font-size: 1.35rem;
}

.wide-card {
  grid-column: 1 / -1;
}

.result-meter-block {
  margin-top: 17px;
}

.meter-label-row {
  font-size: 0.82rem;
}

.quality-fill,
.ecosystem-fill {
  width: 100%;

  background:
    linear-gradient(
      90deg,
      #c34132,
      #e4b44f,
      #6ca96f
    );
}

.analysis-card {
  margin-top: 19px;
  border-left: 4px solid var(--accent);
}

.analysis-card .analysis-title {
  margin-bottom: 5px;
  color: var(--ink);
  font-weight: 850;
}

.trial-note {
  margin-top: 12px;
  background: #f2f7f0;
}

.trial-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

/* =====================================================
   MODEL PURPOSE AND LIMITATION
===================================================== */

.teacher-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 21px;
  margin-top: 16px;
}

.teacher-strip p {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.teacher-strip .panel-kicker {
  margin-bottom: 4px;
  color: var(--accent-dark);
}

.limitation-card {
  margin-top: 16px;
  padding: 16px 20px;
  color: #665116;
  background: #fff8df;
  border-color: #dfc96f;
  font-size: 0.86rem;
  line-height: 1.55;
}

.limitation-card strong {
  color: #54410d;
}

/* =====================================================
   INSTRUCTIONS MODAL
===================================================== */

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 30, 24, 0.62);
  backdrop-filter: blur(5px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(560px, 100%);
  padding: 28px;
  background: white;
  border-radius: 22px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.24);
}

.modal ol {
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 15px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #f1f4f0;
  border: 0;
  border-radius: 50%;
  font-size: 1.3rem;
}

/* =====================================================
   TOAST MESSAGE
===================================================== */

.toast {
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 15px;
  color: white;
  background: #253d31;
  border-radius: 13px;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   PLATFORM FOOTER
===================================================== */

.platform-footer {
  margin-top: 3rem;
  padding:
    2.2rem
    clamp(1rem, 4vw, 4rem)
    1.25rem;
  color: rgba(255, 255, 255, 0.82);
  background: #102f35;
}

.footer-content {
  width: min(1400px, 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 auto;
  padding-bottom: 1.75rem;
}

.footer-brand {
  max-width: 340px;
}

.footer-brand > a {
  color: white;
  font-size: 1.2rem;
  font-weight: 900;
}

.footer-brand p {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.5;
}

.footer-navigation {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.footer-navigation a {
  padding: 0.55rem 0.68rem;
  border-radius: 0.55rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.84rem;
  font-weight: 700;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.footer-navigation a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.09);
}

.footer-bottom {
  width: min(1400px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding-top: 1.1rem;
  border-top:
    1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.76rem;
}

/* =====================================================
   ANIMATIONS
===================================================== */

@keyframes burnFlicker {
  from {
    filter:
      brightness(0.94)
      saturate(1);
  }

  to {
    filter:
      brightness(1.15)
      saturate(1.18);
  }
}

@keyframes pulse {
  50% {
    transform: scale(1.15);
  }
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns:
      290px
      minmax(0, 1fr);
  }

  .results-panel {
    position: static;
    grid-column: 1 / -1;
  }

  .results-panel .stat-grid {
    grid-template-columns:
      repeat(5, 1fr);
  }

  .results-panel .wide-card {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .platform-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
  }

  .platform-navigation {
    width: 100%;
    justify-content: flex-start;
  }

  .platform-navigation .model-library-link {
    margin-left: auto;
  }

  .footer-content {
    flex-direction: column;
  }

  .footer-navigation {
    justify-content: flex-start;
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 820px) {
  .platform-header {
    padding: 0.85rem 1rem;
  }

  .platform-brand-text span {
    display: none;
  }

  .platform-navigation {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .platform-navigation a {
    text-align: center;
  }

  .platform-navigation .model-library-link {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 1.65rem 1rem;
  }

  .header-status {
    align-self: flex-start;
  }

  .app-shell {
    width: min(100% - 18px, 1600px);
    margin-top: 9px;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .controls-panel,
  .results-panel {
    position: static;
  }

  .results-panel {
    grid-column: auto;
  }

  .teacher-strip,
  .toolbar-wrap {
    align-items: stretch;
    flex-direction: column;
  }

  .grid-actions {
    justify-content: flex-start;
  }

  .results-panel .stat-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .results-panel .wide-card {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 520px) {
  .platform-header {
    padding: 0.8rem;
  }

  .platform-logo {
    width: 42px;
    height: 42px;
  }

  .site-header {
    padding: 1.5rem 1rem;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .model-details {
    gap: 0.4rem;
  }

  .model-details span {
    font-size: 0.68rem;
  }

  .panel {
    padding: 14px;
    border-radius: 18px;
  }

  .terrain-tool {
    flex:
      1
      1
      calc(33.333% - 8px);
    justify-content: center;
  }

  .wildfire-grid {
    gap: 2px;
  }

  .cell {
    border-radius: 4px;
  }

  .transport-controls > button {
    flex:
      1
      1
      calc(50% - 9px);
  }

  .wind-overlay {
    top: 18px;
    right: 18px;
  }

  .platform-footer {
    padding:
      1.75rem
      1rem
      1rem;
  }

  .footer-navigation {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}