/* ==========================================================================
   Aula de Natura · Cortariu-Cadí (aulanatura.org)
   Estètica editorial inspirada en VallDePi + identitat Cortariu-Cadí
   ========================================================================== */

:root {
  --an-green-dark: #0b3b2b;
  --an-green: #14532d;
  --an-green-mid: #166534;
  --an-green-light: #1e7a5a;
  --an-green-soft: #e8f3ee;
  --an-gold: #c9932c;
  --an-gold-soft: #fef6e4;
  --an-blue: #0369a1;
  --an-blue-soft: #e0f2fe;
  --an-picot: #c9281d;
  --an-picot-soft: #fee2e2;
  --an-stone-dark: #1c2421;
  --an-stone: #4a5550;
  --an-stone-light: #f4f5f3;
  --an-border: #dce2de;
  --an-white: #ffffff;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(11, 59, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(11, 59, 43, 0.10);
  --shadow-lg: 0 16px 40px rgba(11, 59, 43, 0.16);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--an-stone-dark);
  background-color: var(--an-stone-light);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  width: 100%;
}

h1, h2, h3, h4, .serif-title {
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.24;
  margin-top: 0;
  color: var(--an-green-dark);
}

a {
  color: var(--an-green-mid);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--an-gold);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--an-gold);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Top Ecosystem Strip */
.topbar {
  background: var(--an-green-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.topbar a {
  color: #ffe39f;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}

.topbar a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.badge-pill {
  background: rgba(201, 147, 44, 0.22);
  color: #ffd984;
  border: 1px solid rgba(201, 147, 44, 0.45);
  padding: 0.16rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.73rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-pill.green {
  background: var(--an-green-soft);
  color: var(--an-green-dark);
  border-color: #c5dfd2;
}

.badge-pill.blue {
  background: var(--an-blue-soft);
  color: #075985;
  border-color: #bae6fd;
}

.badge-pill.picot {
  background: var(--an-picot-soft);
  color: #991b1b;
  border-color: #fecaca;
}

/* Sticky Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--an-border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 1rem;
  padding: 0.4rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 1;
}

.brand-logo-img {
  width: 52px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(11, 59, 43, 0.16);
  border: 1px solid rgba(11, 59, 43, 0.14);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 800;
  font-size: 1.24rem;
  color: var(--an-green-dark);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.74rem;
  color: var(--an-stone);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  padding: 0.48rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--an-stone-dark);
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--an-green-soft);
  color: var(--an-green-dark);
}

.nav-cta {
  background: var(--an-green) !important;
  color: var(--an-white) !important;
  padding: 0.48rem 0.92rem !important;
  border-radius: 999px !important;
  margin-left: 0.25rem;
}

.nav-cta:hover {
  background: var(--an-green-dark) !important;
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--an-green-dark);
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 530px;
  display: flex;
  align-items: center;
  color: var(--an-white);
  background: linear-gradient(135deg, rgba(8, 38, 27, 0.86) 0%, rgba(18, 84, 61, 0.68) 54%, rgba(12, 32, 24, 0.84) 100%),
              url('../img/hero-cortariu.jpg') center/cover no-repeat;
  padding: 4rem 0 4.5rem;
  overflow: hidden;
}

.hero-subpage {
  min-height: 330px;
  padding: 3.2rem 0 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.28fr 0.92fr;
  gap: 2.4rem;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.26);
  padding: 0.36rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: #ffe39f;
}

.hero h1 {
  color: var(--an-white);
  font-size: clamp(2rem, 3.8vw, 3.15rem);
  margin-bottom: 1rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.38);
}

.hero-lead {
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.93);
  max-width: 650px;
  margin-bottom: 1.65rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.72rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.89rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--an-gold);
  color: #161209;
  box-shadow: 0 4px 16px rgba(201, 147, 44, 0.38);
}

.btn-primary:hover {
  background: #deb041;
  color: #161209;
  transform: translateY(-2px);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.14);
  color: var(--an-white);
  border-color: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.26);
  color: var(--an-white);
  transform: translateY(-2px);
}

.btn-green {
  background: var(--an-green);
  color: var(--an-white);
}

.btn-green:hover {
  background: var(--an-green-dark);
  color: var(--an-white);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--an-white);
  color: var(--an-green-dark);
  border-color: var(--an-border);
}

.btn-outline:hover {
  background: var(--an-green-soft);
  border-color: var(--an-green);
  color: var(--an-green-dark);
}

.btn-sm {
  padding: 0.44rem 0.9rem;
  font-size: 0.8rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 1.25rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffe39f;
}

.stat-label {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.86);
}

/* Hero Live Card */
.hero-live-card {
  background: rgba(14, 41, 31, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.hero-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.25);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.hero-weather-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.hero-wx-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 0.72rem;
}

.hero-wx-place {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
}

.hero-wx-temp {
  font-size: 1.42rem;
  font-weight: 800;
  color: #fff;
  margin: 0.18rem 0;
}

.hero-wx-desc {
  font-size: 0.74rem;
  color: #ffe39f;
}

.hero-cam-preview {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
}

.hero-cam-preview img {
  width: 100%;
  height: 155px;
  object-fit: cover;
}

.hero-cam-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  padding: 0.65rem 0.75rem 0.45rem;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

/* Sections & Grids */
.section {
  padding: 4.25rem 0;
}

.section-alt {
  background: var(--an-white);
  border-top: 1px solid var(--an-border);
  border-bottom: 1px solid var(--an-border);
}

.section-header {
  max-width: 820px;
  margin-bottom: 2.25rem;
}

.section-kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--an-green);
  background: var(--an-green-soft);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.section-title {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  margin-bottom: 0.7rem;
}

.section-subtitle {
  color: var(--an-stone);
  font-size: 1.01rem;
  margin: 0;
}

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

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

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

/* Cards */
.card {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-radius: var(--radius-lg);
  padding: 1.45rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-img-top {
  margin: -1.45rem -1.45rem 1.1rem -1.45rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  height: 200px;
  position: relative;
  background: var(--an-stone-light);
}

.card-img-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card-img-top img {
  transform: scale(1.04);
}

.card-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(11, 59, 43, 0.9);
  color: #fff;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.card-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.1rem;
  font-size: 0.86rem;
  color: var(--an-stone);
  display: grid;
  gap: 0.28rem;
}

/* Info Banner */
.notice-bar {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-left: 4px solid var(--an-gold);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.86rem;
}

.notice-bar.conservation {
  border-left-color: var(--an-blue);
  background: #f8fbfd;
}

/* Weather & SVG 24h Chart */
.wx-card {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.wx-card.primary-station {
  border-color: #9ecbb6;
  box-shadow: 0 8px 22px rgba(20, 83, 45, 0.09);
}

.wx-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--an-border);
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.wx-temp-big {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--an-green-dark);
  line-height: 1;
}

.wx-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: var(--an-stone-light);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
}

.wx-metric-item {
  display: flex;
  flex-direction: column;
}

.wx-metric-label {
  color: var(--an-stone);
  font-size: 0.71rem;
}

.wx-metric-val {
  font-weight: 700;
  color: var(--an-stone-dark);
}

.wx-forecast-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  text-align: center;
  margin-bottom: 0.8rem;
}

