/* ============================================================
   apple-health-mcp-server LP — main stylesheet
   All literal values come from tokens.css.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ページ内リンクのスムーススクロール (sticky nav 高 44px + 余白 16px ぶんオフセット) */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-jp);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt" 1;
  letter-spacing: var(--ls-normal);
  position: relative;
  overflow-x: hidden;
}

/* ---------- Background radial blur (decorative) ---------- */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
}
body::before {
  top: -260px;
  right: -260px;
  background: radial-gradient(circle, var(--blur-green), rgba(22,163,74,0) 62%);
}
body::after {
  bottom: -260px;
  left: -260px;
  background: radial-gradient(circle, var(--blur-cyan), rgba(6,182,212,0) 62%);
}

/* ---------- Top thin nav ---------- */
.topnav {
  height: 44px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(251,251,253,0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topnav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  font-family: var(--font-en);
  font-size: var(--fs-micro);
  color: var(--ink);
  font-weight: 500;
}
.topnav-left  { display: flex; align-items: center; gap: 18px; opacity: 0.85; }
.topnav-right { display: flex; align-items: center; gap: 18px; opacity: 0.75; }
.topnav a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--d-fast) ease;
}
.topnav a:hover { opacity: 0.55; }
.topnav-brand { font-weight: 600; letter-spacing: -0.01em; }
.topnav-brand .red-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--health-red);
  margin-right: var(--sp-2);
  vertical-align: middle;
  transform: translateY(-1px);
}

/* ---------- GitHub icon link (nav) ---------- */
.topnav-github {
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
}
.topnav-github svg { display: block; width: 16px; height: 16px; }

/* ---------- Lang toggle button ---------- */
.lang-toggle {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--d-fast) ease, border-color var(--d-fast) ease;
}
.lang-toggle:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Hero shell ---------- */
.hero {
  padding: var(--sp-16) var(--sp-6) var(--sp-24);
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ---------- Headline ---------- */
.headline {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  margin: 0 auto var(--sp-8);
  max-width: 16ch;
  opacity: 0;
  transform: translateY(8px);
  animation: rise var(--d-slow) 50ms ease forwards;
}
.headline .accent {
  background: var(--gradient-text-accent);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* ja は英語より文字密度高いので max-width を緩める (「自分専属のヘルス AI に。」 を 1 行に収めるため) */
/* NOTE: ja では `text-wrap: balance` を使わない (日本語の禁則・約物挙動と balance が衝突して
   想定外の改行が出るため)。 max-width / margin auto による横幅制約だけで体裁を整える。 */
html[lang="ja"] .headline { max-width: 22ch; }
html[lang="ja"] .section-head { max-width: 880px; }
html[lang="ja"] .section-title { max-width: 36ch; margin-left: auto; margin-right: auto; }

/* ---------- Deck ---------- */
.deck {
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  color: var(--muted);
  letter-spacing: 0.001em;
  max-width: 760px;
  margin: 0 auto var(--sp-12);
  opacity: 0;
  transform: translateY(8px);
  animation: rise var(--d-slow) 150ms ease forwards;
}
.deck strong {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Central visual area ---------- */
.visual {
  margin: 0 auto var(--sp-18);
  max-width: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0;
  transform: translateY(8px);
  animation: rise 800ms 250ms ease forwards;
}

/* ---------- Health card ---------- */
.health-card {
  width: 320px;
  background: var(--card);
  border-radius: var(--r-xl);
  padding: var(--sp-6) 22px;
  box-shadow: var(--shadow-lg);
  text-align: left;
  font-family: var(--font-en);
  position: relative;
}
.health-card::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 24px;
  background: #000;
  border-radius: 14px;
  opacity: 0.92;
}
.health-card-inner { padding-top: 28px; }
.health-card-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: var(--sp-1) 0 14px;
}
.health-card-title .summary {
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-caption);
  display: block;
  margin-top: 2px;
  letter-spacing: 0;
}
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-top: 1px solid var(--divider);
}
.metric-row:first-of-type { border-top: none; padding-top: 4px; }
.metric-label { display: flex; align-items: center; gap: 11px; }
.metric-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.metric-icon.heart { background: var(--health-red-bg);   color: var(--health-red); }
.metric-icon.walk  { background: rgba(255,149,0,0.14);   color: #ff9500; }
.metric-icon.sleep { background: rgba(94,92,230,0.14);   color: #5e5ce6; }
.metric-icon.flame { background: rgba(255,69,58,0.12);   color: #ff453a; }
.metric-icon svg { width: 17px; height: 17px; }
.metric-name {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.metric-value {
  font-size: var(--fs-body);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.metric-value .unit {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 3px;
}

/* ---------- HRV mini chart ---------- */
.mini-chart {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}
.mini-chart-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: var(--sp-2);
  display: flex;
  justify-content: space-between;
}
.mini-chart-label strong {
  color: var(--ink);
  font-weight: 600;
}
.mini-chart svg { display: block; width: 100%; height: 32px; }

/* ---------- Connector ---------- */
.connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  color: var(--muted);
  font-family: var(--font-en);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--ls-loose);
  text-transform: uppercase;
}
.connector svg {
  width: 56px;
  height: 14px;
  color: var(--hairline);
}
.connector .label {
  background: var(--bg);
  padding: 0 4px;
}

/* ---------- Hero conversation rotator (user bubble + Claude card) ---------- */
.hero-convo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-3);
  width: 360px;
}
.hero-user-bubble {
  background: var(--divider);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  position: relative;
  align-self: flex-end;
  max-width: 86%;
  box-shadow: var(--shadow-sm);
}
.hero-user-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-en);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--ls-loose);
  text-transform: uppercase;
  color: var(--muted);
}
.hero-user-text {
  margin: var(--sp-1) 0 0;
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  line-height: var(--lh-body);
  color: var(--ink);
}
.hero-claude-bubble { width: 100%; }

