/* ---------- Global footer ---------- */

.site-footer {
  max-width: 1160px;
  margin: 4rem auto 2.5rem; /* centered, same width as content */
  padding: 1.75rem 1.5rem 0;
  border-top: 1px solid #e5e7eb;
  font-size: 0.85rem;
  color: #4b5563;
  text-align: left;
  margin-top: 17rem;
}

.site-footer p {
  margin: 0;
}

.site-footer small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* subtle hover if you ever add links inside */
.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Mobile: centre + a bit tighter */
@media (max-width: 900px) {
  .site-footer {
    text-align: center;
    margin-top: 3rem;
  }
}

/* ---------------------------
   HEADER / NAV (iOS glass)
--------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 1.5rem 0; /* your OG sizing */
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);

  /* glassmorphism */
  background: linear-gradient(
    to bottom,
    rgba(249, 250, 251, 0.92),
    rgba(249, 250, 251, 0.86)
  );
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.main-nav {
  max-width: 1100px; /* your OG width */
  margin: 0 auto;
  padding: 0 2rem; /* your OG padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem; /* your OG logo size */
  font-weight: 600;
  cursor: default;
  color: #111;
  text-decoration: none;
}

.logo > li > a:hover {
  color: #000;
}

/* ---------------------------
   NAV LINKS
--------------------------- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem; /* your OG gap */
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links > li > a {
  font-size: 1.15rem; /* your OG nav font-size */
  text-decoration: none;
  color: #333;
  position: relative;
  padding: 0.2rem 0; /* your OG padding */
  transition: color 0.15s ease;
}

/* base underline animation */
.nav-links > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: #111;
  transition: width 0.18s ease;
}

.nav-links > li > a:hover {
  color: #000;
}

.nav-links > li > a:hover::after,
.nav-links > li > a:focus-visible::after {
  width: 100%;
}

/* active page underline (kept from OG) */
.nav-links > li > a.is-active::after,
.nav-parent.active::after {
  width: 100%;
}

/* ---------------------------
   DROPDOWN TRIGGER
--------------------------- */
.has-dropdown {
  position: relative;
}

.nav-parent {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  position: relative;
}

/* small chevron */
.nav-parent::after {
  content: "▾";
  font-size: 0.7rem;
  opacity: 0.7;
  transform-origin: center;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}

/* rotate when open */
.has-dropdown.is-open .nav-parent::after {
  transform: rotate(-180deg);
  opacity: 1;
}

/* ---------------------------
   DROPDOWN PANEL (glass)
--------------------------- */
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 210px;
  padding: 8px;
  margin: 0;
  list-style: none;

  /* iOS-ish glass card */
  background: radial-gradient(
    circle at top left,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.85)
  );
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);

  /* animation state */
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transform-origin: top;
  pointer-events: none;
  transition:
    opacity 0.22s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.2s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 0.2s ease;
}

/* visible when .is-open is added via JS */
.has-dropdown.is-open .dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---------------------------
   DROPDOWN ITEMS
--------------------------- */
.dropdown li {
  margin: 2px 0;
}

/* base state: visible text, nice color */
.dropdown li a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 8px 10px;
  font-size: 0.9rem;
  white-space: nowrap;
  border-radius: 999px;
  text-decoration: none;
  color: #020617; /* force dark text */
  opacity: 1; /* <-- IMPORTANT */
  transition:
    background-color 0.18s ease,
    transform 0.14s ease,
    box-shadow 0.14s ease,
    opacity 0.18s ease;
}

/* hide ONLY when the dropdown is closed */
.has-dropdown:not(.is-open) .dropdown li a {
  opacity: 0;
}

