/* =========================================================
   CloudMG landing — mirrors the mobile app's design tokens
   (see CloudMG/components/ui/gluestack-ui-provider/config.ts)
   ========================================================= */

:root {
  /* Light theme — matches the app's light vars */
  --background: #faf9f6;   /* dirty white */
  --foreground: #1a1a1a;   /* near black */
  --primary: #e04604;      /* deep vibrant orange */
  --primary-foreground: #ffffff;
  --secondary: #2d6a4f;    /* pine tree green */
  --secondary-foreground: #ffffff;
  --muted: #e8e6e1;        /* warm light gray */
  --muted-foreground: #5c5c5c;
  --card: #ffffff;
  --card-foreground: #1a1a1a;
  --border: #e8e6e1;
  --ring: #e04604;

  /* Radii — mobile / mobile-lg / mobile-xl from tailwind.config.js */
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.06), 0 2px 8px rgba(26, 26, 26, 0.05);
  --shadow: 0 8px 24px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 24px 60px rgba(26, 26, 26, 0.16);

  --container: 1140px;
  --nav-h: 68px;
}

:root[data-theme="dark"] {
  /* Dark theme — matches the app's dark vars */
  --background: #121212;
  --foreground: #faf9f6;
  --primary: #fd4f05;
  --primary-foreground: #121212;
  --secondary: #40916c;
  --secondary-foreground: #121212;
  --muted: #2d2d2d;
  --muted-foreground: #a8a8a8;
  --card: #1e1e1e;
  --card-foreground: #faf9f6;
  --border: #2d2d2d;
  --ring: #fd4f05;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: "Roboto Slab", Georgia, "Times New Roman", serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: clip; /* safety net against horizontal scroll (won't break sticky nav) */
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p { overflow-wrap: break-word; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) 0;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
  min-height: 44px;
}
.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 6px 18px rgba(224, 70, 4, 0.32);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(224, 70, 4, 0.42); }
.btn--primary:active { transform: translateY(0); }

/* ---------- Store badges ---------- */
.store-badges { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;   /* center the icon + label as a group */
  gap: 12px;
  width: 208px;            /* equal width for App Store + Google Play */
  padding: 10px 18px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  min-height: 58px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.store-badge svg { flex: none; }
.store-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.store-badge__text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-badge__text small { font-size: 0.68rem; opacity: 0.85; font-weight: 400; }
.store-badge__text strong { font-size: 1.16rem; font-weight: 700; }
.store-badges--light .store-badge { background: #fff; color: #1a1a1a; border-color: rgba(0, 0, 0, 0.08); }

/* ---------- Eyebrow / section heads ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 7px 14px;
  border-radius: var(--r-pill);
}
.eyebrow--green { color: var(--secondary); background: color-mix(in srgb, var(--secondary) 14%, transparent); }

.section { padding: clamp(64px, 9vw, 108px) 0; }
.section__head { max-width: 680px; margin: 0 auto clamp(40px, 6vw, 64px); text-align: center; }
.section__head .eyebrow { margin-bottom: 18px; }
.section__title { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.section__sub { margin-top: 16px; color: var(--muted-foreground); font-size: 1.08rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand__mark { display: block; flex: none; }
.brand__mark .mtn { fill: var(--secondary); }
.brand__mark .snow { fill: var(--background); }
.brand__mark .cloud { fill: var(--primary); }
.brand__name {
  font-family: "Baloo 2", "Roboto Slab", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--foreground);
}
.brand__accent { color: var(--primary); }
.brand:hover .brand__mark { transform: translateY(-1px) rotate(-3deg); }
.brand__mark { transition: transform 0.25s ease; }

.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.18s ease;
  position: relative;
}
.nav__links a:hover { color: var(--foreground); }
.nav__actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(48px, 7vw, 84px); padding-bottom: clamp(40px, 6vw, 64px); }
.hero__glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(60% 55% at 78% 18%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%),
    radial-gradient(55% 50% at 12% 8%, color-mix(in srgb, var(--secondary) 20%, transparent), transparent 70%);
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(30px, 5vw, 64px);
  align-items: center;
}
.hero__title { font-size: clamp(2.5rem, 6vw, 4.2rem); letter-spacing: -0.03em; }
.hero__lead { margin-top: 22px; font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted-foreground); max-width: 34ch; }

.hero__trust { display: flex; align-items: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 2px; color: var(--primary); }
.hero__trust p { font-size: 0.95rem; color: var(--muted-foreground); }
.hero__trust strong { color: var(--foreground); }

/* Phone mockups */
.hero__visual { position: relative; display: flex; justify-content: center; align-items: center; min-height: 520px; }

.phone {
  position: relative;
  width: 260px;
  aspect-ratio: 9 / 19.3;
  margin: 0;
  background: #0d0d0d;
  border-radius: 40px;
  padding: 10px;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.4);
}
.phone__notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 22px;
  background: #0d0d0d;
  border-radius: var(--r-pill);
  z-index: 3;
}
.phone > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
  background: var(--card);
}
.hero__visual .phone--back {
  position: absolute;
  transform: translateX(74px) translateY(20px) rotate(6deg) scale(0.9);
  filter: brightness(0.94);
  z-index: 1;
}
.hero__visual .phone--front {
  position: relative;
  transform: translateX(-46px) rotate(-4deg);
  z-index: 2;
}

