:root {
  --navy: #163544;
  --teal: #1b8ea0;
  --teal-dark: #0d6873;
  --page: #eaf2f3;
  --card: #ffffff;
  --text: #18343d;
  --muted: #677a80;
  --border: #cfdde0;
  --green: #479d60;
  --yellow: #d19a2a;
  --red: #c54f4f;
  --shadow: 0 14px 30px rgba(21, 58, 67, 0.12);
  --pixel-border: #2c3a40;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Courier New", Courier, monospace;
  color: var(--text);
  background:
    radial-gradient(
      circle at top right,
      rgba(34, 177, 196, 0.16),
      transparent 24rem
    ),
    var(--page);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 4px solid #f0ba3f;
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =====================================================
   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.96);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(17, 64, 72, 0.08);
  position: relative;
  z-index: 30;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

.platform-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: max-content;
  color: var(--text);
}

.platform-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0.85rem;
  background:
    linear-gradient(
      145deg,
      var(--teal),
      var(--teal-dark)
    );
  color: white;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  box-shadow: 0 7px 16px rgba(13, 104, 115, 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: var(--teal-dark);
  background: #e8f5f6;
}

.platform-navigation .model-library-link {
  margin-left: 0.35rem;
  padding-inline: 0.95rem;
  background: var(--teal);
  color: white;
}

.platform-navigation .model-library-link:hover {
  background: var(--teal-dark);
  color: white;
  transform: translateY(-1px);
}

/* =====================================================
   MODEL HEADER
===================================================== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  color: white;
  background:
    linear-gradient(
      120deg,
      rgba(22, 53, 68, 0.98),
      rgba(27, 142, 160, 0.94)
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.18),
      transparent 20rem
    );
  border-bottom: 3px solid var(--pixel-border);
}

.model-introduction {
  max-width: 900px;
}

.site-header h1 {
  margin: 0.15rem 0 0.45rem;
  color: white;
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.08;
}

.site-header .eyebrow {
  color: #bdebf0;
}

.subtitle {
  max-width: 830px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  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.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  backdrop-filter: blur(5px);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  gap: 0.65rem;
}

.secondary-button,
.danger-button,
.download-button {
  min-height: 44px;
  border: 3px solid var(--pixel-border);
  padding: 0.7rem 1rem;
  font-weight: 800;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.12);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.secondary-button:hover,
.danger-button:hover,
.download-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.12);
}

.secondary-button:active,
.danger-button:active,
.download-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
}

.secondary-button {
  color: var(--navy);
  background: #e5f2f3;
}

.site-header .secondary-button {
  color: white;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
}

.danger-button {
  color: #7f2f2f;
  background: #f6dede;
}

.download-button {
  color: white;
  background: #3f9560;
}

.download-button:hover {
  background: #347f50;
}

.download-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* =====================================================
   MAIN LAYOUT
===================================================== */

.app-shell {
  width: min(1540px, 96%);
  margin: 1.5rem auto 3rem;
}

.card {
  background: var(--card);
  border: 3px solid var(--pixel-border);
  box-shadow: var(--shadow);
}

.intro-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 1.4rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--navy);
}

.intro-card p {
  max-width: 840px;
  color: var(--muted);
  line-height: 1.6;
}

.challenge-box {
  min-width: 310px;
  padding: 1rem;
  color: white;
  background:
    linear-gradient(
      145deg,
      var(--navy),
      #21596a
    );
  border: 3px solid var(--pixel-border);
}

.challenge-box span,
.challenge-box strong,
.challenge-box small {
  display: block;
}

