/* VitalHelm marketing site — no frameworks, no webfonts, system stack.
   Palette mirrors the app (mobile/src/lib/theme.ts). */

:root {
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --ink: #111114;
  --muted: #6D6D72;
  --soft: #757578;
  --border: #ECECEE;
  --brand-a: #E8935B; /* icon gradient: orange */
  --brand-b: #2FBE8C; /* icon gradient: green  */
  --green: #2E9E5B;
  --flame: #FF9500;
  --shadow: 0 10px 30px rgba(17, 17, 20, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F13;
    --card: #1B1B21;
    --ink: #F4F4F6;
    --muted: #9E9EA6;
    --soft: #8E8E96;
    --border: #2B2B33;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; z-index: 100; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* Header */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* min-height + wrap, not a fixed height: with the language picker and the
   longer nav labels (プライバシー, よくある質問…) the row can legitimately
   wrap on phones, and a fixed 64px made the wrapped rows spill over the hero. */
header.site .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
nav.main { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
nav.main a {
  text-decoration: none; color: var(--muted); font-size: 0.95rem;
  padding: 6px 12px; border-radius: 999px;
}
nav.main a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }

/* Language picker — <details>, because the CSP forbids ALL JavaScript
   (script-src 'none'); this is the one dropdown that needs none. Each entry is
   a plain link to that language's static page. */
/* margin-left:auto keeps the picker on the RIGHT edge of whichever header row
   it lands on — the panel is right-anchored, so a far-left summary (wrapped
   mobile row) would otherwise push the panel off the left of the screen. */
.lang { position: relative; margin-left: auto; }
.lang summary {
  list-style: none; cursor: pointer;
  color: var(--muted); font-size: 0.95rem;
  padding: 6px 12px; border-radius: 999px;
  white-space: nowrap;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.lang[open] summary { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.lang nav {
  position: absolute; right: 0; top: calc(100% + 10px);
  display: flex; flex-direction: column; min-width: 170px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 6px; box-shadow: var(--shadow);
  z-index: 60;
}
.lang nav a {
  text-decoration: none; color: var(--muted); font-size: 0.95rem;
  padding: 8px 14px; border-radius: 10px;
}
.lang nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.lang nav a[aria-current] { color: var(--ink); font-weight: 700; }

/* Hero */
.hero { padding: 72px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 18px;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede { font-size: 1.18rem; color: var(--muted); margin: 0 0 26px; max-width: 34em; }
.badge-soon {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--card);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  box-shadow: var(--shadow);
}
.badge-soon .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.hero .sub-note { margin-top: 14px; font-size: 0.9rem; color: var(--soft); }

/* Phone frame */
.phone {
  width: min(300px, 78vw); margin: 0 auto; padding: 10px;
  border-radius: 44px; background: var(--ink);
  box-shadow: var(--shadow);
}
.phone img { border-radius: 34px; width: 100%; height: auto; }
.phone-pair { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.phone-pair .phone { width: min(260px, 70vw); }
.phone-caption { text-align: center; color: var(--soft); font-size: 0.9rem; margin-top: 10px; }

/* Sections */
section.feature { padding: 56px 0; }
section.feature.alt { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.kicker {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem;
  font-weight: 700; color: var(--green); margin: 0 0 8px;
}
section h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; }
section p.body { color: var(--muted); max-width: 44em; margin: 0 0 12px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  padding: 24px; box-shadow: var(--shadow);
}
section.feature.alt .card { background: var(--bg); }
.card .emoji { font-size: 1.7rem; line-height: 1; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }

/* Store-preview gallery: the panels are self-contained posters (headline +
   framed mockup on white), so they get a plain card treatment — never the
   .phone frame, which would put a frame inside a frame. Kept white in dark
   mode on purpose; they read as printed cards. */
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(250px, 66vw);
  gap: 18px;
  margin-top: 32px;
  padding-bottom: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.shots figure { margin: 0; scroll-snap-align: start; }
.shots img {
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Language chips */
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.langs span {
  border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 5px 13px; font-size: 0.88rem; color: var(--muted);
}

/* FAQ */
.faq details {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 4px 20px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style-position: outside; }
.faq details p { color: var(--muted); margin: 0 0 14px; }

/* Legal pages */
.legal { padding: 56px 0 72px; max-width: 760px; }
.legal h1 { font-size: 2rem; letter-spacing: -0.01em; }
.legal h2 { font-size: 1.25rem; margin-top: 36px; }
.legal p, .legal li { color: var(--muted); }
.legal .updated { color: var(--soft); font-size: 0.9rem; }

/* Footer */
footer.site { border-top: 1px solid var(--border); padding: 40px 0 56px; margin-top: 56px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
footer.site .brand img { width: 26px; height: 26px; }
footer.site nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
footer.site a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
footer.site a:hover { color: var(--ink); }
footer.site .fine { width: 100%; color: var(--soft); font-size: 0.85rem; margin-top: 6px; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 80px 20px; }
.notfound img { margin: 0 auto 20px; border-radius: 18px; }
.notfound p { color: var(--muted); }

@media (max-width: 820px) {
  .hero .wrap, .split { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding: 44px 0 28px; }
  .grid3 { grid-template-columns: 1fr; }
  nav.main a { padding: 6px 9px; font-size: 0.88rem; }
  .lang summary { padding: 6px 9px; font-size: 0.88rem; }
}
