/* GlucoHelm 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); }
/* Store badges — the classic black download badges, one per store, both
   exactly the same size. Fixed dark ground + white ink in BOTH themes
   (like the real store badges; white on #14161B is ~15:1); the faint
   white border is what separates them from the dark theme's background. */
.store-cta { margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  display: flex; align-items: center; gap: 11px;
  width: 210px; max-width: 100%; box-sizing: border-box;
  background: #14161B; color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px; padding: 9px 16px 10px;
  text-decoration: none; box-shadow: var(--shadow);
}
.store-badge:hover { text-decoration: none; background: #20242C; }
/* Pre-launch badges: same shape, but they are <span>s, so they must not offer
   any affordance of a link. Dimmed rather than restyled so the two badges stay
   recognisably App Store / Google Play. Remove `.soon` at launch. */
.store-badge.soon { opacity: 0.66; cursor: default; }
.store-badge.soon:hover { background: #14161B; }
.store-badge svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.store-badge .logo-apple, .store-badge svg.logo-apple { width: 26px; height: 26px; }
.badge-lines { display: flex; flex-direction: column; line-height: 1.16; min-width: 0; }
.badge-lead { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.02em; opacity: 0.82; }
.badge-name { font-size: 1.06rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.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; }

/* Contact form. No JavaScript anywhere on this site (CSP: script-src 'none'),
   so validation is the browser's own (required / type="email" / maxlength) and
   success is a navigation to /thanks/ rather than an inline message. */
section.feature.contact { background: var(--card); border-top: 1px solid var(--border); }
/* The app-icon gradient, orange into green, on the same diagonal the icon uses.
   Type on it is DARK, not white: white measures ~2.4:1 against these two
   values, dark ink ~7:1 (the finding that made .store-badge pin a dark ground).
   Fixed colours, so the panel is identical in both colour schemes. */
.cpanel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 64px 24px 56px;
  text-align: center;
  background: linear-gradient(135deg, var(--brand-a) 0%, #D8A96A 42%, var(--brand-b) 100%);
}
.cpanel .kicker { color: rgba(17, 17, 20, 0.82); }
.cpanel h2 { color: #111114; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cpanel p.body { color: rgba(17, 17, 20, 0.76); max-width: 34em; margin: 0 auto; }
.cform { max-width: 560px; margin: 34px auto 0; text-align: left; }
/* Honeypot: off the canvas and out of the tab order, so only a script that
   fills every field will tick it. Not display:none — some bots skip those. */
.cf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cf-label { display: block; font-size: 0.85rem; font-weight: 600; color: rgba(17, 17, 20, 0.72); margin: 14px 0 6px; }
/* Fixed colours, not themed tokens — these sit on the brand gradient, which is
   the same in both colour schemes. */
.cf-field {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: 0.98rem; color: #111114;
  background: #FFFFFF; border: 1px solid transparent; border-radius: 14px;
  padding: 13px 15px;
}
.cf-field::placeholder { color: #8A8F98; }
.cf-field:focus-visible { outline: none; border-color: #111114; box-shadow: 0 0 0 3px rgba(17, 17, 20, 0.28); }
textarea.cf-field { resize: vertical; min-height: 132px; }
/* Dark button on the bright panel — the same #14161B the store badges use, and
   the highest-contrast pairing available against the gradient. */
.cf-submit {
  margin-top: 20px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-size: 1rem; font-weight: 700; color: #FFFFFF; cursor: pointer;
  background: #14161B; border: 0; border-radius: 999px; padding: 15px 22px;
  box-shadow: 0 10px 30px rgba(17, 17, 20, 0.22);
}
.cf-submit svg { width: 18px; height: 18px; flex: none; }
.cf-submit:hover { background: #20242C; }
.cf-submit:focus-visible { outline: 3px solid #111114; outline-offset: 3px; }
.cf-note { color: rgba(17, 17, 20, 0.8); font-size: 0.85rem; margin: 14px 0 0; text-align: center; }

/* Contact-form success page */
.thanks { padding: 72px 0 96px; }
.thanks h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.2; margin: 0 0 12px; }

/* 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; }
}

@media (max-width: 520px) {
  .cf-row { grid-template-columns: 1fr; }
  .cpanel { padding: 44px 18px 40px; border-radius: 22px; }
}