.wx-day {
  background: var(--an-stone-light);
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.2rem;
  font-size: 0.74rem;
}

.wx-day-name {
  font-weight: 700;
  color: var(--an-green-dark);
}

.wx-day-temps {
  font-weight: 700;
}

.wx-day-min {
  color: var(--an-stone);
  font-weight: 400;
}

.wx-source-footer {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--an-border);
  font-size: 0.74rem;
  color: var(--an-stone);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chart-panel {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.8rem;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.svg-chart-wrap {
  width: 100%;
  overflow: hidden;
}

.svg-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Multi-Camera Dark Viewer */
.webcam-box {
  background: var(--an-stone-dark);
  color: var(--an-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--an-border);
}

.webcam-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  background: #111916;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 0.6rem;
}

.layer-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e5ece8;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.44rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}

.layer-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.layer-btn.active {
  background: var(--an-gold);
  color: #161209;
  border-color: var(--an-gold);
  font-weight: 700;
}

.layer-btn.light {
  background: var(--an-stone-light);
  color: var(--an-stone-dark);
  border-color: var(--an-border);
}

.layer-btn.light.active {
  background: var(--an-green);
  color: var(--an-white);
  border-color: var(--an-green);
}

.webcam-viewport {
  position: relative;
  background: #060908;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.webcam-viewport img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.webcam-overlay-note {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 640px;
  background: rgba(11, 27, 20, 0.9);
  border: 1px solid rgba(201, 147, 44, 0.55);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.84rem;
  color: #f3f4f6;
}

.webcam-footer {
  padding: 0.85rem 1.25rem;
  background: #151f1b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
}