.challenge-box span {
  opacity: 0.8;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.challenge-box strong {
  margin: 0.4rem 0;
  font-size: 1.08rem;
}

.challenge-box small {
  line-height: 1.5;
}

/* =====================================================
   WORKSPACE AND TILE PANEL
===================================================== */

.workspace {
  display: grid;
  grid-template-columns:
    350px
    minmax(0, 1fr);
  gap: 1.2rem;
  margin-top: 1.2rem;
  align-items: start;
}

.tool-panel {
  position: sticky;
  top: 1rem;
  padding: 1.1rem;
}

.panel-heading p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.rotation-display {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 3px solid var(--pixel-border);
  background: #f2f7f8;
}

.tile-palette {
  display: grid;
  grid-template-columns:
    1fr
    1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}

.tile-option {
  display: grid;
  place-items: center;
  gap: 0.45rem;
  min-height: 128px;
  padding: 0.6rem;
  border: 3px solid var(--pixel-border);
  background: #f3f7f8;
  color: var(--text);
  text-align: center;
  transition:
    transform 0.12s ease,
    background 0.12s ease;
}

.tile-option:hover {
  transform: translateY(-2px);
  background: #e8f2f3;
}

.tile-option.active {
  background: #dff3f5;
  outline: 3px solid var(--teal);
  outline-offset: -6px;
}

.tile-option strong {
  font-size: 0.72rem;
}

.tile-option small {
  color: var(--muted);
  font-size: 0.63rem;
}

.tile-preview {
  position: relative;
  width: 68px;
  height: 68px;
  overflow: hidden;
  border: 2px solid var(--pixel-border);
  background: #c8d7c2;
}

.selected-tile-box,
.model-note {
  margin-top: 1rem;
  padding: 0.9rem;
  background: #eef7f8;
  border: 3px solid var(--pixel-border);
}

.selected-tile-box span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.selected-tile-box > strong {
  display: block;
  margin-top: 0.25rem;
}

.selected-tile-box p,
.model-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.selected-cost {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 2px dashed #9db0b4;
  color: var(--navy);
  font-size: 0.8rem;
}

/* =====================================================
   DOWNLOAD MODE
===================================================== */

.download-title {
  display: none;
}

.city-download-mode {
  padding: 24px;
  background: var(--page);
}

.city-download-mode .download-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 18px;
  padding: 18px;
  border: 3px solid var(--pixel-border);
  color: white;
  background:
    linear-gradient(
      145deg,
      var(--navy),
      #21596a
    );
}

.city-download-mode .download-title p {
  margin: 0 0 4px;
  color: #bde3e7;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.city-download-mode .download-title h2 {
  color: white;
}

.city-download-mode .download-title span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
}

/* =====================================================
   CITY METRICS
===================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns:
    repeat(6, minmax(120px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.metric-card {
  padding: 0.9rem;
  border: 3px solid var(--pixel-border);
  background: white;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--teal-dark);
  font-size: 1.15rem;
}

.status-card {
  grid-column: span 6;
}

/* =====================================================
   CITY GRID
===================================================== */

.city-card {
  padding: 1rem;
}

.city-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.heat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.heat-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.heat-legend i {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--pixel-border);
}

.cool {
  background: var(--green);
}

.neutral {
  background: var(--yellow);
}

.hot {
  background: var(--red);
}

.city-grid {
  display: grid;
  grid-template-columns:
    repeat(6, minmax(76px, 1fr));
  gap: 0.4rem;
  padding: 0.4rem;
  background: #c9d8bc;
  border: 3px solid var(--pixel-border);
}

.city-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid var(--pixel-border);
  background: #c8b98f;
  padding: 0;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.city-cell:hover {
  z-index: 3;
  transform: scale(1.03);
  box-shadow:
    0 0 0 3px rgba(255, 216, 83, 0.8);
}

.cell-label {
  position: absolute;
  left: 0.2rem;
  bottom: 0.2rem;
  z-index: 20;
  max-width: calc(100% - 0.4rem);
  padding: 0.15rem 0.22rem;
  overflow: hidden;
  color: #1b2b2f;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.5rem;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-scene {
  position: absolute;
  inset: 0;
  transform-origin: center;
}

.rotation-0 {
  transform: rotate(0deg);
}

.rotation-90 {
  transform: rotate(90deg);
}

.rotation-180 {
  transform: rotate(180deg);
}

.rotation-270 {
  transform: rotate(270deg);
}

/* =====================================================
   EMPTY TILE
===================================================== */

.tile-empty {
  background:
    radial-gradient(
      circle at 25% 30%,
      #b89e69 0 3px,
      transparent 4px
    ),
    radial-gradient(
      circle at 70% 65%,
      #9c865d 0 3px,
      transparent 4px
    ),
    #cfbb88;
}

.empty-splotch {
  position: absolute;
  inset: 18%;
  border: 2px dashed rgba(60, 40, 20, 0.35);
}

/* =====================================================
   ROAD TILE
===================================================== */

.tile-road {
  background:
    linear-gradient(
      to right,
      #6a7073 0 14%,
      #555b5f 14% 86%,
      #6a7073 86% 100%
    );
}

.road-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12%;
  background:
    repeating-linear-gradient(
      to bottom,
      #aaa9a1 0 8px,
      #92928c 8px 10px
    );
}

.road-edge.left {
  left: 0;
}

.road-edge.right {
  right: 0;
}

.road-stripe {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 47%;
  width: 6%;
  background:
    repeating-linear-gradient(
      to bottom,
      #f4dd67 0 10px,
      transparent 10px 20px
    );
}

/* =====================================================
   PARKING TILE
===================================================== */

.tile-parking {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.04),
      transparent
    ),
    #70777a;
}