/* Fade-rotate transition (controlled by animations.js).
   prefers-reduced-motion is handled globally at the bottom of this file. */
[data-rotate-q],
[data-rotate-a],
[data-rotate-meta] {
  transition:
    opacity var(--d-rotate-fade) var(--ease-out),
    transform var(--d-rotate-fade) var(--ease-out);
}
.hero-convo.is-fading [data-rotate-q],
.hero-convo.is-fading [data-rotate-a],
.hero-convo.is-fading [data-rotate-meta] {
  opacity: 0;
  transform: translateY(4px);
}

/* ---------- Claude reply card ---------- */
.claude-card {
  width: 360px;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px var(--sp-6);
  box-shadow: var(--shadow-lg);
  text-align: left;
  position: relative;
}
.claude-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.claude-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: #d97757;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.claude-name {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.claude-time {
  margin-left: auto;
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--muted);
}
.claude-body {
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  line-height: var(--lh-body);
  color: var(--ink);
}
.claude-body p { margin: 0 0 var(--sp-2); }
.claude-body p:last-child { margin-bottom: 0; }
.claude-body .hi {
  background: linear-gradient(transparent 62%, var(--health-red-underline) 62%);
  padding: 0 1px;
}
.claude-meta {
  margin-top: var(--sp-4);
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  font-family: var(--font-en);
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.claude-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: #34c759;
  display: inline-block;
}

/* ---------- Install code block ---------- */
.install {
  position: relative;
  max-width: 660px;
  margin: 0 auto var(--sp-12);
  background: var(--code-bg);
  border-radius: 14px;
  padding: 20px 22px 20px var(--sp-6);
  box-shadow: var(--shadow-code);
  text-align: left;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: rise var(--d-slow) 350ms ease forwards;
}
.install::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(22,163,74,0.32), rgba(6,182,212,0.18), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.install-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  line-height: 1.9;
  color: var(--code-ink);
  white-space: nowrap;
  overflow-x: auto;
}
.install-row::-webkit-scrollbar { height: 0; }
.install-row + .install-row { margin-top: 2px; }
.prompt   { color: var(--code-mute); user-select: none; }
.cmd-bin  { color: var(--code-cyan); }
.cmd-sub  { color: var(--code-green); }
.cmd-arg  { color: var(--code-amber); }
.cmd-path { color: var(--code-ink); }

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(226, 232, 240, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.10);
  border-radius: var(--r-sm);
  color: rgba(226, 232, 240, 0.55);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover {
  background: rgba(226, 232, 240, 0.14);
  color: rgba(226, 232, 240, 0.95);
  border-color: rgba(226, 232, 240, 0.22);
}
.copy-btn[data-copied="1"] {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}
.copy-btn svg { width: 14px; height: 14px; }

