/* ============================================================
   Olympic City Viability Simulator — Global Stylesheet
   ============================================================
*/

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #e5e5e8;
  --color-surface: #ffffff;
  --color-border: #000000;
  --color-text: #000000;
  --color-muted: #000000;
  --color-accent: #e12d43;
  --color-accent-hover: #b8162b;
  --color-econ: #e12d43;
  --color-infra: #000000;
  --color-sustain: #000000;
  --nav-height: 56px;
  --sidebar-width: 320px;
  --font-title:
    "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body:
    "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-label:
    "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: var(--font-body);
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6,
.nav-brand {
  font-family: var(--font-title);
}

label,
.sidebar-section h3,
.pillar-tag,
#city-stats .stat-group h4,
.interactive-ideas h4,
.btn-primary,
.nav-links a {
  font-family: var(--font-label);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* --- Navigation --- */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  padding: 0 1.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-logo {
  height: calc(var(--nav-height) - 12px);
  width: auto;
  display: block;
}

nav.floating-nav .nav-logo {
  height: 64px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--color-muted);
  font-size: 0.9rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
  text-decoration: none;
}

/* --- Main Content (index, resources) --- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

main h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

main h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 1rem;
  color: var(--color-text);
}

main p {
  color: var(--color-muted);
  max-width: 65ch;
}

main ul {
  padding-left: 1.25rem;
  color: var(--color-muted);
}

main li {
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

/* ============================================================
   HOME PAGE 
   ============================================================ */

nav.floating-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom: none;
  height: auto;
  padding: 1.5rem 2rem;
  z-index: 100;
}

nav.floating-nav .nav-links a {
  color: var(--color-text);
  font-family: var(--font-label);
  font-weight: 500;
}

nav.floating-nav .nav-links a:hover,
nav.floating-nav .nav-links a.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.home-main {
  max-width: none;
  margin: 0;
  padding: 0;
}

.home-page .hero {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 560px) 1fr;
  padding: 0;
  text-align: left;
  background-image: url("../assets/hero-background.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-color: var(--color-bg);
}

.hero-panel {
  height: 100vh;
  overflow-y: auto;
  padding: 7rem 3rem 3rem;
  background: rgba(229, 229, 232, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.hero-content {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-eyebrow {
  display: block;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.9rem;
}

.home-page .hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
}

.home-page .hero p {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--color-text);
  margin: 0 0 1rem;
  max-width: none;
}

.hero-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 2.25rem;
  width: 100%;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.1rem 1.25rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  color: var(--color-text);
  text-decoration: none;
  transition:
    transform 0.15s ease,
    background 0.2s,
    border-color 0.2s;
}

.hero-card:hover {
  background: #fff;
  border-color: var(--color-accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.hero-card-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #000;
  background: none;
  border: none;
}

.hero-card-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  display: block;
}

.hero-card-body {
  flex: 1;
  min-width: 0;
}

.hero-card-body h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.25rem;
  color: var(--color-text);
}

.hero-card-body p {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--color-text);
  opacity: 0.7;
  margin: 0;
}

.hero-card-arrow {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--color-accent);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.hero-card:hover .hero-card-arrow {
  transform: translateX(3px);
}

/* --- Home Footer (100vh) --- */
.home-footer {
  min-height: 100vh;
  background: #000;
  color: #fff;
  padding: 5rem 3rem;
  border-top: none;
  text-align: left;
  font-size: 1rem;
}

.home-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 10rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4rem;
}

.footer-eyebrow {
  display: block;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.footer-top h2 {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #fff;
  max-width: 18ch;
  margin: 0 0 2rem;
}

.footer-cta {
  background: var(--color-accent);
  color: #fff;
  padding: 0.9rem 2.25rem;
  font-size: 1rem;
}

.footer-cta:hover {
  background: var(--color-accent-hover);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-col h4 {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #fff;
}

.footer-col li a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col li a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.55);
  max-width: none;
}

@media (max-width: 900px) {
  .home-page .hero {
    grid-template-columns: 1fr;
  }
  .hero-panel {
    height: 100vh;
    padding: 6rem 1.5rem 3rem;
    background: rgba(229, 229, 232, 0.9);
  }
  .home-page .hero h1 {
    font-size: 2.25rem;
  }
  .footer-top h2 {
    font-size: 2.25rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.floating-nav.nav-dark .nav-links a {
  color: #fff;
}

@media (max-width: 600px) {
  .home-page nav.floating-nav {
    padding: 1rem 1.25rem;
  }
  .hero-panel {
    padding: 5rem 1.25rem 2.5rem;
  }
  .home-page .hero h1 {
    font-size: 1.9rem;
  }
  .home-footer {
    padding: 3rem 1.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}


.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.7rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
}

/* --- Pillars Grid --- */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.pillar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
}

.pillar-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.pillar-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.pillar-card p {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.pillar-card-link {
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.2s,
    transform 0.15s;
}

.pillar-card-link:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  text-decoration: none;
}

/* --- Assumptions --- */
.assumptions ul {
  list-style: disc;
}

/* --- Resources Page --- */
.resources-page section {
  margin-bottom: 2rem;
}

.resources-page li strong {
  color: var(--color-text);
}

/* --- Simulator Layout (data.html) --- */
.simulator-page main {
  padding: 0;
  max-width: none;
}

.simulator-layout {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 7rem 1.25rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.sidebar-section label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.sidebar select {
  width: 100%;
  padding: 0.5rem;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

#city-stats {
  font-size: 0.9rem;
  line-height: 1.6;
}

#city-stats .placeholder-text {
  color: var(--color-muted);
  font-style: italic;
}

#city-stats .stat-group {
  margin-bottom: 1rem;
}