/* pill hover */
.dropdown li a:hover {
  background: rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* active subpage styling */
.dropdown li a.active-sub {
  font-weight: 600;
  background: rgba(15, 23, 42, 0.08);
}

/* Language Switcher - iOS Segmented Control Style */
.lang-switcher-wrapper {
  margin-left: 14px;
  display: flex;
  align-items: center;
}

.lang-toggle-container {
  display: inline-flex;
  position: relative;
  background-color: rgba(118, 118, 128, 0.12); /* Apple system gray 6ish */
  border-radius: 999px;
  padding: 3px;
  transition: background-color 0.2s ease;
}

.lang-option {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-decoration: none;
  border-radius: 999px;
  letter-spacing: 0.3px;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  line-height: 1.4;
}

/* Remove default nav underline from these specific links */
.nav-links .lang-switcher-wrapper .lang-option::after {
  display: none;
}

.lang-option:hover {
  color: #000;
}

.lang-option.active {
  background: #fff;
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
/* MOBILE FIX */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  nav {
    padding: 12px 16px;
    font-size: 14px;
  }

  .hero {
    flex-direction: column;
    padding: 24px 16px;
    text-align: left;
  }

  .hero h1 {
    font-size: 42px;
    line-height: 1.1;
  }

  .hero p {
    font-size: 16px;
    margin-top: 12px;
  }

  .aqi-circle {
    position: static;
    width: 180px;
    height: 180px;
    margin: 24px auto 0;
  }

  footer {
    font-size: 12px;
    padding: 16px;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Inter",
    sans-serif;
  background: #ffffff;
  color: #000000;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Subtle Ambient Background --- */
.breath-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f9f9f9 100%);
}

.air-current {
  position: fixed;
  width: 150vw;
  height: 150vh;
  top: -25%;
  left: -25%;
  z-index: -1;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.01) 0%,
    transparent 60%
  );
  animation: airFlow 25s infinite ease-in-out;
  pointer-events: none;
}

@keyframes airFlow {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(1%, 2%) scale(1.02);
  }
}

/* --- Hero Section --- */
/* --- Hero Section --- */
.hero-map-section {
  width: 100%;
  height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 3rem;
}

.hero-map-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110%;
  height: auto;
  opacity: 0.26;
  filter: grayscale(100%);
  z-index: 1;
  pointer-events: none;
  object-fit: cover;
}
.hero-title {
  z-index: 2;
  text-align: center;
}

.hero-title h1 {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 0.25rem;
}

.hero-title p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: #666;
  font-weight: 300;
}

/* --- Letter Container --- */
.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.25rem 6rem;
  margin-top: -3rem;
}

.letter-card {
  max-width: 780px;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 4.5rem;
  border-radius: 40px;
  border: 1px solid #fff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.04);
  z-index: 5;
}

.letter-content p {
  margin-bottom: 2rem;
  color: #111;
}

.letter-content h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin: 3.5rem 0 1.5rem;
  font-weight: 800;
}

/* --- Vision Grid --- */
.vision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 3rem 0;
}

.vision-item {
  padding: 1.75rem;
  border-radius: 24px;
  background: #f9f9f9;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.vision-item strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.vision-item span {
  font-size: 0.9rem;
  color: #555;
}

/* --- Signature --- */
.signature-wrapper {
  margin-top: 6rem;
  text-align: center;
}

.heart-svg {
  width: 32px;
  height: 32px;
  margin-bottom: 1rem;
  fill: #000;
  opacity: 0.5;
}

.signature-text {
  font-size: 2.25rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -1px;
}

.signature-sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #888;
  margin-top: 0.5rem;
}

.feedback-note {
  margin-top: 4rem;
  padding: 1.5rem;
  border-radius: 20px;
  background: #fcfcfc;
  font-size: 0.85rem;
  color: #999;
  text-align: center;
  border: 1px dashed #eee;
}

/* =========================================
   UPDATED PATCH: NAV FIX
   Replace the previous 'MOBILE NAV HANDLING' block
   ========================================= */

@media (max-width: 900px) {
  /* 1. Stack Logo and Links Vertically */
  .main-nav {
    flex-direction: column;
    padding: 0.5rem 1rem;
  }

  /* 2. Logo Adjustments */
  .logo {
    margin-bottom: 0.75rem;
    font-size: 1.4rem; /* Slightly larger for touch */
  }

  /* 3. Tighter Link Layout */
  .nav-links {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center; /* Center align everything */
    gap: 12px 16px; /* Row gap: 12px, Column gap: 16px */
    width: 100%;
    margin-top: 0;
    padding-bottom: 4px;
  }

  /* 4. Smaller, Readable Text */
  .nav-links > li > a {
    font-size: 0.95rem; /* Reduced from 1.15rem to fit */
    white-space: nowrap; /* Prevent individual words from breaking */
    padding: 6px 0; /* Larger touch target vertically */
  }

  /* 5. Language Switcher Compactness */
  .lang-switcher-wrapper {
    margin-left: 4px; /* Bring it closer to other links */
  }

  /* 6. Fix Dropdown Mobile Positioning */
  /* This ensures the dropdown doesn't get cut off if it opens */
  .dropdown {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(10px); /* Center below link */
    width: 90vw; /* Wide card on mobile */
    max-width: 300px;
    text-align: center;
    background: rgba(
      255,
      255,
      255,
      0.98
    ); /* Less transparent for readability */
  }

  .has-dropdown.is-open .dropdown {
    transform: translateX(-50%) translateY(0);
    z-index: 1000;
  }

  /* Center items inside dropdown for mobile */
  .dropdown li a {
    justify-content: center;
  }
}