/* Category strip */
.cat-strip {
  position: relative;
  z-index: 1;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: clamp(30px, 5vw, 52px) 0 0;
  padding: 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-weight: 600;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  letter-spacing: 0.02em;
}
.cat-strip li[aria-hidden] { color: var(--primary); }

/* ---------- Features ---------- */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.features { position: relative; overflow: hidden; }
.features__bg {
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 380px;
  background: radial-gradient(50% 70% at 50% 100%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.features .container { position: relative; z-index: 1; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feature {
  position: relative;
  padding: 32px 26px 28px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
/* top accent bar that grows on hover */
.feature::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 34%, var(--border)); }
.feature:hover::before { transform: scaleX(1); }

.feature__icon {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: var(--r-sm);
  background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 20%, transparent), color-mix(in srgb, var(--primary) 8%, transparent));
  color: var(--primary);
  margin-bottom: 20px;
  transition: transform 0.25s ease;
}
.feature__icon--green {
  background: linear-gradient(150deg, color-mix(in srgb, var(--secondary) 22%, transparent), color-mix(in srgb, var(--secondary) 8%, transparent));
  color: var(--secondary);
}
.feature:hover .feature__icon { transform: scale(1.08) rotate(-4deg); }
.feature h3 { font-size: 1.24rem; margin-bottom: 9px; }
.feature p { color: var(--muted-foreground); font-size: 0.98rem; }

/* ---------- How it works ---------- */
.how { background: color-mix(in srgb, var(--muted) 45%, var(--background)); position: relative; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  position: relative;
}
/* dashed connector line behind the step icons (desktop) */
.steps::before {
  content: "";
  position: absolute;
  top: 40px;
  left: 16%;
  right: 16%;
  border-top: 2px dashed color-mix(in srgb, var(--secondary) 45%, transparent);
  z-index: 0;
}
.step {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 14px;
}
.step__top {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 22px;
}
.step__icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 2px solid color-mix(in srgb, var(--secondary) 35%, var(--border));
  color: var(--secondary);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.step:hover .step__icon { transform: translateY(-4px); box-shadow: var(--shadow); }
.step__num {
  position: absolute;
  top: -8px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: "Baloo 2", "Roboto Slab", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: 3px solid var(--background);
  z-index: 2;
}
.how .step:nth-child(1) .step__num,
.how .step:nth-child(2) .step__num,
.how .step:nth-child(3) .step__num { background: var(--primary); }
.step h3 { font-size: 1.28rem; margin-bottom: 10px; }
.step p { color: var(--muted-foreground); max-width: 30ch; margin-inline: auto; }

/* ---------- Gear showcase ---------- */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px;
  gap: 18px;
}
.gear-card {
  position: relative;
  margin: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.gear-card--wide { grid-column: span 2; grid-row: span 2; }
.gear-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gear-card:hover img { transform: scale(1.05); }
.gear-card figcaption {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  color: #fff;
}
.gear-card__tag { font-weight: 700; font-size: 1.12rem; }
.gear-card__price {
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 5px 11px;
  border-radius: var(--r-pill);
}

/* ---------- App preview ---------- */
.screens-row { display: flex; justify-content: center; align-items: flex-end; gap: clamp(16px, 4vw, 44px); flex-wrap: wrap; }
.screens-row .phone { width: 240px; }
.screens-row .phone:nth-child(2) { transform: translateY(-24px); }
.screens-row figcaption {
  position: absolute;
  bottom: -44px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 0.98rem;
}
.screens-row .phone { margin-bottom: 44px; }

/* ---------- Download CTA ---------- */
.cta {
  background:
    radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--primary) 92%, #000 8%), var(--primary));
  color: var(--primary-foreground);
  padding: clamp(64px, 9vw, 104px) 0;
  text-align: center;
}
.cta__inner { max-width: 720px; }
.cta__mark { margin: 0 auto 20px; display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22)); }
.cta__title { font-size: clamp(2rem, 4.5vw, 3rem); }
.cta__sub { margin-top: 16px; font-size: 1.14rem; opacity: 0.94; }
.cta .store-badges { justify-content: center; }

