/* ===== Tokens ===== */
:root {
  --bg: #FAFCFB;
  --bg-alt: #F0F6F2;
  --ink: #0C1A14;
  --ink-2: #243A30;
  --ink-3: #5A6E64;
  --line: rgba(12, 26, 20, 0.08);
  --line-2: rgba(12, 26, 20, 0.14);

  /* Corporate green accent */
  --accent-cyan: #1B9E5F;   /* bright corporate green (highlight role) */
  --accent-navy: #14603A;   /* deep forest green */
  --accent-deep: #0E3F27;   /* deepest green */
  --accent-soft: #E2F3E9;   /* light green tint */
  --accent-glow: oklch(0.78 0.13 155);
  --whatsapp: #25D366;
  --whatsapp-dark: #128C7E;

  --serif: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --sans: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --mono: Arial, 'Helvetica Neue', Helvetica, sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 32px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ===== Typography ===== */
.serif { font-family: var(--serif); font-weight: 700; letter-spacing: -0.025em; }
.mono { font-family: var(--mono); font-weight: 700; letter-spacing: 0.04em; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  display: inline-block;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; }
h1 { font-size: clamp(44px, 6.6vw, 104px); }
h2 { font-size: clamp(38px, 5.2vw, 74px); }
h3 { font-size: clamp(26px, 2.9vw, 42px); }

/* Italic emphasis: Arial italic reads weak at display size — keep upright, color-led */
h1 em, h2 em, h3 em { font-style: normal; }

p { color: var(--ink-2); }

/* ===== Layout ===== */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 64px;
}
@media (max-width: 768px) {
  .container { padding: 0 24px; }
}

section {
  position: relative;
  padding: 140px 0;
}
@media (max-width: 768px) {
  section { padding: 88px 0; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}
.btn-wa {
  background: var(--whatsapp);
  color: white;
  box-shadow: 0 8px 24px -8px rgba(37, 211, 102, 0.55);
}
.btn-wa:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -10px rgba(37, 211, 102, 0.6);
  background: #1ebe5a;
}
.btn-primary {
  background: var(--ink);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

/* ===== Reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }
.reveal.delay-5 { transition-delay: 0.4s; }

/* Scroll-driven background tint */
[data-section-bg="alt"] {
  background: var(--bg-alt);
}

/* ===== Placeholder image ===== */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(27, 158, 95, 0.06) 0px,
      rgba(27, 158, 95, 0.06) 1px,
      transparent 1px,
      transparent 14px
    ),
    linear-gradient(135deg, var(--accent-soft) 0%, #F0FAF4 100%);
  border: 1px solid rgba(27, 158, 95, 0.18);
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 20px;
  overflow: hidden;
  isolation: isolate;
}
.placeholder::after {
  content: attr(data-label);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent-navy);
  background: rgba(255,255,255,0.85);
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* ===== Cards ===== */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.4s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -24px rgba(10, 22, 40, 0.18);
  border-color: rgba(27, 158, 95, 0.4);
}

/* ===== Marquee ===== */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 64px;
  animation: marquee 38s linear infinite;
  width: max-content;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ===== Floating orbs ===== */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  animation: orb-float 18s ease-in-out infinite;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
}

/* ===== Grid lines ===== */
.gridlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(10, 22, 40, 0.04) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  z-index: 0;
}

/* ===== Footer ===== */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 40px;
}
footer h4 { font-family: var(--sans); font-size: 13px; font-weight: 600; color: white; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 16px; }
footer a { color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: white; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; }

/* ===== Selection ===== */
::selection { background: var(--accent-cyan); color: white; }

/* ===== Hero headline scaling — applies through tablet (≤900px),
   because the hero grid collapses to one column at 900px ===== */
@media (max-width: 900px) {
  #top h1,
  #top h1 span,
  #top h1 em {
    font-size: clamp(38px, 8.4vw, 80px) !important;
    white-space: normal !important;
  }
  /* Keep "before it's too late." on a single line */
  #top h1 .hero-lastline {
    /*font-size: clamp(24px, 6vw, 64px) !important;*/
    font-size: clamp(32px, 8.5vw, 64px) !important;
    white-space: nowrap !important;
    display: inline-block;
  }
}