/* Safety for very small screens (iPhone SE) */
@media (max-width: 360px) {
  .nav-links {
    gap: 8px 12px;
  }
  .nav-links > li > a {
    font-size: 0.85rem;
  }
}

.letter-card {
  /* Drastically reduce padding on mobile (1.5rem) vs desktop (4.5rem) */
  padding: clamp(1.5rem, 5vw, 4.5rem);
  border-radius: clamp(20px, 4vw, 40px);
  width: 100%;
}

/* 4. Grid Fixes */
.vision-grid {
  /* Default to 1 column for mobile safety */
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

/* =========================================
   PATCH CSS - STRICT BREAKPOINTS
   Add to the bottom of your CSS file
   ========================================= */

/* --- GLOBAL BASELINE FIXES --- */
html,
body {
  overflow-x: hidden; /* Prevent horizontal scroll */
  width: 100%;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

/* Fix Hero Typography Globally (Fluid) */
.hero-title h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
}

/* =========================================
   TABLET: 768px – 1023px
   Goal: Keep horizontal row, but tighten spacing
   ========================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  .site-header {
    padding: 1rem 0;
  }

  .main-nav {
    padding: 0 1.5rem;
    width: 100%;
  }

  /* Shrink text and gaps to fit row */
  .nav-links {
    gap: 1rem; /* Reduced from 1.75rem */
  }

  .nav-links > li > a {
    font-size: 1rem; /* Reduced from 1.15rem */
  }

  .hero-map-section {
    min-height: 40vh; /* Adjust height for tablet */
  }
}

/* =========================================
   LARGE PHONES: 480px – 767px
   Goal: Switch to Stacked Nav (Logo Top, Links Bottom)
   ========================================= */
@media (min-width: 480px) and (max-width: 767px) {
  .site-header {
    height: auto; /* Allow growth for stacked links */
    padding: 1rem 0;
  }

  .main-nav {
    flex-direction: column; /* STACK VERTICALLY */
    padding: 0 1rem;
  }

  .logo {
    margin-bottom: 0.75rem;
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem; /* Row / Column gap */
    width: 100%;
  }

  .nav-links > li > a {
    font-size: 1rem;
    padding: 0.5rem 0; /* Increase touch target */
  }

  /* Fix Grids */
  .vision-grid {
    grid-template-columns: 1fr; /* Single column */
  }

  .letter-card {
    padding: 3rem; /* Reduce card padding */
  }
}

/* =========================================
   STANDARD PHONES: 360px – 479px
   Goal: Compact Stack, ensure text doesn't wrap awkwardly
   ========================================= */
@media (min-width: 360px) and (max-width: 479px) {
  .main-nav {
    flex-direction: column;
    padding: 0 1rem;
  }

  .logo {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem; /* Tighter gap */
  }

  .nav-links > li > a {
    font-size: 0.95rem;
    white-space: nowrap; /* Keep link text on one line */
  }

  /* Content Spacing */
  .hero-map-section {
    padding-top: 5rem;
  }

  .letter-card {
    padding: 2rem; /* Much smaller padding */
    border-radius: 24px;
  }

  .vision-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Footer Fix */
  .site-footer {
    margin-top: 5rem; /* Remove the 17rem gap */
    text-align: center;
  }
}

/* =========================================
   TINY PHONES: 0 – 359px
   Goal: Survival. Small fonts, minimal padding.
   ========================================= */
@media (max-width: 359px) {
  .site-header {
    padding: 0.75rem 0;
  }

  .main-nav {
    flex-direction: column;
    padding: 0 0.5rem; /* Minimal padding */
  }

  .logo {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px; /* Very tight gap */
  }

  .nav-links > li > a {
    font-size: 0.85rem; /* Smallest readable size */
    padding: 4px 0;
  }

  .hero-title h1 {
    font-size: 2.2rem; /* Force small title */
  }

  .letter-card {
    padding: 1.25rem; /* Bare minimum card padding */
    border-radius: 16px;
  }

  /* Prevent 'Language' switcher from breaking layout */
  .lang-switcher-wrapper {
    margin-left: 0;
    margin-top: 5px;
    width: 100%;
    justify-content: center;
  }
}
