/* MyGluco site — shared by every page. Tokens mirror src/utils/theme.ts. */
:root {
  --canvas: #F1F3F7; --surface: #FFFFFF; --ink: #111827; --muted: #6B7280;
  --line: #E4E7EC; --teal: #0D7A6F; --teal-deep: #0A5E55; --teal-soft: #E6F7F5;
  --safe: #059669; --moderate: #C2610C; --risk: #DC2626; --dark: #0A0B0D;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 18px; --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root { --canvas:#0A0B0D; --surface:#16181D; --ink:#F3F4F6; --muted:#9BA3AF;
          --line:#2A2E37; --teal:#2BB5A6; --teal-deep:#5FD3C5; --teal-soft:#10261F; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 17px/1.65 var(--sans);
       -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--teal); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); margin: 0 0 14px; }
.lede { color: var(--muted); font-size: 19px; max-width: 34em; }

/* ── Page transitions ──
   Browsers that support cross-document view transitions fade the old page out
   and the new one up; the nav is named so it stays put instead of flashing.
   Everyone else gets a fade-in on load. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 220ms ease both page-out; }
::view-transition-new(root) { animation: 480ms cubic-bezier(.2,.7,.2,1) both page-in; }
nav.site { view-transition-name: site-nav; }
@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(18px); } }
@supports not (view-transition-name: none) {
  main { animation: 520ms cubic-bezier(.2,.7,.2,1) both page-in; }
}
/* Sections rise in as they scroll into view. Hidden only when JS is running,
   so the page is never blank without it. */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root), main { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Nav ── */
nav.site { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--canvas) 85%, transparent);
      backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
      border-bottom: 1px solid var(--line); }
nav.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
         font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.navlinks { display: flex; align-items: center; gap: 28px; }
.navlinks a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.navlinks a:hover, .navlinks a[aria-current="page"] { color: var(--ink); }
.navlinks a[aria-current="page"]:not(.btn) { box-shadow: inset 0 -2px 0 var(--teal); padding-bottom: 4px; }
.navlinks a.btn-primary, .navlinks a.btn-primary:hover { color: #fff; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 38px;
            color: var(--ink); cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; }