/* ---------- CTA ---------- */
.cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(8px);
  animation: rise var(--d-slow) 450ms ease forwards;
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gradient-primary);
  color: #fff;
  font-family: var(--font-jp);
  font-size: var(--fs-body);
  font-weight: 500;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: var(--r-md);
  letter-spacing: var(--ls-normal);
  box-shadow: var(--shadow-cta-primary);
  transition: background var(--d-fast) ease,
              transform 180ms var(--ease-spring),
              box-shadow 180ms ease;
}
.cta-primary:hover {
  background: var(--gradient-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta-primary-hover);
}
.cta-primary .arrow {
  font-family: var(--font-en);
  font-weight: 400;
  margin-left: 2px;
  transition: transform 200ms ease;
}
.cta-primary:hover .arrow { transform: translateX(3px); }

.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-solid);
  font-family: var(--font-jp);
  font-size: var(--fs-body);
  font-weight: 400;
  text-decoration: none;
  letter-spacing: var(--ls-normal);
  padding: 13px 4px;
  transition: color var(--d-fast) ease;
}
.cta-secondary:hover {
  color: var(--primary-hover-solid);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cta-secondary .arrow {
  font-family: var(--font-en);
  font-weight: 400;
  transition: transform 200ms ease;
}
.cta-secondary:hover .arrow { transform: translateX(3px); }

/* ---------- Entry animation ---------- */
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Generic section shell (used by #why / #use-cases / #install /
   #tools / #privacy / #faq).
   ============================================================ */

.section {
  position: relative;
  z-index: 1;
  padding: var(--sp-24) var(--sp-6);
}
.section + .section { padding-top: var(--sp-18); }
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-head {
  text-align: center;
  margin: 0 auto var(--sp-12);
  max-width: 720px;
}
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-en);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--ls-loose);
  text-transform: uppercase;
  color: var(--primary-solid);
  margin-bottom: var(--sp-3);
}
.section-title {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  margin: 0 0 var(--sp-4);
}
.section-deck {
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  color: var(--muted);
  margin: 0;
}

/* ---------- Entry fade in (IntersectionObserver controlled) ---------- */
[data-fx="rise"] {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--d-slow) var(--ease-out),
    transform var(--d-slow) var(--ease-spring);
}
[data-fx="rise"].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   #2 Why
   ============================================================ */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-6);
}
.why-card {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition:
    transform var(--d-med) var(--ease-spring),
    box-shadow var(--d-med) var(--ease-out),
    border-color var(--d-med) var(--ease-out);
}
.why-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--hairline);
}
.why-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
}
.why-icon svg { width: 22px; height: 22px; }
.why-icon-lock  { background: var(--health-red-bg);  color: var(--health-red); }
.why-icon-stack { background: rgba(22,163,74,0.12);  color: var(--primary-from); }
.why-icon-tools { background: rgba(6,182,212,0.12);  color: var(--primary-to); }
.why-icon-grid  { background: rgba(94,92,230,0.12);  color: #5e5ce6; }
.why-icon-claude { background: rgba(217,119,87,0.14); color: #d97757; }
.why-card-title {
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  color: var(--ink);
  margin: 0 0 var(--sp-2);
  letter-spacing: -0.015em;
}
.why-card-body {
  font-family: var(--font-jp);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--muted);
  margin: 0;
}

/* ============================================================
   #3 Use cases
   ============================================================ */
.usecases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-6);
}
.uc-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition:
    transform var(--d-med) var(--ease-spring),
    box-shadow var(--d-med) var(--ease-out);
}
.uc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.uc-bubble {
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  line-height: var(--lh-body);
}
.uc-bubble p { margin: var(--sp-1) 0 0; }
.uc-bubble-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-en);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--ls-loose);
  text-transform: uppercase;
  color: var(--muted);
}
.uc-bubble-user {
  background: var(--divider);
  color: var(--ink);
}
.uc-bubble-user p { color: var(--ink); }
.uc-bubble-claude {
  background: rgba(22,163,74,0.06);
  border: 1px solid rgba(22,163,74,0.12);
  color: var(--ink);
}
.uc-bubble-claude p { color: var(--ink); }
.uc-bubble-claude .hi {
  background: linear-gradient(transparent 62%, var(--health-red-underline) 62%);
  padding: 0 1px;
}
.uc-bubble-claude code,
.uc-bubble-user code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(15,23,42,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}
.uc-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  background: #d97757;
  color: #fff;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
}
.uc-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--muted);
  letter-spacing: 0;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--divider);
  margin-top: auto;
}