/* ===== Responsive line-break toggles ===== */
/* .br-desk shows on desktop, .br-mob shows on phone */
.br-mob { display: none; }
.br-desk { display: inline; }

/* ===== Mobile / Phone (iPhone) ===== */
@media (max-width: 640px) {
  /* Swap which hard breaks are active */
  .br-desk { display: none; }
  .br-mob { display: inline; }
  /* Tighter base */
  body { font-size: 15px; }
  .container { padding: 0 20px; }
  section { padding: 64px 0; }

  /* Type scaling */
  h1 { font-size: clamp(40px, 11vw, 56px) !important; line-height: 1.04; }
  h2 { font-size: clamp(32px, 8vw, 44px) !important; line-height: 1.08; }
  h3 { font-size: clamp(24px, 6vw, 32px) !important; }

  /* Prevent any element from forcing horizontal scroll */
  body, #top, .container { overflow-x: hidden; }
  #top .hero-grid > div { min-width: 0; max-width: 100%; }

  /* Nav — keep logo + WhatsApp; hide everything else */
  header nav { display: none !important; }
  header .btn-ghost { display: none !important; }
  header .container > a:first-child .mono { display: none; }

  /* Buttons full-width-ish */
  .btn { padding: 14px 20px; font-size: 14px; }

  /* Force single-column grids */
  .hero-grid,
  .two-col,
  .screening-grid,
  .docs-grid,
  .support-grid,
  .stay-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .why-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .process-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .process-line { display: none !important; }

  /* Cards — less padding */
  .card { padding: 28px !important; }

  /* Hero — reposition floating chips so they don't overflow */
  #top { padding-top: 110px !important; padding-bottom: 40px !important; }
  #top .hero-grid > div:last-child { min-height: auto !important; }
  #top .hero-grid > div:last-child > div:nth-child(2),
  #top .hero-grid > div:last-child > div:nth-child(3) {
    position: static !important;
    transform: none !important;
    left: auto !important; right: auto !important; bottom: auto !important; top: auto !important;
    margin-top: 12px;
    width: auto !important;
  }

  /* Why Kameda numbers */
  .why-grid > div { padding: 28px 20px !important; min-height: 200px !important; }
  .why-grid > div .why-big { font-size: clamp(40px, 12vw, 56px) !important; }

  /* Screening prices */
  .screening-grid .serif[style*="56"] { font-size: 40px !important; }

  /* Support card pad */
  #support > .container > div { padding: 48px 24px !important; border-radius: 20px !important; }

  /* Final CTA */
  #cta > .container > div { padding: 56px 24px !important; }
  #cta .btn { width: 100%; justify-content: center; }

  /* Floating WhatsApp — smaller, edge offset */
  body > a[aria-label="Chat on WhatsApp"] {
    width: 52px !important; height: 52px !important;
    bottom: 16px !important; right: 16px !important;
  }

  /* Hero image stack */
  #top .hero-grid > div:last-child > div:first-child {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 12px !important;
  }

  /* Stay image grid — keep 2-col below wide */
  #stay .reveal.delay-2 { gap: 10px !important; }

  /* Why Kameda: card titles fit one line, chip values smaller, Newsweek tag fits */
  .why-title { font-size: 17px !important; white-space: nowrap; }
  .why-chip-val { font-size: 14px !important; }
  .why-newsweek { font-size: 8px !important; letter-spacing: 0.08em !important; }
  /* Tighten chip column gaps so 3 values don't crowd */
  #why .why-grid > div > div:last-child { gap: 8px !important; }

  /* Final CTA: allow the one-liner to wrap instead of clipping */
  #cta p { white-space: normal !important; }
}

/* Tablet — keep 2-col where reasonable */
@media (min-width: 641px) and (max-width: 900px) {
  /* Doctors stay single-column so order (Mizukami → Ueshima → Ono) reads top-to-bottom */
  .docs-grid { grid-template-columns: 1fr !important; }
}