/* Quadern de camp status strip */
.quadern-panel {
  margin-top: 2rem;
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* Interactive 3D STL Studio */
.studio3d-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

.stl-viewer-card {
  background: #0f1b16;
  color: var(--an-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid #243b31;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.stl-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  background: #0b1410;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.stl-canvas-wrap {
  position: relative;
  height: 410px;
  width: 100%;
  background: radial-gradient(circle at 50% 35%, #1c352a 0%, #0d1713 78%);
  cursor: grab;
  touch-action: none;
}

.stl-canvas-wrap:active {
  cursor: grabbing;
}

.stl-hud {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  background: rgba(11, 20, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.76rem;
  color: #e5ece8;
  pointer-events: none;
  max-width: 290px;
}

.stl-loading-badge {
  position: absolute;
  bottom: 0.85rem;
  right: 0.85rem;
  background: rgba(11, 20, 16, 0.86);
  border: 1px solid rgba(201, 147, 44, 0.45);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.74rem;
  color: #ffe39f;
}

.stl-controls-footer {
  padding: 0.85rem 1.1rem;
  background: #12211b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.video-showcase-card {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.video-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0d1411;
  border: 1px solid var(--an-border);
}

.video-frame video {
  width: 100%;
  height: auto;
  max-height: 280px;
  display: block;
}

/* Filter Toolbar & 3D Model Cards */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-tab {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  color: var(--an-stone-dark);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}

.filter-tab:hover {
  background: var(--an-green-soft);
}

.filter-tab.active {
  background: var(--an-green);
  color: var(--an-white);
  border-color: var(--an-green);
}

.search-input {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--an-border);
  font-family: inherit;
  font-size: 0.86rem;
  min-width: 240px;
  background: var(--an-white);
}

.model-card-img {
  background: #f5f9f7;
  height: 215px;
}

.model-card-img img {
  object-fit: contain;
  padding: 0.5rem;
}

.model-meta-dims {
  font-size: 0.76rem;
  color: var(--an-stone);
  background: var(--an-stone-light);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}

.download-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

/* 3D Terrain MapLibre Card */
.map3d-card {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.map3d-header {
  padding: 1.15rem 1.35rem;
  background: var(--an-green-dark);
  color: var(--an-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.map3d-controls-bar {
  padding: 0.75rem 1.25rem;
  background: var(--an-green-soft);
  border-bottom: 1px solid var(--an-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.map3d-fly-btn {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  color: var(--an-green-dark);
  padding: 0.36rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.map3d-fly-btn:hover,
.map3d-fly-btn.active {
  background: var(--an-green);
  color: var(--an-white);
  border-color: var(--an-green);
}

#an-map-3d {
  width: 100%;
  height: 450px;
  position: relative;
  background: #10251c;
}

.map3d-hud {
  position: absolute;
  bottom: 0.9rem;
  left: 0.9rem;
  z-index: 4;
  max-width: 390px;
  background: rgba(11, 35, 25, 0.88);
  color: #fff;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.79rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.map3d-marker {
  background: rgba(11, 59, 43, 0.92);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(255, 227, 159, 0.7);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.map3d-marker-alt {
  color: #ffe39f;
  margin-left: 0.2rem;
}

.map3d-footer {
  padding: 0.8rem 1.25rem;
  background: var(--an-stone-light);
  border-top: 1px solid var(--an-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.8rem;
}

/* Museum Timeline & Collaborations */
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
  margin-bottom: 2.2rem;
}

.timeline-card {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-top: 4px solid var(--an-green);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.timeline-year {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--an-gold);
  margin-bottom: 0.35rem;
}

.partner-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.partner-pill {
  background: var(--an-white);
  border: 1px solid var(--an-border);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--an-green-dark);
}

/* Gallery & Lightbox */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--an-border);
  background: var(--an-white);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  padding: 0;
  text-align: left;
  font-family: inherit;
}

.gallery-item img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-caption {
  padding: 0.68rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--an-green-dark);
}

.gallery-caption span {
  display: block;
  font-weight: 400;
  font-size: 0.74rem;
  color: var(--an-stone);
  margin-top: 0.15rem;
}

.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 18, 14, 0.9);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-modal.open {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 960px;
  width: 100%;
  text-align: center;
}

.lightbox-content img {
  max-height: 78vh;
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}

.lightbox-caption {
  color: #f3f4f6;
  margin-top: 0.85rem;
  font-size: 0.94rem;
}

.lightbox-close {
  position: absolute;
  top: -2.4rem;
  right: 0;
  background: var(--an-white);
  color: var(--an-stone-dark);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
}

/* Ecosystem Hub & Footer */
.ecosystem-banner {
  background: linear-gradient(135deg, #0b3b2b 0%, #14532d 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.eco-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.eco-card:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-2px);
}

.eco-card strong {
  color: #ffe39f;
  font-size: 0.95rem;
}

.eco-card span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.84);
}

.site-footer {
  background: var(--an-green-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 3.5rem 0 2rem;
}

.site-footer h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.82);
}

.footer-links a:hover {
  color: #ffe39f;
}

.footer-bottom {
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.79rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .hero-grid,
  .studio3d-layout {
    grid-template-columns: 1fr;
  }
  .grid-4,
  .timeline-grid,
  .gallery-grid,
  .ecosystem-banner,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--an-white);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--an-border);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 0.65rem 0.8rem;
  }
}

@media (max-width: 700px) {
  .brand {
    gap: 0.55rem;
  }
  .brand-logo-img {
    width: 40px;
    height: 40px;
  }
  .brand-title {
    font-size: 1.05rem;
  }
  .brand-subtitle {
    font-size: 0.67rem;
  }
  .mobile-menu-btn {
    padding: 0.42rem 0.65rem;
    font-size: 0.86rem;
  }
  .hero-stats,
  .grid-2,
  .grid-3,
  .grid-4,
  .timeline-grid,
  .gallery-grid,
  .ecosystem-banner,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-weather-mini {
    grid-template-columns: 1fr;
  }
  .wx-metrics {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .stl-canvas-wrap {
    height: 320px;
  }
  #an-map-3d {
    height: 360px;
  }
  .search-input {
    width: 100%;
    min-width: 0;
  }
  .section {
    padding: 3rem 0;
  }
}