/* ============================================================
   #3.5 Export (reading column with numbered steps + note callout)
   ============================================================ */
.export-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.export-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.export-step {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin: 0;
}
.export-step-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--gradient-primary);
  color: #fff;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: var(--fs-caption);
  line-height: 1;
  box-shadow: var(--shadow-cta-primary);
}
.export-step-label {
  flex: 1 1 auto;
  font-family: var(--font-jp);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink);
  line-height: var(--lh-body);
  padding-top: 3px;
}
.export-note {
  margin: var(--sp-6) 0 0;
  padding: var(--sp-4) 0 0;
  border-top: 1px solid var(--divider);
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  color: var(--muted);
  line-height: var(--lh-body);
}
.export-note code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(15, 23, 42, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
}
@media (max-width: 540px) {
  .export-card { padding: var(--sp-6); }
  .export-step-num { width: 24px; height: 24px; font-size: var(--fs-micro); }
}

/* ============================================================
   #4 Install (tabs + panels)
   ============================================================ */
.install-tabs {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 0 var(--sp-8);
  background: var(--card);
  padding: 6px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--divider);
}
.install-tab {
  background: transparent;
  border: 0;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  font-family: var(--font-en);
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition:
    background var(--d-fast) var(--ease-out),
    color var(--d-fast) var(--ease-out);
}
.install-tab:hover { color: var(--ink); }
.install-tab.is-active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-cta-primary);
}
.install-panels {
  max-width: 760px;
  margin: 0 auto;
}
.install-panel {
  display: none;
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.install-panel.is-active { display: block; }
.install-panel-title {
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: var(--fs-h3);
  color: var(--ink);
  margin: 0 0 var(--sp-4);
  letter-spacing: -0.015em;
}
.install-body {
  font-family: var(--font-jp);
  font-size: var(--fs-body);
  color: var(--ink);
  line-height: var(--lh-body);
  margin: 0 0 var(--sp-4);
}
.install-body code,
.install-note code,
.install-step-label code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(15,23,42,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
}
.install-steps {
  list-style: none;
  counter-reset: install-step;
  margin: 0 0 var(--sp-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.install-steps li { margin: 0; }
.install-step-label {
  font-family: var(--font-jp);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--sp-2);
  line-height: var(--lh-body);
}
.install-note {
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  color: var(--muted);
  line-height: var(--lh-body);
  margin: var(--sp-4) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--divider);
}
.code-block {
  background: var(--code-bg);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 0;
  box-shadow: var(--shadow-code);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--code-ink);
  overflow-x: auto;
}
.code-block code {
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  white-space: pre;
}
.code-block .cmd-comment { color: var(--code-mute); }
.code-block .cmd-key     { color: var(--code-cyan); }
.code-block .cmd-section { color: var(--code-amber); }

/* ============================================================
   #5 Tools
   ============================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-6);
}
.tools-group {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition:
    transform var(--d-med) var(--ease-spring),
    box-shadow var(--d-med) var(--ease-out);
}
.tools-group:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.tools-group-head {
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--divider);
}
.tools-group-title {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 var(--sp-1);
  letter-spacing: -0.01em;
}
.tools-group-desc {
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  color: var(--muted);
  line-height: var(--lh-body);
  margin: 0;
}
.tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tools-list li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--divider);
}
.tools-list li:last-child { border-bottom: 0; }
.tool-name {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--primary-solid);
  letter-spacing: 0;
}
.tool-desc {
  font-family: var(--font-jp);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

/* ============================================================
   #6 Privacy
   ============================================================ */
