/* ==========================================================================
   HealMent — landing page styles
   Calm, quick to load, no external fonts or libraries.
   ========================================================================== */

:root {
  /* Dark theme (default) */
  --bg: #0e1020;
  --bg-raised: #151830;
  --bg-sunken: #0a0c19;
  --panel: #f3f1ff;            /* light surface used behind illustrations in both themes */
  --ink: #f4f4fb;
  --ink-muted: #a6a9c4;
  --line: #262a4a;
  --accent: #8b8cf8;
  --accent-strong: #6d6ef0;
  --on-accent: #0e1020;
  --focus: #a5a6ff;
  --shadow: 0 1px 2px rgb(0 0 0 / .25), 0 8px 24px -8px rgb(0 0 0 / .45), 0 24px 48px -16px rgb(0 0 0 / .4);

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 28px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --wrap: 1180px;
}

[data-theme="light"] {
  --bg: #fbfaff;
  --bg-raised: #ffffff;
  --bg-sunken: #f1efff;
  --panel: #efecff;
  --ink: #14162b;
  --ink-muted: #565a78;
  --line: rgb(20 22 43 / .1);
  --accent: #4b4bd8;
  --accent-strong: #3a3ac2;
  --on-accent: #ffffff;
  --focus: #4b4bd8;
  --shadow: 0 1px 2px rgb(20 22 43 / .05), 0 8px 24px -8px rgb(20 22 43 / .1), 0 24px 48px -16px rgb(20 22 43 / .12);
}

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

html {
  font-family: var(--font);
  font-synthesis: none;
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: thin;
  scrollbar-color: rgb(127 127 127 / .35) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(127 127 127 / .35); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgb(127 127 127 / .55); }
::-webkit-scrollbar-corner { background: transparent; }

body {
  min-height: 100vh;
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.6;
  overflow-x: hidden;
  background: var(--bg);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { list-style: none; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.75rem); }
h3 { font-size: 1.25rem; line-height: 1.25; }
p { color: var(--ink-muted); text-wrap: pretty; max-width: 62ch; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

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

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: .6rem 1rem; border-radius: var(--radius-s); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: 0 1.5rem;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, scale .15s ease-out;
}
.btn:active { scale: .97; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-small { min-height: 40px; padding: 0 1.1rem; font-size: .9375rem; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: color-mix(in oklch, var(--accent) 88%, white); }
  .btn-ghost:hover { border-color: var(--accent); }
}

.text-link {
  color: var(--ink); font-weight: 600; cursor: pointer; background: none; border: 0;
  text-decoration: underline; text-decoration-color: color-mix(in oklch, currentColor 35%, transparent);
  text-decoration-thickness: from-font; text-underline-offset: .2em;
}
.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklch, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 4.25rem; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.brand img, .footer-logo { object-fit: contain; background: #f3f1ff; padding: 5px; }
.brand img { width: 38px; height: 38px; border-radius: 11px; }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { color: var(--ink-muted); font-weight: 500; font-size: 1rem; padding: .5rem 0; transition: color .15s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: .6rem; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer;
  color: var(--ink); transition: border-color .15s ease, scale .15s ease-out;
}
.icon-btn:active { scale: .94; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.menu-toggle { display: none; }

/* ---------- Sections ---------- */
section { padding-block: 6rem; }
.hero { padding-block: 4.5rem 6rem; }

/* Below-the-fold sections render only when near the screen */
.defer { content-visibility: auto; contain-intrinsic-size: auto 720px; }

.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 5rem; }
.split.flip > :first-child { order: 2; }
.split-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.split-copy > p { font-size: 1.125rem; }

.center-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem; margin-bottom: 3.5rem; }
.center-head p { margin-inline: auto; }

/* ---------- Hero ---------- */
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 4rem; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; }
.hero-copy p { font-size: 1.25rem; max-width: 34ch; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; margin-top: .5rem; }