#city-stats .stat-group h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

#city-stats .stat-group h4.econ {
  color: var(--color-econ);
}
#city-stats .stat-group h4.infra {
  color: var(--color-infra);
}
#city-stats .stat-group h4.sustain {
  color: var(--color-sustain);
}

#city-stats .stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.15rem 0;
  border-bottom: 1px solid var(--color-border);
}

#city-stats .stat-label {
  color: var(--color-muted);
}
#city-stats .stat-value {
  font-weight: 600;
}

/* Pillar filter checkboxes */
#pillar-filters label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Map container */
#map {
  flex: 1;
  min-height: 80vh;
}

/* --- Data Tables & Viz Page --- */
.pillar-section {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.pillar-section:last-of-type {
  border-bottom: none;
}

.pillar-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.econ-tag {
  background: var(--color-accent);
  color: #fff;
}
.infra-tag {
  background: #000;
  color: #fff;
}
.sustain-tag {
  background: transparent;
  color: #000;
  border: 1px solid #000;
}

/* Data tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-family: var(--font-body);
}

thead th {
  font-family: var(--font-label);
  text-align: left;
  padding: 0.9rem 1rem;
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

thead th:first-child {
  padding-left: 1.5rem;
}

thead th:last-child {
  padding-right: 1.5rem;
}

tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--color-text);
  vertical-align: middle;
}

tbody td:first-child {
  padding-left: 1.5rem;
  font-weight: 600;
}

tbody td:last-child {
  padding-right: 1.5rem;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover td {
  background: rgba(225, 45, 67, 0.04);
  color: var(--color-text);
}

tbody tr:hover td:first-child {
  color: var(--color-accent);
}

/* --- Pictogram (transit score) --- */
.pictogram-chart {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  padding: 0.25rem 0;
}

.pictogram-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  position: relative;
  transition: background 0.15s;
}

.pictogram-row:hover {
  background: rgba(225, 45, 67, 0.06);
}

.pictogram-label {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pictogram-icons {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  min-width: 0;
}

.car-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  color: var(--color-accent);
}

.car-icon.off {
  color: rgba(0, 0, 0, 0.15);
}

.pictogram-value {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}

.pictogram-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  padding: 0.4rem 0.65rem;
  background: #000;
  color: #fff;
  font-size: 0.72rem;
  border-radius: 6px;
  z-index: 10;
  pointer-events: none;
}

.pictogram-row:hover .pictogram-tooltip {
  display: block;
}

/* --- NDVI heatmap bars --- */
.ndvi-heatmap {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  padding: 0.25rem 0;
}

.ndvi-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-label);
  font-size: 0.72rem;
}

.ndvi-label {
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ndvi-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.ndvi-fill {
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(225, 45, 67, 0.55),
    var(--color-accent)
  );
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ndvi-value {
  text-align: right;
  font-weight: 600;
  color: var(--color-text);
}

/* Visualization placeholders */
.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.viz-placeholder {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  padding: 2rem 1.25rem;
  text-align: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.viz-placeholder .viz-label {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.viz-placeholder p {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0 auto;
  max-width: 30ch;
}

/* Replace placeholder with image: just swap the inner HTML to
   <img src="viz/chart1.png" alt="..."> and remove the dashed border */
.viz-placeholder:has(img) {
  border-style: solid;
  padding: 0;
}

.viz-placeholder img {
  width: 100%;
  border-radius: 8px;
}

.viz-hint {
  font-size: 0.75rem;
  color: var(--color-accent);
  margin-top: 0.5rem;
}

.viz-hint code {
  background: rgba(59, 130, 246, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

/* Interactive ideas */
.interactive-ideas {
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.interactive-ideas h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.interactive-ideas li {
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.interactive-ideas strong {
  color: var(--color-text);
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .simulator-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    min-width: unset;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  #map {
    min-height: 60vh;
  }
  .hero h1 {
    font-size: 1.75rem;
  }
  .pillar-grid {
    grid-template-columns: 1fr;
  }
}
