/* ═══════════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════════ */

:root {
  --font-primary: "Google Sans Flex", sans-serif;
  --max-width: 1120px;
  --padding-x: clamp(1.5rem, 5vw, 4rem);
  --section-padding-y: clamp(4rem, 8vw, 8rem);

  /* Colors - Light Mode */
  --color-hero-primary-bg: #FFFFFF;
  --color-hero-secondary-bg: #EEEEEE;
  --color-section-primary-bg: #FFFFFF;
  --color-section-alt-bg: #F2F2F2;
  --color-footer-bg: #F2F2F2;
  --color-label-primary: #000000;
  --color-label-secondary: #414141;
  --color-label-tertiary: #6E6E6E;
  --color-toggle-bg: #E0E0E0;
  --color-toggle-icon: #000000;
  --color-border: #D4D4D4;
  --color-accent: #0191FE;

  /* iOS System Colors */
  --color-ios-blue: #007AFF;
  --color-ios-green: #2FCC57;
  --color-ios-orange: #FF9500;
  --color-ios-red: #FF3B30;
  --color-ios-brown: #A2845E;
}

[data-theme="dark"] {
  --color-hero-primary-bg: #1C1C1E;
  --color-hero-secondary-bg: #141414;
  --color-section-primary-bg: #0A0A0A;
  --color-section-alt-bg: #141414;
  --color-footer-bg: #141414;
  --color-label-primary: #FFFFFF;
  --color-label-secondary: #C8C8C8;
  --color-label-tertiary: #8D8D8D;
  --color-toggle-bg: #3A3A3C;
  --color-toggle-icon: #FFFFFF;
  --color-border: #4d4d4d;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: 56px;
}

body {
  font-family: var(--font-primary);
  color: var(--color-label-primary);
  background-color: var(--color-hero-primary-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* ═══════════════════════════════════════════════
   COMPONENTS
═══════════════════════════════════════════════ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
}

.container--narrow {
  max-width: 880px;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: pretty;
}

h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-align: center;
  text-wrap: pretty;
}

.eyebrow {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-label-secondary);
  margin-bottom: 0.75rem;
  text-align: center;
  text-wrap: pretty;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-hero-secondary-bg);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.nav__logo {
  height: 20px;
}

.nav__wordmark {
  font-size: 1rem;
  font-weight: 600;
}

.nav__download {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.4em 1.1em;
  border-radius: 999px;
  background-color: var(--color-accent);
  color: #FFFFFF;
}

.nav__border {
  height: 1px;
  background-color: var(--color-border);
  opacity: 0.5;
}

.region-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-hero-secondary-bg);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.region-banner--hiding {
  animation: banner-slide-out 0.25s ease forwards;
}

@keyframes banner-slide-in {
  from { max-height: 0; opacity: 0; padding-block: 0; }
  to   { max-height: 4rem; opacity: 1; padding-block: 0.75rem; }
}

@keyframes banner-slide-out {
  from { max-height: 4rem; opacity: 1; padding-block: 0.75rem; }
  to   { max-height: 0; opacity: 0; padding-block: 0; }
}

.region-banner__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.region-banner__link {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.region-banner__dismiss {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
}

/* HERO */
.hero-primary {
  background-color: var(--color-hero-primary-bg);
  padding: clamp(8rem, 10vw, 10rem) 0 0; 
  text-align: center;
}

.hero-primary h1 {
  margin: 1rem 0 3rem;
}

.hero-primary .hero-image {
  max-width: 680px;
  margin: 0 auto;
}

.hero-secondary {
  background-color: var(--color-hero-secondary-bg);
  padding: clamp(2.5rem, 5vw, 4rem) var(--padding-x);
  text-align: center;
}

.hero-secondary__text {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 550;
  line-height: 1.6;
  max-width: 80%;
  color: var(--color-label-secondary);
  margin: 0 auto;
}

.hero-image img {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-image img.loaded {
  opacity: 1;
}

/* FEATURES */
.feature {
  padding: var(--section-padding-y) 0;
}

.feature--primary {
  background-color: var(--color-section-primary-bg);
}

.feature--alternate {
  background-color: var(--color-section-alt-bg);
}

.feature h2 {
  margin-bottom: 2rem;
  max-width: 70%;
  margin-left: auto;
  margin-right: auto;
}

.feature__image {
  max-width: 720px;
  margin: 0 auto 2rem;
}

.feature__image--cycle {
  position: relative;
}

.cycle-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  opacity: 0;
}

.cycle-img--active {
  opacity: 1;
}

.feature__image--cycle .cycle-img:first-child {
  position: relative;
}

.feature__body {
  font-size: 1.2rem;
  font-weight: 450;
  line-height: 1.65;
  color: var(--color-label-secondary);
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
  text-wrap: pretty;
}

/* CARDS */
.feature__cards-viewport {
  overflow: hidden;
}

.feature__cards {
  display: flex;
  gap: 1rem;
  transition: transform 0.4s ease;
  margin-bottom: 1.5rem;
}

.feature__card {
  flex: 0 0 100%;
}

@media (min-width: 460px) {
  .feature__card {
    flex: 0 0 calc((100% - 1rem) / 2);
  }
}

@media (min-width: 640px) {
  .feature__card {
    flex: 0 0 calc((100% - 2rem) / 3);
  }
}

.feature__card-title,
.feature__card-body {
  padding: 0 0.75rem;
}

.feature__card-image {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.feature__card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-label-primary);
  margin-bottom: 0.25rem;
}

.feature__card-body {
  font-size: 0.8rem;
  color: var(--color-label-secondary);
  line-height: 1.5;
}