.parking-border {
  position: absolute;
  inset: 8%;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.parking-lines {
  position: absolute;
  inset: 14%;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0 13px,
      rgba(255, 255, 255, 0.72) 13px 15px
    );
}

.parked-car {
  position: absolute;
  width: 14%;
  height: 24%;
  border: 2px solid rgba(0, 0, 0, 0.22);
  box-shadow:
    inset -2px -2px rgba(0, 0, 0, 0.12);
}

.car-one {
  top: 24%;
  left: 18%;
  background: #d05e4e;
}

.car-two {
  right: 18%;
  bottom: 19%;
  background: #4d83b3;
}

/* =====================================================
   BUILDING TILES
===================================================== */

.tile-building,
.tile-coolBuilding {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.08) 0 3px,
      transparent 3px 7px
    ),
    #9cb379;
}

.building-shadow {
  position: absolute;
  left: 22%;
  top: 22%;
  width: 58%;
  height: 58%;
  background: rgba(45, 54, 55, 0.25);
}

.building-box {
  position: absolute;
  left: 15%;
  top: 14%;
  width: 58%;
  height: 58%;
  border: 3px solid rgba(0, 0, 0, 0.3);
  background: #9c6241;
  box-shadow:
    inset -7px -7px 0 rgba(0, 0, 0, 0.12);
}

.cool-roof {
  background: #dbeef1;
}

.rooftop-unit {
  position: absolute;
  top: 13%;
  right: 12%;
  width: 22%;
  height: 18%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  background: #667b80;
}

.windows {
  position: absolute;
  inset: 15%;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0 9px,
      rgba(241, 217, 101, 0.9) 9px 13px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 9px,
      rgba(241, 217, 101, 0.9) 9px 13px
    );
}

/* =====================================================
   TREE TILE
===================================================== */

.tile-tree {
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.06) 0 50%,
      transparent 50%
    ),
    #87b762;
}

.path {
  position: absolute;
  left: 44%;
  top: 0;
  bottom: 0;
  width: 12%;
  background:
    repeating-linear-gradient(
      to bottom,
      #d3bd8d 0 8px,
      #c5ad7d 8px 10px
    );
}

.tree-trunk {
  position: absolute;
  width: 7%;
  height: 16%;
  background: #6b4a2e;
}

.trunk-one {
  left: 23%;
  top: 31%;
}

.trunk-two {
  right: 22%;
  top: 48%;
}

.trunk-three {
  left: 52%;
  bottom: 18%;
}

.tree-top {
  position: absolute;
  border: 3px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 35% 30%,
      #67b66e 0 22%,
      transparent 23%
    ),
    #3f9252;
  box-shadow:
    inset -5px -5px 0 rgba(0, 0, 0, 0.1);
}

.tree-top.one {
  width: 34%;
  height: 34%;
  left: 9%;
  top: 12%;
}

.tree-top.two {
  width: 32%;
  height: 32%;
  right: 8%;
  top: 30%;
}

.tree-top.three {
  width: 34%;
  height: 34%;
  left: 40%;
  bottom: 5%;
}

/* =====================================================
   GRASS TILE
===================================================== */

.tile-grass {
  background:
    repeating-linear-gradient(
      45deg,
      #89ba63 0 4px,
      #79ad59 4px 8px
    );
}

.grass-path {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 42%;
  height: 13%;
  background: #d8c59a;
  transform: rotate(-12deg);
}

.grass-flower {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #f4d85d;
  box-shadow:
    5px 0 #f4d85d,
    0 5px #f4d85d;
}

.flower-one {
  left: 20%;
  top: 20%;
}

.flower-two {
  right: 25%;
  top: 22%;
}

.flower-three {
  left: 30%;
  bottom: 18%;
}

.flower-four {
  right: 18%;
  bottom: 24%;
}

/* =====================================================
   WATER TILE
===================================================== */

.tile-water {
  background:
    repeating-linear-gradient(
      to bottom,
      #5db2ce 0 9px,
      #4ca4c1 9px 14px
    );
}

.water-bank {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  background:
    repeating-linear-gradient(
      to bottom,
      #9db16d 0 8px,
      #84995b 8px 12px
    );
}

.bank-left {
  left: 0;
}

.bank-right {
  right: 0;
}

.wave {
  position: absolute;
  width: 60%;
  height: 4px;
  left: 20%;
  background: rgba(255, 255, 255, 0.65);
}

.wave.one {
  top: 24%;
}

.wave.two {
  top: 48%;
}

.wave.three {
  top: 72%;
}

/* =====================================================
   SHADE TILE
===================================================== */

