/* Hinata — landing page styles */

:root {
  /* warm gold palette (default) */
  --bg: #F7F4EE;
  --bg-soft: #F1ECE2;
  --bg-deep: #E9E2D2;
  --fg: #1A1A1A;
  --fg-mute: #5C5648;
  --fg-faint: #8A8170;
  --line: rgba(26, 26, 26, 0.08);
  --line-strong: rgba(26, 26, 26, 0.14);
  --gold: #B8924A;
  --gold-soft: #E6CC8A;
  --gold-deep: #8B6B2E;
  --accent: #1A1A1A;
  --card: #FFFFFFCC;
  --card-solid: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(40, 30, 10, 0.04), 0 1px 1px rgba(40, 30, 10, 0.03);
  --shadow-md: 0 10px 30px -12px rgba(40, 30, 10, 0.18), 0 2px 6px rgba(40, 30, 10, 0.05);
  --shadow-lg: 0 30px 60px -20px rgba(40, 30, 10, 0.22), 0 10px 20px -10px rgba(40, 30, 10, 0.1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

[data-dark="true"] {
  --bg: #14110C;
  --bg-soft: #1B1812;
  --bg-deep: #221E16;
  --fg: #F5F1E8;
  --fg-mute: #B5AC9A;
  --fg-faint: #7A7263;
  --line: rgba(245, 241, 232, 0.08);
  --line-strong: rgba(245, 241, 232, 0.16);
  --gold: #E6CC8A;
  --gold-soft: #F4DDA8;
  --gold-deep: #B8924A;
  --accent: #F5F1E8;
  --card: rgba(34, 30, 22, 0.7);
  --card-solid: #1B1812;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 10px 20px -10px rgba(0, 0, 0, 0.4);
}

/* alternate palettes (selectable via tweaks) */
[data-palette="copper"] {
  --gold: #C8773D;
  --gold-soft: #E8A86B;
  --gold-deep: #8E5024;
  --bg: #FBF7F1;
  --bg-soft: #F4EDE0;
  --bg-deep: #ECE2CE;
}
[data-palette="coral"] {
  --gold: #E07856;
  --gold-soft: #F2B89C;
  --gold-deep: #B4543A;
  --bg: #FCF6F2;
  --bg-soft: #F6EDE5;
  --bg-deep: #EFE2D5;
}
[data-palette="amber"] {
  --gold: #D4A574;
  --gold-soft: #F4D5A8;
  --gold-deep: #A47A48;
  --bg: #FAF6F0;
  --bg-soft: #F2EBDD;
  --bg-deep: #E9DFCB;
}

/* density */
[data-density="spacious"] { --sec-py: 160px; --container-px: 64px; }
[data-density="regular"]  { --sec-py: 112px; --container-px: 56px; }
[data-density="compact"]  { --sec-py: 80px;  --container-px: 48px; }

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

.mono {
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-feature-settings: 'ss02';
}

.serif {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  letter-spacing: -0.02em;
}

/* Containers */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}
.container-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

section { padding-top: var(--sec-py); padding-bottom: var(--sec-py); position: relative; }

/* Typography scale */
.eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
}
h1 { font-size: clamp(48px, 6vw, 80px); letter-spacing: -0.03em; }
h2 { font-size: clamp(36px, 4.5vw, 56px); }
h3 { font-size: clamp(22px, 2vw, 28px); line-height: 1.2; }
h4 { font-size: 18px; line-height: 1.3; }

p { margin: 0; color: var(--fg-mute); text-wrap: pretty; }
.lede { font-size: 19px; line-height: 1.55; color: var(--fg-mute); max-width: 56ch; }
.small { font-size: 13px; color: var(--fg-faint); }

a { color: inherit; text-decoration: none; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-links { display: flex; gap: 36px; }
.nav-links a {
  font-size: 14px;
  color: var(--fg-mute);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--fg); }

/* Logo */
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--gold);
  color: #1A1A1A;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 18px;
  font-weight: 600;
  align-self: center;
  letter-spacing: 0;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--fg-faint); }
.btn-ghost {
  background: transparent;
  color: var(--fg-mute);
  padding: 12px 14px;
}
.btn-ghost:hover { color: var(--fg); }
.btn-lg { padding: 16px 26px; font-size: 15px; border-radius: 12px; }