@media (max-width: 820px) {
  .menu-btn { display: grid; place-items: center; }
  .navlinks { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
              gap: 0; padding: 8px 24px 20px; background: var(--canvas); border-bottom: 1px solid var(--line); }
  nav.site.open .navlinks { display: flex; }
  .navlinks a { padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .navlinks a[aria-current="page"]:not(.btn) { box-shadow: none; color: var(--teal); }
  .navlinks a.btn { margin-top: 16px; justify-content: center; border-bottom: 0; }
}

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px;
       font: 600 15px/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.soon { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: var(--canvas);
        padding: 12px 20px 12px 16px; border-radius: 14px; text-decoration: none; }
.soon svg { width: 26px; height: 26px; fill: currentColor; }
.soon small { display: block; font-size: 11px; opacity: .75; line-height: 1.2; }
.soon strong { display: block; font-size: 17px; line-height: 1.2; }

/* ── Sections ── */
section { padding: 96px 0; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 50px); }
.section-head p { color: var(--muted); font-size: 18px; margin: 16px 0 0; }
.page-head { padding: 88px 0 24px; }
.page-head h1 { font-size: clamp(42px, 6vw, 68px); max-width: 16ch; }
.page-head .lede { margin: 20px 0 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.card h3 { font-size: 21px; margin-bottom: 6px; }
.card p { color: var(--muted); margin: 0; font-size: 15.5px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 820px) { .grid3, .grid2 { grid-template-columns: 1fr; } }

/* Phone frames around the real App Store screenshots */
.phone { width: 280px; border-radius: 44px; padding: 10px; background: #0A0B0D;
         box-shadow: 0 40px 80px -30px rgba(17,24,39,.45), 0 0 0 1px rgba(255,255,255,.06) inset; }
.phone img { border-radius: 34px; width: 100%; }

/* Contact block */
.contact { background: var(--teal); color: #fff; border-radius: 28px; padding: 64px 48px; text-align: center; }
.contact h2 { font-size: clamp(32px, 4.2vw, 48px); color: #fff; }
.contact p { color: rgba(255,255,255,.85); max-width: 560px; margin: 16px auto 28px; font-size: 18px; }
.contact .btn { background: #fff; color: #0A5E55; font-size: 16px; padding: 15px 26px; }
.contact .mail { display: block; margin-top: 16px; color: rgba(255,255,255,.92); font-size: 15px; }
@media (prefers-color-scheme: dark) { .contact { background: #0D7A6F; } }
@media (max-width: 600px) { .contact { padding: 48px 24px; } }

/* ── Long-form documents: support, privacy, terms ── */
.doc { padding-bottom: 40px; }
.doc > * { max-width: 760px; }
.doc h2 { font-size: 26px; margin: 48px 0 12px; }
.doc h3 { font-size: 19px; margin: 28px 0 6px; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
.doc p, .doc li { font-size: 16.5px; }
.doc ul { padding-left: 22px; }
.doc .muted, .doc .updated { color: var(--muted); }
.doc .updated { font-size: 14px; margin: 16px 0 0; }
.doc .card { margin: 24px 0; }
.doc .card h2 { margin-top: 0; font-size: 22px; }
.doc .card.contact-card { background: var(--teal-soft); border-color: transparent; }
.doc code { background: var(--teal-soft); padding: 1px 6px; border-radius: 5px; font-size: 14px; }
.doc table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--muted); font-weight: 600; }
.doc .scroll { overflow-x: auto; }

/* ── Footer ── */
footer.site { padding: 56px 0 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); background: var(--surface); }
footer.site .wrap { display: grid; grid-template-columns: 1.2fr 1.4fr; gap: 32px; }
footer.site .links { display: flex; gap: 12px 22px; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; }
footer.site .links a { color: var(--muted); text-decoration: none; }
footer.site .links a:hover { color: var(--ink); }
footer.site .disclaimer { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 24px; font-size: 13px; line-height: 1.6; margin: 0; }
@media (max-width: 720px) { footer.site .wrap { grid-template-columns: 1fr; } footer.site .links { justify-content: flex-start; } }

/* ── Home: hero ── */
.hero { padding: 72px 0 56px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero .wrap > * { min-width: 0; }
.hero h1 { font-size: clamp(44px, 6.4vw, 76px); }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero .lede { margin: 22px 0 32px; }
.types { margin-top: 28px; color: var(--muted); font-size: 14px; }
.types b { color: var(--ink); font-weight: 600; }
.phones { position: relative; height: 620px; }
.phones .phone { position: absolute; }
.phones .front { right: 150px; top: 0; z-index: 2; }
.phones .back { right: 0; top: 70px; transform: rotate(4deg); }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .phones { height: auto; display: flex; justify-content: center; }
  .phones .phone, .phones .front { position: relative; right: auto; top: auto; }
  .phones .back { display: none; }
}

/* ── Home: steps and teasers ── */
.step { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.step .n { width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal);
           display: grid; place-items: center; font: 700 17px/1 var(--serif); margin-bottom: 18px; }
.step h3 { font-size: 23px; margin-bottom: 8px; }
.step p { color: var(--muted); margin: 0; font-size: 16px; }
a.teaser { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .2s ease, border-color .2s ease; }
a.teaser:hover { transform: translateY(-3px); border-color: var(--teal); }
a.teaser .go { margin-top: 16px; color: var(--teal); font-weight: 600; font-size: 14.5px; }
.center-cta { margin-top: 40px; display: flex; justify-content: center; }

/* ── Features ── */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; padding: 56px 0; }
.feature + .feature { border-top: 1px solid var(--line); }
.feature.flip .copy { order: 2; }
.feature h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 14px; }
.feature p { color: var(--muted); margin: 0 0 14px; }
.feature ul { list-style: none; padding: 0; margin: 18px 0 0; }
.feature li { padding: 8px 0 8px 30px; position: relative; font-size: 16px; }
.feature li::before { content: ""; position: absolute; left: 0; top: 13px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D7A6F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat; }
.shot { display: flex; justify-content: center; }
.shot .phone { width: 300px; }
.score-legend { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.pill { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.pill i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; gap: 32px; }
  .feature.flip .copy { order: 0; }
}

/* ── Mission ── */
.mission { background: var(--dark); color: #F3F4F6; text-align: center; }
.mission .eyebrow { color: #5FD3C5; }
.mission .big { font-family: var(--serif); font-weight: 700; font-size: clamp(64px, 12vw, 140px); line-height: 1;
                letter-spacing: -0.04em; color: #fff; margin: 8px 0 6px; }
.mission .big span { color: #5FD3C5; }
.mission h1, .mission h2 { font-size: clamp(26px, 3.4vw, 38px); color: #fff; }
.mission p { color: #9BA3AF; max-width: 640px; margin: 22px auto 0; font-size: 18px; }
.mission .btn-ghost { background: transparent; color: #fff; border-color: #2A2E37; margin-top: 32px; }
.pillars { margin-top: 56px; text-align: left; }
.pillars > div { border: 1px solid #2A2E37; border-radius: var(--radius); padding: 24px; background: #111318; }
.pillars h3 { font-size: 20px; color: #fff; margin-bottom: 6px; }
.pillars p { margin: 0; font-size: 15.5px; }

/* ── FAQ ── */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--teal); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 12px 0 0; }

/* ── Full-screen panels ──
   Pages with <body data-panels> become a stack of full-screen sections. One
   scroll, swipe or arrow key fades to the next section above or below; there
   is no free scrolling between them. site.js adds .panels-on, so without JS
   the page is an ordinary scrolling page. A panel taller than the screen
   scrolls inside itself first and only moves on once you reach its edge. */
.panels-on, .panels-on body { height: 100%; overflow: hidden; }
.panels-on main { position: fixed; inset: 68px 0 0 0; }
.panels-on .panel { position: absolute; inset: 0; margin: 0; padding: 40px 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; scrollbar-width: none;
  opacity: 0; visibility: hidden; transform: translateY(56px) scale(.985);
  transition: opacity .45s ease, transform .6s cubic-bezier(.2,.7,.2,1), visibility 0s linear .6s; }
.panels-on .panel::-webkit-scrollbar { display: none; }
.panels-on .panel.is-above { transform: translateY(-56px) scale(.985); }
.panels-on .panel.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; z-index: 1; }
.panels-on .panel > .wrap { margin-block: auto; width: 100%; }
.panels-on .panel > footer.site { margin-top: 40px; margin-bottom: -40px; }
.panels-on body > footer.site { display: none; }
.panels-on .section-head { margin-bottom: 32px; }
.panels-on .page-head { padding: 40px 0; }

/* Children rise in, one after another, each time their panel arrives */
.panels-on .panel .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.panels-on .panel.is-active .reveal { opacity: 1; transform: none; }

/* Screenshots scale with the screen so a feature fits without scrolling */
.panels-on .shot .phone { width: clamp(150px, calc((100dvh - 68px - 120px) / 2.2), 300px); }
.panels-on .phones { height: min(620px, calc(100dvh - 68px - 100px)); }
.panels-on .phones .phone { width: clamp(160px, calc((100dvh - 68px - 190px) / 2.2), 280px); }
.panels-on .feature { padding: 0; }
.panels-on .feature + .feature { border-top: 0; }
@media (max-width: 900px) {
  .panels-on .shot .phone { width: clamp(140px, calc((100dvh - 68px - 470px) / 2.2), 260px); }
  .panels-on .feature { gap: 24px; }
  .panels-on .hero .phones { display: none; }
  .panels-on .panel { padding: 28px 0; }
}

/* Section dots */
.dots { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 15; display: flex; flex-direction: column; gap: 12px;
        mix-blend-mode: difference; }
.dots button { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; background: transparent; padding: 0; cursor: pointer;
               transition: transform .3s ease, background .3s ease; }
.dots button[aria-current="true"] { background: #fff; transform: scale(1.25); }
@media (max-width: 600px) { .dots { right: 10px; gap: 10px; } .dots button { width: 8px; height: 8px; } }

/* "Next" hint on the first panel */
.next-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: none; border: 0; color: var(--muted);
             cursor: pointer; display: none; flex-direction: column; align-items: center; gap: 2px; font: 600 12px/1 var(--sans);
             letter-spacing: .08em; text-transform: uppercase; }
.panels-on .next-hint { display: flex; }
.next-hint svg { width: 22px; height: 22px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (prefers-reduced-motion: reduce) {
  .panels-on .panel, .panels-on .panel .reveal { transition: none !important; transform: none !important; }
  .next-hint svg { animation: none; }
}
/* Scrollable panels are focusable in Chrome and a #link focuses them; the
   ring is noise here because the keyboard already moves between panels. */
.panels-on .panel:focus { outline: none; }
@media (max-width: 600px) { .panels-on .wrap { padding-right: 34px; } }
