/* ==========================================================================
   Budjetly — shared stylesheet
   Font: "Nunito" (rounded display, Google Fonts) as the closest web-licensed
   match for the app's SF Pro Rounded headline, with system-ui fallback.
   Colors mirror the Figma "Color Styles" variable collection.
   ========================================================================== */

:root {
  /* Brand */
  --primary-400: #33a0fe;
  --primary-500: #338df6;
  --primary-600: #1f85fc;
  --primary-700: #0063d7;
  --primary-900: #001834;

  /* Text */
  --text: #0d121c;
  --text-secondary: #6c737f;
  --neutral-700: #384250;
  --neutral-600: #4d5761;
  --neutral-400: #9da4ae;
  --neutral-100: #f3f4f6;

  /* Surfaces */
  --white: #ffffff;
  --base-white: #fffdfe;

  /* Status (budget bars) */
  --bar-blue: #33a0fe;
  --bar-amber: #f5a524;
  --bar-red: #f04438;

  /* Layout */
  --maxw: 1280px;
  --gutter: 40px;
  --radius-card: 26px;
  --header-h: 104px;

  /* Shadows */
  --shadow-card: 0 14px 38px rgba(13, 18, 28, 0.12);
  --shadow-soft: 0 8px 24px rgba(13, 18, 28, 0.06);

  --font-rounded: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-rounded);
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Header / Top bar  (Figma node 1503:88864) — fixed to top, light gradient
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 100;
  /* Figma node 1637:213346 — no own band: transparent over the hero gradient */
  background: transparent;
}
/* Legal pages have no hero, so give the fixed header a solid backdrop there
   (keeps body content from scrolling visibly under it). */
body.legal-page { padding-top: var(--header-h); }
body.legal-page .site-header { background: #ffffff; }
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 70px; width: auto; }

/* QR code (Figma node 1502:84017) — two states:
   default = Small (76×76 tile), expanded on hover = Big (200×229 card + label) */
.site-header .wrap { position: relative; }
.qr {
  position: absolute;
  top: 22px;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 8px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(13, 18, 28, 0.12);
  cursor: pointer;
  z-index: 110;
  --qr-ease: cubic-bezier(0.16, 1, 0.3, 1);
  transition: padding 0.3s var(--qr-ease), border-radius 0.3s var(--qr-ease),
              gap 0.3s var(--qr-ease), box-shadow 0.3s var(--qr-ease);
}
.qr__code {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  transition: width 0.3s var(--qr-ease), height 0.3s var(--qr-ease);
}
.qr__code :is(img, canvas) { width: 100% !important; height: 100% !important; display: block; }
.qr__label {
  max-height: 0;
  max-width: 0;                 /* collapse width too so it adds no side padding */
  opacity: 0;
  overflow: hidden;
  font-size: 19px;             /* expanded label (+20% from 16px) */
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: max-height 0.3s var(--qr-ease), max-width 0.3s var(--qr-ease),
              opacity 0.3s var(--qr-ease);
}
/* expanded state (+20% overall vs previous: padding/radius/gap/QR/label) */
.qr:hover,
.qr:focus-visible {
  padding: 24px;
  border-radius: 29px;
  gap: 17px;
  box-shadow: 0 24px 60px rgba(13, 18, 28, 0.28);
  outline: none;
}
.qr:hover .qr__code,
.qr:focus-visible .qr__code { width: 192px; height: 192px; }
.qr:hover .qr__label,
.qr:focus-visible .qr__label { max-height: 34px; max-width: 240px; opacity: 1; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  /* top padding clears the fixed (transparent) header; no bottom dead space */
  padding: var(--header-h) 0 0;
  /* Hero Section bg (Figma node 1614:127699) — light Neutral-100 base fading
     into a light-blue accent at the bottom. Sits BEHIND content. */
  background:
    linear-gradient(180deg, #f3f4f6 0%, #e9f2fc 38%, #d2e6fc 70%, #bedcfb 100%);
}

/* Bottom shader (Figma node 1502:68178) — lives INSIDE the hero, pinned to its
   bottom, ABOVE the mockup (z-index 7). Fades the phone-fan bottom edge softly
   into white so it meets the footer seamlessly. Cannot bleed into the footer. */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  pointer-events: none;
  z-index: 7;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.75) 58%, #ffffff 100%);
}

