/* ===== Bloomeal website =====
   Static, no build step, system fonts only (no requests to third-party servers).
   Theme: follows the device (prefers-color-scheme); the toggle stores a choice in localStorage
   and sets <html data-theme="light|dark">. */

:root {
  --green: #30b15c;
  --green-2: #1fa588;
  --green-soft: #e9f7ee;
  --protein: #0a84ff;
  --fat: #ff9500;
  --carbs: #af52de;
  --water: #32ade6;
  --fire: #ff6b35;

  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --card: #ffffff;
  --nav-bg: rgba(255, 255, 255, .8);
  --link: #0071e3;
  --cta-bg: #1d1d1f;
  --cta-fg: #ffffff;
  --frame: #1d1d1f;
  --shadow: 0 30px 60px -24px rgba(20, 60, 40, .28), 0 10px 24px -12px rgba(20, 60, 40, .16);

  --radius: 22px;
  --wrap: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* Dark palette: used when the device is dark (and no manual choice), or when chosen manually */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #34c759;
    --green-2: #2bb39a;
    --green-soft: #12261a;
    --ink: #f5f5f7;
    --ink-2: #d2d2d7;
    --muted: #a1a1a6;
    --line: #2c2c2e;
    --bg: #000000;
    --bg-soft: #111113;
    --card: #1c1c1e;
    --nav-bg: rgba(18, 18, 20, .78);
    --link: #2997ff;
    --cta-bg: #f5f5f7;
    --cta-fg: #1d1d1f;
    --frame: #3a3a3c;
    --shadow: 0 30px 60px -24px rgba(0, 0, 0, .7), 0 10px 24px -12px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --green: #34c759;
  --green-2: #2bb39a;
  --green-soft: #12261a;
  --ink: #f5f5f7;
  --ink-2: #d2d2d7;
  --muted: #a1a1a6;
  --line: #2c2c2e;
  --bg: #000000;
  --bg-soft: #111113;
  --card: #1c1c1e;
  --nav-bg: rgba(18, 18, 20, .78);
  --link: #2997ff;
  --cta-bg: #f5f5f7;
  --cta-fg: #1d1d1f;
  --frame: #3a3a3c;
  --shadow: 0 30px 60px -24px rgba(0, 0, 0, .7), 0 10px 24px -12px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--card); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 16px;
  height: 52px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 650; font-size: 17px; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; width: 26px; height: 26px; }