/* CAROUSEL */
.feature__carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.feature__carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-toggle-bg);
  color: var(--color-label-secondary);
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.feature__carousel-btn[data-dir="next"] .material-symbols-rounded {
  transform: translateX(1px);
}

.feature__carousel-btn:hover:not(:disabled) {
  color: var(--color-label-primary);
  border-color: var(--color-label-tertiary);
}

.feature__carousel-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
}

.feature__carousel-status {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-label-tertiary);
  min-width: 3.5em;
  text-align: center;
}

/* FOOTNOTE & CTA */
.feature__footnote {
  padding-top: 2rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--color-label-tertiary);
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.cta {
  background-color: var(--color-footer-bg);
  padding: var(--section-padding-y) var(--padding-x);
  text-align: center;
}

.cta__text {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 2.5rem;
}

.cta__lead {
  color: var(--color-label-primary);
}

.cta__sub {
  color: var(--color-label-tertiary);
}


/* ═══════════════════════════════════════════════
   NAVIGATION MENU & OVERLAY
═══════════════════════════════════════════════ */

/* Keep the Nav visible, on top, and looking normal when menu is open */
body.menu-open .nav {
  opacity: 1 !important;
  transform: translateY(0) !important;
  z-index: 2001; 
  background-color: var(--color-hero-secondary-bg);
  transition: none !important; 
}

/* The Capsule Button */
.nav__menu-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--color-toggle-bg);
  color: var(--color-label-primary);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.4rem 0.6rem; /* Tighter padding for mobile (icon only) */
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav__menu-btn:hover {
  background-color: var(--color-border);
}

.nav__menu-text {
  display: none; /* Hidden on mobile */
}

/* Show text on larger screens */
@media (min-width: 640px) {
  .nav__menu-btn {
    padding: 0.4rem 1.1rem 0.4rem 0.8rem;
  }
  .nav__menu-text {
    display: inline-block;
  }
}

/* Full Screen Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* accounts for mobile browser UI */
  background-color: var(--color-section-primary-bg); /* Contrast surface */
  z-index: 2000; /* Sits just below the nav */
  padding-top: 56px; /* Offset to sit nicely under your 56px nav */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.menu-overlay--open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Tighter mobile margins for the overlay content */
.menu-overlay__content {
  padding: 2rem 1.5rem 4rem 1.5rem; /* Top: 2rem, Right/Left: 1.5rem, Bottom: 4rem */
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 640px) {
  .menu-overlay__content {
    padding-left: var(--padding-x);
    padding-right: var(--padding-x);
  }
}

/* Styling the overlay links */
.menu-overlay__links {
  flex-direction: column; /* Stack vertically by default */
  gap: 3rem;
}

.menu-overlay__links .site-footer__nav-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-label-primary);
  opacity: 1;
}

.menu-overlay__links a {
  font-size: 1.25rem; /* Larger touch targets for the overlay */
  padding: 0.3rem 0;
  display: inline-block;
  text-decoration: none;
  color: var(--color-label-secondary);
  font-weight: 500;
  transition: color 0.2s ease;
}

.menu-overlay__links a:hover {
  color: var(--color-label-primary);
}

@media (min-width: 640px) {
  .menu-overlay__links {
    flex-direction: row; /* Switch back to row for desktop */
    gap: 4rem;
  }
}

/* Utility to lock body scrolling when menu is open */
body.menu-open {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   FOOTER & TOGGLE
═══════════════════════════════════════════════ */

.site-footer {
  background-color: var(--color-section-primary-bg);
  padding: 3rem 0 3rem;
  text-align: left;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-footer__logo {
  height: 24px;
}

.site-footer__wordmark {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-label-primary);
}

.site-footer__divider {
  height: 1px;
  background-color: var(--color-border);
  opacity: 0.3;
  margin: 1.2rem 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem 3rem;
}

.site-footer__nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 120px;
}

.site-footer__nav-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-label-primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.site-footer__nav-group a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-label-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer__nav-group a:hover {
  color: var(--color-label-primary);
}

.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background-color: var(--color-toggle-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-toggle-icon);
  position: relative;
  overflow: hidden;
}

.theme-toggle__icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background-color: var(--color-toggle-icon);
}

.site-signoff {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

.site-signoff p {
  font-size: 0.85rem;
  color: var(--color-label-tertiary);
  line-height: 1.5;
}

/* REGION CAPSULE */
.region-capsule {
  position: fixed;
  bottom: 2rem;
  right: calc(2rem + 44px + 0.75rem); /* sits left of theme toggle */
  height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background-color: var(--color-toggle-bg);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 1000;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.region-capsule--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.region-capsule__flag {
  font-size: 1rem;
  line-height: 1;
}

.region-capsule__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-label-primary);
  font-family: var(--font-primary);
}

/* REGION DROPDOWN */
.region-dropdown {
  position: fixed;
  z-index: 1001;
  background-color: var(--color-toggle-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.region-dropdown--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.region-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-label-primary);
  font-family: var(--font-primary);
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.region-dropdown__item:hover {
  background-color: var(--color-border);
}

/* Hide theme toggle when scrolled (matches capsule behaviour) */
.theme-toggle--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE TYPOGRAPHY
═══════════════════════════════════════════════ */

@media (max-width: 960px) {
  .hero-primary h1 {
    font-size: clamp(2.2rem, 5vw, 2.2rem);
    margin-left: auto;
    margin-right: auto;
  }

  .feature h2 {
    font-size: clamp(1.8rem, 5vw, 1.8rem);
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .feature__body,
  .hero-secondary__text {
    font-size: 1.05rem;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .feature__body {
    margin-bottom: 2rem;
  }

  .eyebrow {
    font-size: 0.8rem;
    font-weight: 500;
  }
}