/* Pill / chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--fg-mute);
}
.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

/* Grid lines / decorations */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
}

.fade-edge-b {
  background: linear-gradient(to bottom, transparent, var(--bg));
}

/* Hero glow */
.sun-glow {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--gold) 30%, transparent) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  opacity: 0.6;
}

/* Mobile mock device */
.phone {
  width: 320px;
  height: 660px;
  border-radius: 44px;
  background: #1A1A1A;
  padding: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.4);
  position: relative;
  flex-shrink: 0;
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  background: #fff;
  overflow: hidden;
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 26px;
  border-radius: 999px;
  background: #1A1A1A;
  z-index: 10;
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Stripes for placeholder imagery */
.placeholder-stripes {
  background-image: repeating-linear-gradient(
    45deg,
    color-mix(in oklab, var(--gold) 14%, transparent),
    color-mix(in oklab, var(--gold) 14%, transparent) 2px,
    transparent 2px,
    transparent 10px
  );
  background-color: var(--bg-soft);
  border: 1px dashed color-mix(in oklab, var(--gold) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-deep);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* keyframes */
@keyframes pulse-soft {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes rotate-slow {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-soft) 0%,
    color-mix(in oklab, var(--gold) 30%, var(--bg-soft)) 50%,
    var(--bg-soft) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2.5s linear infinite;
}

/* Marquee for logos */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track { animation: marquee 40s linear infinite; display: flex; gap: 80px; width: max-content; }

/* Custom scrollbar in mock */
.scroll-soft::-webkit-scrollbar { width: 4px; }
.scroll-soft::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.scroll-soft::-webkit-scrollbar-track { background: transparent; }

/* Section divider */
.divider {
  height: 1px;
  background: var(--line);
  margin: 0 auto;
  max-width: 1152px;
}

/* Patient view internals */
.pv-body { font-family: 'Geist', sans-serif; color: #1A1A1A; }
.pv-section { padding: 20px 18px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.pv-section h5 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #8B6B2E; margin: 0 0 10px; }

/* Step number */
.step-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 32px;
  color: var(--gold-deep);
  line-height: 1;
}

/* Underline link */
.ul {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}
.ul:hover { border-bottom-color: var(--fg); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Responsive — tablet & mobile                                                */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Tablet: tighten containers, soften some grids */
@media (max-width: 1024px) {
  [data-density="spacious"] { --sec-py: 112px; --container-px: 40px; }
  [data-density="regular"]  { --sec-py: 96px;  --container-px: 36px; }
  [data-density="compact"]  { --sec-py: 72px;  --container-px: 32px; }

  /* Features bento: 6 cols → 3 cols, all spans reduce */
  #features [style*="grid-template-columns"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
  #features [style*="span 4"] { grid-column: span 3 !important; }
  #features [style*="span 2"] { grid-column: span 3 !important; }

  /* Footer: 5 cols → 3 */
  footer .container > div:first-of-type {
    grid-template-columns: 1.5fr 1fr 1fr 1fr !important;
    gap: 32px !important;
  }

  /* Patient view 3-col → narrower annotations */
  #patient [style*="grid-template-columns"][style*="auto"] {
    gap: 24px !important;
  }

  /* Hero phone scale + chip outside positions */
  section[id="top"] [style*="grid-template-columns"] {
    gap: 48px !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --container-px: 20px !important;
  }
  [data-density="spacious"], [data-density="regular"], [data-density="compact"] {
    --sec-py: 72px !important;
    --container-px: 20px !important;
  }

  body { font-size: 15px; }

  /* Typography */
  h1 { font-size: clamp(36px, 9vw, 48px) !important; letter-spacing: -0.025em !important; }
  h2 { font-size: clamp(28px, 7vw, 36px) !important; }
  h3 { font-size: 20px !important; }
  .lede { font-size: 16px !important; }

  /* Containers */
  .container, .container-narrow {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Buttons */
  .btn-lg { padding: 12px 18px !important; font-size: 14px !important; }

  /* Nav — hide center links on mobile, keep logo + dark toggle + CTA */
  .nav-links { display: none !important; }
  .nav-inner { height: 60px !important; }
  .nav .btn-primary { padding: 9px 14px !important; font-size: 13px !important; }

  /* Hero trust strip — hide on mobile (too crowded) */
  .hero-trust-strip { display: none !important; }
  .nav .btn-primary svg { display: none !important; }

  /* Collapse every inline 2- or 3-col grid to a single column */
  section [style*="grid-template-columns"],
  footer [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  /* Reset inline column spans */
  [style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }
  /* Reset inline lifted middle pricing card */
  #pricing [style*="translateY"] { transform: none !important; }

  /* ── Hero ─────────────────────────────────────────── */
  section[id="top"] .card,
  section[id="top"] [style*="rotate-slow"] {
    display: none !important;
  }
  section[id="top"] .phone {
    transform: scale(0.92);
    transform-origin: top center;
    margin: 0 auto;
  }
  /* Trust strip — wrap nicely */
  section[id="top"] [style*="border-top"][style*="flex-wrap"] {
    gap: 24px !important;
    margin-top: 56px !important;
  }

  /* ── Problem ──────────────────────────────────────── */
  /* Un-sticky the morph visual; let it scroll naturally below the stats */
  #problem [style*="sticky"] {
    position: static !important;
    height: auto !important;
    min-height: 520px !important;
  }
  /* Shrink the invoice + Hinata mock so they fit */
  #problem [style*="width: 380"] {
    width: 280px !important;
    transform: scale(0.9) !important;
  }
  /* Stat numbers stay readable */
  #problem .serif[style*="font-size: 56"] { font-size: 44px !important; }

  /* ── How it works ─────────────────────────────────── */
  #how [style*="grid-template-columns"][style*="repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  /* Mini-card minHeight relaxed */
  #how [style*="min-height"] { min-height: auto !important; }

  /* ── Patient view ─────────────────────────────────── */
  /* Drop the two annotation rails on mobile; phone alone tells the story */
  #patient [style*="grid-template-columns"][style*="auto"] > div:first-child,
  #patient [style*="grid-template-columns"][style*="auto"] > div:last-child {
    display: none !important;
  }
  /* Bottom analytics block — stack */
  #patient [style*="margin-top: 80"] [style*="gap: 24"] {
    gap: 16px !important;
  }
  /* Make phone center properly */
  #patient .phone {
    margin: 0 auto;
  }

  /* ── ROI ──────────────────────────────────────────── */
  #roi [style*="padding: 36px 40px"] {
    padding: 24px 20px !important;
  }
  #roi .serif[style*="font-size: 72"] { font-size: 56px !important; }
  #roi .serif[style*="font-size: 40"] { font-size: 32px !important; }

  /* ── Features ─────────────────────────────────────── */
  #features [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  #features [style*="min-height: 260"] {
    min-height: auto !important;
    padding: 24px !important;
  }

  /* ── Trust ────────────────────────────────────────── */
  /* Compliance row collapses to two-col on mobile */
  #features + section [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* ── Pricing ──────────────────────────────────────── */
  #pricing [style*="repeat(3"] { gap: 16px !important; }

  /* ── Final CTA ────────────────────────────────────── */
  #trial form {
    flex-direction: column !important;
    border-radius: 12px !important;
  }
  #trial form input {
    width: 100% !important;
    text-align: center;
  }
  #trial form button {
    width: 100%;
    justify-content: center !important;
  }

  /* ── Footer ───────────────────────────────────────── */
  footer .container > div:first-of-type {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  footer .container > div:first-of-type > div:first-child {
    grid-column: 1 / -1 !important;
    margin-bottom: 8px;
  }
  footer [style*="margin-top: 80"] {
    margin-top: 40px !important;
    padding-top: 24px !important;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* Big serif accents — guard against overflow */
  .serif { word-break: keep-all; overflow-wrap: anywhere; }
}

/* Very narrow phones */
@media (max-width: 380px) {
  #problem [style*="width: 380"] {
    width: 240px !important;
    transform: scale(0.78) !important;
  }
  section[id="top"] .phone {
    transform: scale(0.86);
  }
  h1 { font-size: 34px !important; }
  .btn-lg { padding: 11px 16px !important; }
}

