/* Health Tracker site theme — tokens follow the app palette (src/theme.ts) */
:root {
  --bg: #f6f9fc;
  --bg-glass: rgba(255, 255, 255, 0.78);
  --card: #ffffff;
  --card-soft: #f1f5f9;
  --text: #0f1319;
  --sub: #566274;
  --primary: #0a7cff;
  --primary-soft: rgba(10, 124, 255, 0.1);
  --accent: #059669;
  --accent-soft: rgba(5, 150, 105, 0.12);
  --border: #e2e8f0;
  --glow: rgba(10, 124, 255, 0.18);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 19, 25, 0.04), 0 18px 40px -28px rgba(15, 19, 25, 0.35);
  --font-sans: "Raleway", -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-head: "Lora", Georgia, "Noto Serif JP", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --bg-glass: rgba(11, 15, 20, 0.78);
    --card: #141a22;
    --card-soft: #1a222c;
    --text: #f1f4f8;
    --sub: #9ba7b6;
    --primary: #4da3ff;
    --primary-soft: rgba(77, 163, 255, 0.14);
    --accent: #34d399;
    --accent-soft: rgba(52, 211, 153, 0.14);
    --border: #26303c;
    --glow: rgba(77, 163, 255, 0.22);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -28px rgba(0, 0, 0, 0.9);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* soft light wash behind the hero so the page does not read as a flat sheet */
body::before {
  content: "";
  position: fixed;
  inset: -20% 0 auto 0;
  height: 620px;
  background:
    radial-gradient(50% 60% at 20% 0%, var(--glow), transparent 70%),
    radial-gradient(40% 50% at 85% 10%, var(--accent-soft), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
header.site .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  flex-wrap: wrap;
}
header.site img { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--shadow); }
header.site .brand { font-weight: 700; letter-spacing: -0.01em; }
header.site nav { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
header.site nav a {
  color: var(--sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  transition: color 0.2s, background-color 0.2s;
}
header.site nav a:hover { color: var(--text); background: var(--card-soft); }

a { color: var(--primary); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.015em; }
h2[id], section[id] { scroll-margin-top: 84px; }
h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.12; margin: 0 0 18px; font-weight: 600; }
h2 { font-size: clamp(22px, 3vw, 30px); line-height: 1.25; margin: 64px 0 10px; font-weight: 600; }
h3 { font-size: 17px; margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--sub); }
.muted { color: var(--sub); font-size: 14px; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding: 64px 0 40px;
}
.hero-copy .lead { max-width: 560px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 20px;
}
.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.cta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 26px 0 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 10px 24px -12px var(--primary);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -14px var(--primary); }
.btn svg { width: 18px; height: 18px; }
.btn.ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 600;
}
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }

.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--sub); font-size: 13px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--border); }

.hero-visual { position: relative; display: flex; justify-content: center; gap: 18px; }
.hero-visual img {
  width: 46%;
  min-width: 130px;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--card);
}
.hero-visual img:last-child { transform: translateY(26px) rotate(1.5deg); }

/* ---------- download card ---------- */
.download {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 32px;
  margin: 16px 0 8px;
  box-shadow: var(--shadow);
}
.download h2 { margin: 0 0 10px; font-size: clamp(21px, 2.6vw, 26px); }
.download .btn { width: 100%; justify-content: center; }
.download .facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.download .facts li {
  margin: 0;
  background: var(--card-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--sub);
}
.download .facts b { display: block; color: var(--text); font-size: 15px; font-family: var(--font-sans); }
.install-note { font-size: 13px; color: var(--sub); margin: 14px 0 0; }

/* ---------- content blocks ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--sub); font-size: 15px; }
.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 12px;
}
.card .icon svg { width: 20px; height: 20px; }

ol.steps { list-style: none; padding: 0; margin: 16px 0 0; counter-reset: step; }
ol.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 46px;
  color: var(--sub);
  margin: 0;
}
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.steps li::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 2px;
  width: 1px;
  background: var(--border);
}
ol.steps li:last-child { padding-bottom: 0; }
ol.steps li:last-child::after { display: none; }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 240px)); gap: 20px; }
.shots figure { margin: 0; }
.shots img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
  background: var(--card);
}
.shots figcaption { font-size: 13px; color: var(--sub); margin-top: 10px; }

.notice {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 14px 14px 0;
  margin: 18px 0;
}
.notice p:last-child { margin-bottom: 0; }

ol, ul { padding-left: 22px; }
li { margin-bottom: 8px; }

footer.site {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  padding: 28px 0 52px;
  color: var(--sub);
  font-size: 14px;
}
footer.site .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
footer.site a { color: var(--sub); text-decoration: none; }
footer.site a:hover { color: var(--primary); }
footer.site p { margin: 0 0 0 auto; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 44px; }
  .hero-visual img { width: 44%; }
  .download { grid-template-columns: 1fr; padding: 24px; }
  footer.site p { margin-left: 0; }
}

@media (max-width: 560px) {
  /* keep the sticky header to two compact rows: policy links stay reachable in the footer */
  header.site .wrap { flex-wrap: nowrap; }
  header.site nav { flex-wrap: nowrap; gap: 4px; }
  header.site nav a { padding: 6px 8px; }
  header.site .brand { white-space: nowrap; }
  /* phones: the page is short — nav links live in the hero CTA and the footer, keep brand + language toggle */
  header.site nav a { display: none; }
  header.site nav a, button.lang { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .card, header.site nav a { transition: none; }
  .card:hover, .btn:hover { transform: none; }
}

/* language toggle: scope to body descendants so the <html lang> attribute itself is never hidden */
body [lang="ja"] { display: none; }
html[data-lang="ja"] body [lang="ja"] { display: revert; }
html[data-lang="ja"] body [lang="en"] { display: none; }