.privacy-section { text-align: center; }
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin: 0 auto var(--sp-12);
  max-width: 920px;
}
.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-3);
  min-width: 130px;
  box-shadow: var(--shadow-sm);
}
.flow-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.flow-icon svg { width: 20px; height: 20px; }
.flow-icon-export { background: var(--health-red-bg); color: var(--health-red); }
.flow-icon-db     { background: rgba(22,163,74,0.12); color: var(--primary-from); }
.flow-icon-mcp    { background: rgba(6,182,212,0.12); color: var(--primary-to); }
.flow-icon-claude { background: rgba(217,119,87,0.12); color: #d97757; }
.flow-claude-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #d97757;
  color: #fff;
  border-radius: var(--r-sm);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.flow-label {
  font-family: var(--font-jp);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  text-align: center;
  line-height: 1.35;
}
.flow-arrow {
  color: var(--hairline);
  display: flex;
  align-items: center;
}
.flow-arrow svg { width: 40px; height: 14px; }

/* Claude avatar SVG icons (Hero / Use cases / Privacy flow) */
.claude-avatar svg,
.uc-avatar svg,
.flow-claude-avatar svg {
  width: 62%;
  height: 62%;
  display: block;
  color: #fff;
}

.privacy-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-6);
  text-align: left;
}
.privacy-point {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}
.privacy-point-title {
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 var(--sp-2);
  letter-spacing: -0.01em;
}
.privacy-point-body {
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  color: var(--muted);
  line-height: var(--lh-body);
  margin: 0;
}
.privacy-point-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(15,23,42,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}
.privacy-point-body a {
  color: var(--primary-solid);
  text-decoration: none;
  border-bottom: 1px solid var(--primary-solid);
}
.privacy-point-body a:hover { color: var(--primary-hover-solid); }

/* ============================================================
   #7 FAQ
   ============================================================ */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.faq-item {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--d-med) var(--ease-out);
}
.faq-item[open] { box-shadow: var(--shadow-md); }
.faq-q {
  list-style: none;
  cursor: pointer;
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  font-family: var(--font-jp);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink);
  transition: background var(--d-fast) var(--ease-out);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { background: var(--divider); }
.faq-q-text code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(15,23,42,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}
.faq-q-icon {
  width: 16px;
  height: 16px;
  position: relative;
  flex-shrink: 0;
  transition: transform var(--d-med) var(--ease-spring);
}
.faq-q-icon::before,
.faq-q-icon::after {
  content: "";
  position: absolute;
  background: var(--muted);
  border-radius: var(--r-pill);
}
.faq-q-icon::before {
  top: 7px; left: 0;
  width: 16px; height: 2px;
}
.faq-q-icon::after {
  left: 7px; top: 0;
  width: 2px; height: 16px;
  transition: transform var(--d-med) var(--ease-spring);
}
.faq-item[open] .faq-q-icon::after { transform: rotate(90deg); }
.faq-a {
  padding: var(--sp-3) var(--sp-6) var(--sp-4);
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  line-height: var(--lh-body);
  color: var(--muted);
}
.faq-a code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(15,23,42,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}
.faq-a a {
  color: var(--primary-solid);
  text-decoration: none;
  border-bottom: 1px solid var(--primary-solid);
}
.faq-a a:hover { color: var(--primary-hover-solid); }