/* ---------- Footer ---------- */
.footer { background: var(--background); border-top: 1px solid var(--border); padding: 52px 0 34px; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer__brand p { color: var(--muted-foreground); margin-top: 8px; font-size: 0.95rem; }
.footer__links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer__links a { color: var(--muted-foreground); font-weight: 500; transition: color 0.18s ease; }
.footer__links a:hover { color: var(--primary); }
.footer__legal {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

/* ============================================================
   Animations
   ============================================================ */

/* Scroll reveal — elements start hidden, .is-visible (added by JS) reveals them */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Stagger children within a grid/row */
.feature-grid .reveal.is-visible { transition-delay: calc(var(--i, 0) * 90ms); }
.gear-grid .reveal.is-visible { transition-delay: calc(var(--i, 0) * 80ms); }
.steps .reveal.is-visible { transition-delay: calc(var(--i, 0) * 120ms); }
.screens-row .reveal.is-visible { transition-delay: calc(var(--i, 0) * 110ms); }

/* Hero load-in */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
.hero__copy > * { animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero__copy > .eyebrow { animation-delay: 0.05s; }
.hero__copy > .hero__title { animation-delay: 0.14s; }
.hero__copy > .hero__lead { animation-delay: 0.24s; }
.hero__copy > .store-badges { animation-delay: 0.34s; }
.hero__copy > .hero__trust { animation-delay: 0.44s; }

.hero__visual { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; }

/* Gentle floating phones */
@keyframes floaty {
  0%, 100% { transform: var(--rest); }
  50% { transform: var(--lift); }
}
.hero__visual .phone--front {
  --rest: translateX(-46px) rotate(-4deg);
  --lift: translateX(-46px) translateY(-12px) rotate(-4deg);
  animation: floaty 6s ease-in-out infinite;
}
.hero__visual .phone--back {
  --rest: translateX(74px) translateY(20px) rotate(6deg) scale(0.9);
  --lift: translateX(74px) translateY(8px) rotate(6deg) scale(0.9);
  animation: floaty 6s ease-in-out 0.6s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__copy > *,
  .hero__visual,
  .hero__visual .phone--front,
  .hero__visual .phone--back { animation: none !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; max-width: 100%; }
  .hero__copy > * { max-width: 100%; }
  .hero__title { font-size: clamp(2.2rem, 8vw, 3.4rem); }
  .hero__lead { max-width: 46ch; }
  .store-badges { justify-content: center; }
  .hero__visual { min-height: 480px; margin-top: 20px; }
}

@media (max-width: 720px) {
  .section { padding: clamp(52px, 11vw, 80px) 0; }
  .steps { grid-template-columns: 1fr; gap: 34px; }
  .steps::before { display: none; }           /* no horizontal connector when stacked */
  .step { padding: 0; }
  .gear-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .gear-card--wide { grid-column: span 2; grid-row: span 1; }
  .footer__links { display: none; }   /* redundant with top nav; keeps mobile footer tidy */
  .footer__inner { flex-direction: column; align-items: center; text-align: center; gap: 14px; }
  .footer { padding: 40px 0 30px; }
}

@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero__title { font-size: clamp(1.95rem, 8.5vw, 2.6rem); }
  .hero__lead { font-size: 1.02rem; }
  .store-badge { width: 100%; max-width: 300px; }        /* full-width, equal, easy tap */
  .phone { width: 215px; }
  .hero__visual { min-height: 440px; }
  .hero__visual .phone--front { --rest: translateX(-28px) rotate(-4deg); --lift: translateX(-28px) translateY(-10px) rotate(-4deg); }
  .hero__visual .phone--back { --rest: translateX(52px) translateY(16px) rotate(6deg) scale(0.9); --lift: translateX(52px) translateY(6px) rotate(6deg) scale(0.9); }
  .gear-grid { grid-template-columns: 1fr; grid-auto-rows: 210px; }
  .gear-card--wide { grid-column: span 1; }
  .footer__legal { flex-direction: column; text-align: center; }
  .footer__inner { align-items: center; text-align: center; }
}