.store-row { display: flex; flex-wrap: wrap; gap: .9rem; }
.store-badge {
  display: inline-flex; align-items: center; gap: .8rem; min-height: 58px; padding: .5rem 1.3rem;
  border-radius: var(--radius-m); background: #0b0b12; color: #fff; border: 1px solid #3a3d5c;
  transition: border-color .15s ease, scale .15s ease-out;
}
[data-theme="light"] .store-badge { border-color: #0b0b12; }
.store-badge:active { scale: .97; }
.store-badge:hover { border-color: var(--accent); }
.store-badge svg { width: 28px; height: 28px; fill: currentColor; flex-shrink: 0; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-badge small { font-size: .8125rem; color: #c9cbe0; }
.store-badge strong { font-size: 1.1875rem; font-weight: 600; }

.hero-visual { position: relative; display: grid; place-items: center; }

/* ---------- Phone screenshots (each image already includes its own phone frame) ---------- */
.phone { position: relative; width: 100%; max-width: 360px; margin-inline: auto; }
.phone img { width: 100%; height: auto; filter: drop-shadow(0 24px 32px rgb(0 0 0 / .28)); }

/* ---------- Animated illustration panel ---------- */
.art {
  position: relative; width: 100%; max-width: 520px; margin-inline: auto;
  aspect-ratio: 4 / 3; border-radius: var(--radius-l);
  background: var(--panel); overflow: hidden;           /* clipping a flat panel, not a rotating face */
  box-shadow: var(--shadow);
}
.lottie { position: absolute; inset: 4%; }
.lottie svg { width: 100%; height: 100%; }

/* ---------- Checklist ---------- */
.ticks { display: flex; flex-direction: column; gap: 1rem; }
.ticks li { display: grid; grid-template-columns: 24px 1fr; gap: .8rem; color: var(--ink-muted); }
.ticks li strong { color: var(--ink); font-weight: 600; }
.ticks svg { width: 22px; height: 22px; margin-top: 3px; color: var(--accent); }

/* ---------- Pills (used in the phone scan dialog) ---------- */
.chip {
  min-height: 44px; padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-muted); font-size: 1rem; font-weight: 500; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, scale .15s ease-out;
}
.chip:active { scale: .97; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem 2.5rem; }
.feature { display: flex; flex-direction: column; gap: .75rem; }
.feature img { width: 56px; height: 56px; margin-bottom: .25rem; }
.feature p { font-size: 1.0625rem; }

/* ---------- Final call ---------- */
.cta { padding-block: 6rem 7rem; }
.cta-card {
  display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 3rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 4rem; box-shadow: var(--shadow);
}
.cta-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.cta-copy p { font-size: 1.125rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-sunken); padding-block: 3.5rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; }
.footer-logo { width: 60px; height: 60px; border-radius: 16px; padding: 7px; }
.footer-copy { color: var(--ink-muted); font-size: 1rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.75rem; }
.footer-nav a { color: var(--ink-muted); min-height: 44px; display: inline-flex; align-items: center; transition: color .15s ease; }
.footer-nav a:hover { color: var(--ink); }
.footer-credit { color: var(--ink-muted); font-size: 1rem; max-width: 48ch; line-height: 1.7; }
.footer-credit a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in oklch, currentColor 35%, transparent); text-decoration-thickness: from-font; text-underline-offset: .2em; }
.footer-credit a:hover { text-decoration-color: currentColor; }

/* ---------- Plain pages (privacy, terms, contact) ---------- */
.page { padding-block: 4.5rem 6rem; }
.page-head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 3rem; max-width: 46rem; }
.page-head p { font-size: 1.1875rem; }
.doc { max-width: 46rem; display: flex; flex-direction: column; gap: 2.5rem; }
.doc section { padding: 0; }
.doc h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.doc p, .doc li { color: var(--ink-muted); }
.doc ul { display: flex; flex-direction: column; gap: .5rem; padding-inline-start: 1.25rem; list-style: disc; margin-top: .75rem; }
.doc a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in oklch, currentColor 35%, transparent); text-underline-offset: .2em; }
.doc a:hover { text-decoration-color: currentColor; }
.doc .updated { font-size: .9375rem; }

.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; max-width: 56rem; }
.contact-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: .75rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.75rem;
}
.contact-card .btn { margin-top: .5rem; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1.5rem;
  background: rgb(5 6 15 / .7); opacity: 0; visibility: hidden;
  transition: opacity .2s var(--ease), visibility 0s .2s;
}
.modal.open { opacity: 1; visibility: visible; transition: opacity .2s var(--ease); }
.modal-box {
  position: relative; width: 100%; max-width: 440px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-l); padding: 2.25rem 2rem 2rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: center;
  opacity: 0; transform: scale(.97); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.modal.open .modal-box { opacity: 1; transform: none; }
.modal-close { position: absolute; top: .75rem; right: .75rem; }
.modal-tabs { display: flex; gap: .5rem; width: 100%; }
.modal-tabs .chip { flex: 1; }
.qr { background: #fff; padding: 1rem; border-radius: var(--radius-m); }
.qr img { width: 180px; height: 180px; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90;
  background: var(--accent); color: var(--on-accent); border-color: transparent;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  section { padding-block: 5rem; }
  .hero-grid, .split, .cta-card { grid-template-columns: 1fr; gap: 3rem; }
  .split.flip > :first-child { order: 0; }
  .hero-copy, .hero-actions, .split-copy, .cta-copy { align-items: center; text-align: center; }
  .hero-copy p, .split-copy > p, .cta-copy p { margin-inline: auto; }
  .ticks { text-align: left; }
  .store-row { justify-content: center; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-card { padding: 3rem 2rem; }
  .art { max-width: 440px; }
}

/* ---------- Phone ---------- */
@media (max-width: 768px) {
  section { padding-block: 4rem; }
  .hero { padding-block: 2.5rem 4rem; }
  .wrap { padding-inline: 1.25rem; }

  .menu-toggle { display: inline-grid; }
  .nav-links {
    position: fixed; top: 4.25rem; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem;
    transform: translateY(-110%); visibility: hidden;
    transition: transform .25s var(--ease), visibility 0s .25s;
  }
  .nav-links.open { transform: none; visibility: visible; transition: transform .25s var(--ease); }
  .nav-links a { min-height: 48px; display: flex; align-items: center; font-size: 1.125rem; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child a { border-bottom: 0; }
  .nav-actions .btn { display: none; }

  .store-row { flex-direction: column; width: 100%; max-width: 320px; }
  .store-badge { justify-content: center; width: 100%; }
  .feature-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .art { aspect-ratio: 4 / 3; border-radius: var(--radius-m); }
  .cta-card { padding: 2.5rem 1.25rem; }
  .phone { max-width: 300px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