.tile-shade {
  background:
    linear-gradient(
      45deg,
      #b7c984 25%,
      transparent 25%
    ),
    linear-gradient(
      -45deg,
      #b7c984 25%,
      transparent 25%
    ),
    #91b66e;
  background-size: 16px 16px;
}

.plaza {
  position: absolute;
  inset: 9%;
  border: 2px solid rgba(0, 0, 0, 0.16);
  background:
    repeating-linear-gradient(
      0deg,
      #ccb98d 0 8px,
      #bfaa7c 8px 10px
    );
}

.shade-post {
  position: absolute;
  bottom: 20%;
  width: 6%;
  height: 35%;
  background: #72583b;
}

.shade-post.left {
  left: 24%;
}

.shade-post.right {
  right: 24%;
}

.shade-roof {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 17%;
  height: 23%;
  border: 3px solid rgba(0, 0, 0, 0.25);
  background:
    repeating-linear-gradient(
      90deg,
      #b37f42 0 10px,
      #9f6f37 10px 20px
    );
}

.bench {
  position: absolute;
  left: 34%;
  bottom: 13%;
  width: 32%;
  height: 8%;
  background: #7b5b39;
}

/* =====================================================
   HEAT OVERLAY
===================================================== */

.heat-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.heat-low {
  background: rgba(43, 173, 144, 0.08);
}

.heat-medium {
  background: rgba(234, 172, 49, 0.08);
}

.heat-high {
  background: rgba(206, 67, 55, 0.13);
}

/* =====================================================
   CITY SUMMARY
===================================================== */

.summary-grid {
  display: grid;
  grid-template-columns:
    0.8fr
    1.2fr;
  gap: 1rem;
  margin-top: 1rem;
}

.summary-card {
  padding: 1rem;
}

.tile-counts {
  display: grid;
  grid-template-columns:
    repeat(2, 1fr);
  gap: 0.55rem;
  margin-top: 1rem;
}

.count-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem;
  border: 2px solid var(--pixel-border);
  background: #f2f7f8;
  font-size: 0.8rem;
}

.feedback-box {
  margin-top: 1rem;
  min-height: 100px;
  padding: 0.9rem;
  border: 3px solid var(--pixel-border);
  background: #eef7f8;
  color: var(--muted);
  line-height: 1.6;
}

/* =====================================================
   RULES
===================================================== */

.rules-card {
  display: grid;
  grid-template-columns:
    0.55fr
    1.45fr;
  gap: 2rem;
  margin-top: 1.2rem;
  padding: 1.2rem;
}

.rule-list {
  display: grid;
  grid-template-columns:
    repeat(2, 1fr);
  gap: 0.7rem;
}

.rule-list div {
  padding: 0.8rem;
  border: 2px solid var(--pixel-border);
  background: #f3f8f9;
  color: var(--muted);
  line-height: 1.45;
}

/* =====================================================
   MODEL LIMITATION
===================================================== */

.limitation-card {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  background: #fff8df;
  border-color: #d7bd63;
  color: #665116;
  line-height: 1.55;
}

/* =====================================================
   VARIABLEVISTA PLATFORM FOOTER
===================================================== */

.platform-footer {
  margin-top: 3rem;
  padding: 2.2rem clamp(1rem, 4vw, 4rem) 1.25rem;
  background: #102f35;
  color: rgba(255, 255, 255, 0.82);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

.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 {
  background: rgba(255, 255, 255, 0.09);
  color: white;
}

.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;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1250px) {
  .metrics-grid {
    grid-template-columns:
      repeat(3, 1fr);
  }

  .status-card {
    grid-column: span 3;
  }
}

@media (max-width: 1050px) {
  .workspace,
  .rules-card {
    grid-template-columns: 1fr;
  }

  .tool-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .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;
  }
}

@media (max-width: 760px) {
  .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,
  .intro-card,
  .city-toolbar,
  .city-download-mode .download-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button {
    flex: 1 1 calc(50% - 0.65rem);
  }

  .challenge-box {
    width: 100%;
    min-width: 0;
  }

  .summary-grid,
  .rule-list {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .status-card {
    grid-column: span 2;
  }

  .city-grid {
    grid-template-columns:
      repeat(6, minmax(48px, 1fr));
  }

  .cell-label {
    display: none;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 1.5rem 1rem;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .model-details {
    gap: 0.4rem;
  }

  .model-details span {
    font-size: 0.68rem;
  }

  .app-shell {
    width: min(100% - 1rem, 1540px);
    margin-top: 0.75rem;
  }

  .header-actions button {
    flex: 1 1 100%;
  }

  .tile-palette,
  .tile-counts,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .status-card {
    grid-column: auto;
  }

  .city-grid {
    grid-template-columns:
      repeat(4, minmax(56px, 1fr));
  }

  .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;
  }
}