.nav__links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav__links a { color: var(--ink-2); }
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__tools { display: flex; align-items: center; gap: 6px; }
.chip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 36px; height: 32px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  font: 600 13px/1 var(--font); cursor: pointer;
}
.chip-btn:hover { background: var(--bg-soft); text-decoration: none; }
.chip-btn svg { width: 16px; height: 16px; }
.theme-ico--moon { display: none; }
:root[data-theme="dark"] .theme-ico--sun { display: none; }
:root[data-theme="dark"] .theme-ico--moon { display: block; }
@media (max-width: 760px) { .nav__links { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 16px; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn--green { background: var(--green); color: #fff; }
.btn--line { border-color: var(--line); color: var(--ink); background: var(--card); }
.appstore {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 8px 20px 8px 16px; border-radius: 14px;
  background: var(--cta-bg); color: var(--cta-fg); text-align: left;
}
.appstore:hover { text-decoration: none; opacity: .9; }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore small { display: block; font-size: 11px; line-height: 1.1; opacity: .85; }
.appstore b { display: block; font-size: 19px; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--green-soft) 0%, var(--bg) 100%);
  text-align: center; padding: 56px 20px 0; overflow: hidden;
}
.hero__icon { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 18px; box-shadow: var(--shadow); }
.hero__title { font-size: clamp(44px, 8vw, 76px); font-weight: 750; letter-spacing: -.045em; }
.hero__title span {
  background: linear-gradient(100deg, #3ddc7a 0%, var(--green) 45%, #14a38e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__tagline { margin: 12px auto 0; font-size: clamp(22px, 3.2vw, 30px); font-weight: 650; letter-spacing: -.02em; max-width: 720px; }
.hero__lead { max-width: 600px; margin: 12px auto 0; font-size: clamp(16px, 1.9vw, 19px); color: var(--muted); }
.hero__ctas { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero__note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.hero__phones { display: flex; justify-content: center; align-items: flex-end; gap: 22px; margin-top: 48px; }
.hero__phones .phone:nth-child(1), .hero__phones .phone:nth-child(3) { width: 220px; margin-bottom: -40px; opacity: .97; }
.hero__phones .phone:nth-child(2) { width: 270px; margin-bottom: -90px; }
@media (max-width: 640px) {
  .hero__phones .phone:nth-child(1), .hero__phones .phone:nth-child(3) { display: none; }
  .hero__phones .phone:nth-child(2) { width: 250px; }
}

/* ---------- Phone frame (CSS only) ---------- */
.phone {
  position: relative; width: 260px; aspect-ratio: 563 / 1218;
  border-radius: 40px; padding: 9px; background: var(--frame);
  box-shadow: var(--shadow);
}
.phone picture, .phone img { width: 100%; height: 100%; border-radius: 32px; object-fit: cover; object-position: top; background: #f2f2f7; }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-title { font-size: clamp(30px, 4.6vw, 48px); font-weight: 720; text-align: center; letter-spacing: -.035em; }
.section-lead { max-width: 640px; margin: 14px auto 0; text-align: center; color: var(--muted); font-size: clamp(16px, 1.9vw, 19px); }
.eyebrow { display: block; color: var(--green); font-weight: 650; font-size: 14px; letter-spacing: .02em; margin-bottom: 10px; }

.intro { padding-top: 140px; }
@media (max-width: 640px) { .intro { padding-top: 130px; } }

/* Feature rows: text + phone, alternating */
.feature {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
  max-width: var(--wrap); margin: 0 auto; padding: 56px 20px;
}
.feature--flip .feature__text { order: 2; }
.feature__text h3 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 720; letter-spacing: -.03em; }
.feature__text p { color: var(--ink-2); font-size: 17px; margin: 14px 0 0; }
.feature__visual { display: flex; justify-content: center; }
.feature__visual .phone { width: 270px; }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: 32px; text-align: center; padding: 40px 20px; }
  .feature--flip .feature__text { order: 0; }
  .feature__text .chips { justify-content: center; }
  .feature__visual .phone { width: 240px; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; list-style: none; }
.chips li {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 550;
  padding: 6px 12px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line);
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Tile grid */
.grid-section { background: var(--bg-soft); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 40px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); }
.tile__glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; font-size: 22px; background: var(--green-soft);
}
.tile h4 { font-size: 18px; margin-top: 14px; }
.tile p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* Gallery of App Store screenshots: horizontal scroll on phones */
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 300px); gap: 20px;
  justify-content: center; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 36px 20px 12px; margin-top: 8px; -webkit-overflow-scrolling: touch;
}
.gallery img { width: 100%; border-radius: 24px; box-shadow: var(--shadow); scroll-snap-align: center; background: var(--green-soft); }
@media (max-width: 760px) { .gallery { justify-content: start; grid-auto-columns: 72%; } }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 40px; counter-reset: s; }
.step { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.step__n {
  display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--green); color: #fff; font-weight: 700;
}
.step h4 { margin-top: 12px; font-size: 18px; }
.step p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* Get the app */
.get { text-align: center; background: linear-gradient(180deg, var(--bg) 0%, var(--green-soft) 50%, var(--bg) 100%); }
.get .hero__icon { margin-bottom: 18px; }
.get__note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { margin-top: 32px; border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative;
  font-weight: 600; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 400; color: var(--muted); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--ink-2); }

/* Notice (medical disclaimer) */
.notice {
  max-width: 780px; margin: 0 auto; padding: 18px 22px; border-radius: 16px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-2); font-size: 15px;
}

/* Contact card */
.contact__card {
  max-width: 640px; margin: 0 auto; text-align: center; padding: 40px 24px;
  border-radius: 28px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.contact__card img { width: 60px; height: 60px; border-radius: 15px; margin: 0 auto 14px; }
.contact__card h2 { font-size: 28px; }
.contact__card p { color: var(--ink-2); margin: 10px 0 20px; }
.contact__mail { display: block; margin-top: 12px; font-size: 15px; }

/* ---------- Legal / support pages ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); font-weight: 750; letter-spacing: -.035em; }
.doc__meta { color: var(--muted); margin: 8px 0 28px; font-size: 15px; }
.doc h2 { font-size: 22px; margin: 34px 0 10px; }
.doc p, .doc li { color: var(--ink-2); font-size: 16.5px; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--ink); }
.summary { padding: 18px 22px; border-radius: 16px; background: var(--green-soft); border: 1px solid var(--line); }
.summary p { margin: 0; color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 24px 0; }
.cards a {
  display: block; padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--ink);
}
.cards a:hover { text-decoration: none; border-color: var(--green); }
.cards b { display: block; font-size: 17px; }
.cards span { display: block; color: var(--muted); font-size: 14.5px; margin-top: 4px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 32px 0 40px; font-size: 13.5px; color: var(--muted); }
.footer__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; display: grid; gap: 14px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer nav a { color: var(--ink-2); }
.footer p { margin: 0; }

/* Fade-in on scroll (only when JS has marked the page) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