/* ============================================================
   #8 Footer
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  margin-top: var(--sp-24);
  padding: var(--sp-18) var(--sp-6) var(--sp-8);
  border-top: 1px solid var(--hairline);
  background: rgba(251,251,253,0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: var(--sp-12);
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.footer-col-brand { gap: var(--sp-4); }
.footer-brand {
  font-family: var(--font-en);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.footer-brand .red-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--health-red);
  margin-right: var(--sp-2);
  vertical-align: middle;
  transform: translateY(-1px);
}
.footer-tagline {
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  color: var(--muted);
  line-height: var(--lh-body);
  margin: 0;
  max-width: 280px;
}
.footer-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-en);
  font-size: var(--fs-caption);
  font-weight: 500;
  transition: color var(--d-fast) var(--ease-out);
  width: fit-content;
}
.footer-github:hover { color: var(--ink); }
.footer-github svg { width: 18px; height: 18px; }
.footer-col-title {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-loose);
  color: var(--ink);
  margin: 0 0 var(--sp-2);
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.footer-links a {
  font-family: var(--font-jp);
  font-size: var(--fs-caption);
  color: var(--muted);
  text-decoration: none;
  transition: color var(--d-fast) var(--ease-out);
}
.footer-links a:hover { color: var(--primary-solid); }
.footer-version {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--muted);
}
.footer-base {
  max-width: 1100px;
  margin: var(--sp-12) auto 0;
  padding-top: var(--sp-6);
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: center;
}
.footer-copy {
  font-family: var(--font-jp);
  font-size: var(--fs-micro);
  color: var(--muted);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .visual { flex-direction: column; gap: var(--sp-6); }
  .connector { transform: rotate(90deg); }
  .health-card, .claude-card, .hero-convo { width: 100%; max-width: 360px; }
  .hero { padding: var(--sp-12) 20px var(--sp-18); }
  .install { padding: var(--sp-4) var(--sp-4) var(--sp-4) 18px; }
  .install-row { font-size: 13px; }

  .section { padding: var(--sp-18) 20px; }
  .section + .section { padding-top: var(--sp-12); }
  /* Privacy flow: collapse to a single column with arrows rotated downward. */
  .flow-diagram {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
  }
  .flow-arrow { transform: rotate(90deg); }
  .flow-node { min-width: 0; width: 100%; max-width: 260px; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
  .footer { padding: var(--sp-12) 20px var(--sp-6); }
}

/* ---------- Tablet / mobile: collapse top nav links, keep icon + lang toggle ---------- */
@media (max-width: 768px) {
  .topnav-right a[href^="#"] { display: none; }
  .topnav-inner { padding: 0 var(--sp-4); }
  .topnav-right { gap: 12px; }

  .why-grid,
  .usecases-grid,
  .tools-grid,
  .privacy-points {
    grid-template-columns: 1fr;
  }
  .why-card, .uc-card, .tools-group, .privacy-point {
    padding: var(--sp-6);
  }
  .export-card { padding: var(--sp-6); }
  .faq-q { padding: var(--sp-3) var(--sp-4); }
  .faq-a { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
}

@media (max-width: 560px) {
  .install-tabs { width: 100%; }
  .install-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 8px 10px;
    min-height: var(--touch-target-min);
  }
  .install-panel { padding: var(--sp-6); }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Narrow phones: shrink brand, tighten paddings ---------- */
@media (max-width: 480px) {
  .topnav-brand { font-size: 11px; }
  .topnav-brand .red-dot { width: 6px; height: 6px; margin-right: 6px; }
  .topnav-right { gap: 10px; }

  .hero { padding: var(--sp-8) var(--sp-4) var(--sp-16); }
  .section { padding: var(--sp-16) var(--sp-4); }
  .section + .section { padding-top: var(--sp-12); }

  /* Install tabs: 2x2 grid so 4 tabs stay legible without horizontal cramming.
     Each tab keeps the Apple HIG 44px minimum touch target. */
  .install-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
    padding: var(--sp-2);
    border-radius: var(--r-md);
    width: 100%;
  }
  .install-tab {
    flex: initial;
    width: 100%;
    padding: 10px 12px;
    font-size: var(--fs-caption);
    min-height: var(--touch-target-min);
    border-radius: var(--r-pill);
  }
  .install-panel { padding: var(--sp-4); }
  .code-block { padding: 12px 14px; font-size: 12px; }

  .export-card { padding: var(--sp-4); }
  .export-step { gap: var(--sp-3); }
  .export-step-label { font-size: var(--fs-caption); }

  .cta-row { gap: var(--sp-3); }
  .cta-primary { padding: 12px 22px; }

  .footer { padding: var(--sp-8) var(--sp-4) var(--sp-6); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