/* Concentric ring lines behind the phones (pure CSS) */
.hero__rings {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: 1180px;
  height: 1180px;
  pointer-events: none;
  z-index: 0;
}
.hero__rings span {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(51, 141, 246, 0.14);
  border-radius: 50%;
}
.hero__rings span:nth-child(1) { width: 1180px; height: 1180px; }
.hero__rings span:nth-child(2) { width: 970px;  height: 970px;  }
.hero__rings span:nth-child(3) { width: 745px;  height: 745px;  border-color: rgba(51, 141, 246, 0.18); }

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-top: 32px;
}

/* Stats + faces row */
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto 18px;
}
.faces { display: flex; }
.faces img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--white);
  object-fit: cover;
  background: #dceafb;
  margin-left: -12px;
  box-shadow: 0 2px 6px rgba(13, 18, 28, 0.12);
}
.faces img:first-child { margin-left: 0; }
.hero__eyebrow-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--neutral-700);
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text);
}
.hero__subtitle {
  max-width: 540px;
  margin: 0 auto 28px;
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Store badges  (Figma nodes 1503:116438 App Store / 1503:116439 Google Play)
   -------------------------------------------------------------------------- */
.store-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
/* Exported Figma badge SVGs (176×60) */
.store-badge {
  position: relative;
  display: inline-flex;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border-radius: 16px;
}
.store-badge img { height: 60px; width: auto; display: block; }
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(13, 18, 28, 0.18); }

.soon-pill {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--primary-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(51, 141, 246, 0.4);
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Mockup container (single combined PNG) + floating cards overlay
   -------------------------------------------------------------------------- */
.phones {
  position: relative;
  z-index: 1;
  margin-top: 28px;
}
.phones__stage {
  position: relative;
  width: 1120px;
  max-width: 100%;
  margin-inline: auto;
}
.phones__img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Floating budget cards — single exported PNG overlay (pre-positioned)
   -------------------------------------------------------------------------- */
.floating-cards {
  position: absolute;
  top: -272px;            /* up 300px then down 36px from original -8px */
  left: 50%;
  transform: translateX(-50%);
  width: 116%;            /* slightly wider than the phone fan, cards fan outward */
  max-width: none;
  z-index: 6;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--white);
  padding: 64px 0 40px;        /* no top stroke (per Figma node 1503:116625) */
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
}
.footer-brand img { height: 56px; margin-bottom: 16px; }
.footer-brand p {
  max-width: 360px;
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 0 18px;
}
.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--primary-600);
}
.footer-email svg { width: 18px; height: 18px; }
.footer-col h4 {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--text);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.footer-col a {
  color: var(--text-secondary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--primary-600); }
.footer-col .mini-soon {
  background: var(--primary-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--neutral-100);
}
.footer-copy { color: var(--text-secondary); font-size: 14px; }

/* Social icons (app's exact exports, muted-gray PNGs) */
.socials { display: flex; gap: 18px; align-items: center; }
.socials a {
  display: inline-flex;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.socials a:hover { opacity: 1; transform: translateY(-2px); }
.socials img { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Legal pages (privacy / terms)
   -------------------------------------------------------------------------- */
/* Legal layout mirrors Figma (nodes 1505:75693 / 1511:87417): wide single
   column, large heading, "Last Updated" subtitle, section heading + body. */
.legal {
  max-width: 1200px;
  margin-inline: auto;
  padding: 64px var(--gutter) 96px;
}
.legal__head { margin-bottom: 48px; }
.legal h1 {
  font-size: clamp(40px, 5.5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 12px;
}
.legal .updated { color: var(--text-secondary); font-size: 18px; margin: 0; }
.legal section { margin-bottom: 36px; }
.legal h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.legal p {
  color: var(--neutral-700);
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 14px;
  max-width: 1100px;
}
.legal p:last-child { margin-bottom: 0; }
.legal a { color: var(--primary-600); font-weight: 600; text-decoration: underline; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root { --gutter: 20px; --header-h: 80px; }
  .qr { display: none; }                 /* QR is desktop-only decorative aid */
  .brand img { height: 50px; }

  .hero__inner { padding-top: 16px; }
  .hero__rings { display: none; }
  .hero { padding-bottom: 56px; }
  .hero::after { height: 120px; }
  .floating-cards { display: none; }     /* decorative — hide on mobile */

  .phones { margin-top: 16px; }
  .phones__stage { width: 100%; }

  .store-badges { gap: 12px; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 20px; align-items: flex-start; }
}

@media (max-width: 400px) {
  .store-badge { height: 52px; padding: 0 16px; }
  .store-badge__text strong { font-size: 18px; }
}
