/* PillMe marketing site — modern, privacy-first, product-led */

:root {
  --brand: #2D6CDF;
  --brand-dark: #1E4FB2;
  --brand-muted: #EAF0FF;
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --border: #E5E9F0;
  --ink: #0A0E1A;
  --text: #1A2A4A;
  --mute: #6B7280;
  --success: #16A34A;
  --warn: #D97706;
  --danger: #DC2626;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 14, 26, 0.04), 0 10px 30px rgba(10, 14, 26, 0.08);
  --shadow-lg: 0 20px 60px rgba(45, 108, 223, 0.2);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--ink); letter-spacing: -0.01em; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.section-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 248, 251, 0.85);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none !important;
}
.brand-mark { display: inline-flex; }
.brand-logo {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 10px;
}
.foot-brand .brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-links a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Pill label */
.pill-label {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-muted);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-sm { padding: 6px 14px; font-size: 0.88rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-primary { background: var(--brand); color: white; box-shadow: var(--shadow-lg); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }

/* Hero */
.hero {
  padding: 80px 24px 40px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -160px;
  right: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(45, 108, 223, 0.18), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.accent { color: var(--brand); }
.lead {
  color: var(--mute);
  font-size: 1.15rem;
  max-width: 540px;
  margin-top: 14px;
}
.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.trust-row {
  margin-top: 28px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(45, 108, 223, 0.06);
  border: 1px solid rgba(45, 108, 223, 0.14);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.18s ease;
}
.trust-item:hover { background: rgba(45, 108, 223, 0.10); }

/* Phone stack in hero */
.hero-art { display: flex; justify-content: center; position: relative; }
.phone-stack {
  position: relative;
  width: 420px;
  height: 540px;
  perspective: 1200px;
}
.phone {
  position: absolute;
  width: 260px;
  filter: drop-shadow(0 30px 60px rgba(10, 14, 26, 0.18));
  transition: transform 0.5s ease;
  border-radius: 44px;
}
.phone-back {
  left: 20px;
  top: 40px;
  transform: rotate(-9deg);
}
.phone-front {
  right: 20px;
  top: 0;
  transform: rotate(6deg);
  z-index: 2;
}
.phone-stack:hover .phone-back { transform: rotate(-12deg) translateX(-8px); }
.phone-stack:hover .phone-front { transform: rotate(9deg) translateX(8px); }

/* Features */
.features {
  padding: 80px 0 80px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-lead { color: var(--mute); max-width: 640px; font-size: 1.05rem; }
.feature-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 26px;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.feature-icon {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-muted);
  color: var(--brand);
  border-radius: 14px;
  margin-bottom: 14px;
}
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--mute); margin: 0; font-size: 0.96rem; }

/* Showcase */
.showcase {
  padding: 90px 0;
  background: var(--bg);
}
.steps {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.step {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 30px;
  border: 1px solid var(--border);
  position: relative;
}
.step-number {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 18px;
}
.step p { color: var(--mute); margin: 0; }

/* ===========================================================
 * Screenshots showcase — phone-frame mockups in a snap-scroll
 * carousel with peek-of-next-slide affordance, animated dots,
 * and arrow controls. Mobile-first.
 * =========================================================== */
.screenshots {
  padding: 80px 0 90px;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(45, 108, 223, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, var(--brand-muted) 0%, var(--bg) 100%);
  overflow: hidden;
}
.screenshots .section-inner h2,
.screenshots .section-inner .section-lead {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.screenshots .section-inner .section-lead {
  max-width: 560px;
}

.shot-showcase {
  position: relative;
  margin-top: 36px;
}

.shot-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 28px max(24px, calc(50vw - 168px)) 40px;
  scrollbar-width: none;
}
.shot-track::-webkit-scrollbar { display: none; }
.shot-track:focus { outline: none; }
.shot-track:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 6px;
  border-radius: 12px;
}

.shot-slide {
  flex: 0 0 auto;
  width: 280px;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.4s ease;
  opacity: 0.78;
  transform: scale(0.97);
}
.shot-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Realistic phone-frame mockup. The aspect ratio matches the iPhone
 * 14/15 Pro screen (19.5:9) so screenshots render at native proportion.
 * The bezel is a layered gradient + hairline ring so the frame reads
 * as a real device on any background, including light pages where a
 * pure-black bezel can disappear into shadows. */
.phone-mock {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  background:
    linear-gradient(160deg, #2b3441 0%, #14181f 70%, #0c0f15 100%);
  border-radius: 44px;
  padding: 6px;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.06),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(8, 11, 17, 0.85),
    0 24px 50px -16px rgba(45, 108, 223, 0.35),
    0 18px 36px -12px rgba(10, 14, 26, 0.4);
  overflow: hidden;
  isolation: isolate;
}
.phone-mock::before {
  /* Subtle inner highlight along the right edge — premium glass feel. */
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 43px;
  background:
    linear-gradient(105deg, transparent 0%, transparent 40%, rgba(255, 255, 255, 0.05) 50%, transparent 60%);
  pointer-events: none;
  z-index: 2;
}
.phone-island {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 26px;
  background: #000;
  border-radius: 999px;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.phone-shot {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 38px;
  object-fit: cover;
  background: #fff;
}

.shot-caption {
  text-align: center;
  max-width: 280px;
  padding: 0 8px;
}
.shot-caption h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.shot-caption p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--mute);
  line-height: 1.5;
}

/* Controls (dots + arrows) */
.shot-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}
.shot-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(10, 14, 26, 0.06);
}
.shot-arrow:hover { background: var(--brand-muted); color: var(--brand); transform: translateY(-1px); }
.shot-arrow:active { transform: translateY(0); }
.shot-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.shot-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.shot-dots button {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(45, 108, 223, 0.2);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease;
}
.shot-dots button:hover { background: rgba(45, 108, 223, 0.4); }
.shot-dots button[aria-current="true"] {
  width: 24px;
  background: var(--brand);
}

/* ===== Tablet + Desktop: stage-based center-focus showcase =====
 * Replaces the snap-scroll on wider viewports. One phone is sharp
 * and full-size in the center; the immediate neighbors are blurred
 * + scaled down on each side as a peek; everything else is hidden.
 * Click a side phone to bring it to center.
 *
 * The mobile snap-scroll rules above are overridden in this query
 * so the same DOM works for both layouts. */
@media (min-width: 720px) {
  .shot-track {
    display: block;
    position: relative;
    height: 640px;
    overflow: visible;
    padding: 32px 0 24px;
    scroll-snap-type: none;
    margin: 0 auto;
    max-width: 1120px;
    perspective: 1400px;
  }
  .shot-track::-webkit-scrollbar { display: none; }

  .shot-slide {
    position: absolute;
    left: 50%;
    top: 32px;
    width: 300px;
    flex: none;
    margin: 0;
    transform: translateX(-50%) scale(0.92);
    transition:
      transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
      filter 0.4s ease,
      opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    will-change: transform, filter, opacity;
  }
  /* Side cards are sharp — no blur — but dimmed and positioned so the
   * center card overlaps them. The center card sits forward via a
   * stronger shadow + higher z-index, creating the Linear/Stripe
   * SaaS-hero "stacked card" depth without a blur effect. */
  .shot-slide.is-prev,
  .shot-slide.is-next {
    opacity: 0.45;
    pointer-events: auto;
    cursor: pointer;
    filter: none;
    z-index: 1;
  }
  .shot-slide.is-prev {
    transform: translateX(calc(-50% - 220px)) scale(0.9);
  }
  .shot-slide.is-next {
    transform: translateX(calc(-50% + 220px)) scale(0.9);
  }
  .shot-slide.is-active {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    filter: none;
    pointer-events: auto;
    z-index: 3;
  }
  /* The center card gets a deeper shadow on top of the phone-mock's
   * own shadow, lifting it visually above the side cards. */
  .shot-slide.is-active .phone-mock {
    box-shadow:
      inset 0 0 0 1.5px rgba(255, 255, 255, 0.06),
      inset 0 0 0 0.5px rgba(255, 255, 255, 0.18),
      0 0 0 1px rgba(8, 11, 17, 0.85),
      0 32px 64px -16px rgba(45, 108, 223, 0.5),
      0 24px 48px -12px rgba(10, 14, 26, 0.5);
  }
  /* Side slides on hover — bump opacity + slight scale so it reads
   * as interactive. Still no blur. */
  .shot-slide.is-prev:hover,
  .shot-slide.is-next:hover {
    opacity: 0.7;
  }
  .shot-slide.is-prev:hover {
    transform: translateX(calc(-50% - 230px)) scale(0.92);
  }
  .shot-slide.is-next:hover {
    transform: translateX(calc(-50% + 230px)) scale(0.92);
  }

  /* Caption fades to match the focus state. */
  .shot-caption { transition: opacity 0.3s ease; }
  .shot-slide:not(.is-active) .shot-caption { opacity: 0; }
  .shot-slide.is-active .shot-caption { opacity: 1; }
}

@media (min-width: 1080px) {
  .shot-track { height: 680px; }
  .shot-slide { width: 320px; }
  .shot-slide.is-prev { transform: translateX(calc(-50% - 240px)) scale(0.9); }
  .shot-slide.is-next { transform: translateX(calc(-50% + 240px)) scale(0.9); }
  .shot-slide.is-prev:hover { transform: translateX(calc(-50% - 250px)) scale(0.92); }
  .shot-slide.is-next:hover { transform: translateX(calc(-50% + 250px)) scale(0.92); }
}

/* Reduced-motion users: snap to position, no transitions. */
@media (prefers-reduced-motion: reduce) {
  .shot-slide { transition: none; }
  .shot-track { scroll-behavior: auto; }
}

/* Privacy */
.privacy {
  padding: 90px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.privacy-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}
.checks {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.checks li {
  padding-left: 30px;
  position: relative;
  margin-bottom: 14px;
  color: var(--text);
}
.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  background: var(--brand-muted);
  border-radius: 50%;
}
.checks li::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 9px;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}
.privacy-visual { display: flex; justify-content: center; }
.lock-card {
  width: 320px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: 26px;
  padding: 40px 30px;
  color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.lock-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}
.lock-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.lock-lines { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.lock-line {
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}
.w-80 { width: 80%; }
.w-60 { width: 60%; }
.w-40 { width: 40%; }

/* Download section */
.download {
  padding: 90px 0;
  text-align: center;
  background: linear-gradient(180deg, var(--bg), var(--brand-muted));
}
.store-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 36px;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: white;
  padding: 16px 28px;
  border-radius: 14px;
  font-weight: 600;
  transition: transform 0.15s ease;
  text-decoration: none !important;
}
.store-btn:hover { transform: translateY(-2px); color: white; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.15; }
.store-btn small { font-size: 0.72rem; opacity: 0.8; font-weight: 500; }
.store-btn strong { font-size: 1.1rem; }
.footnote { color: var(--mute); font-size: 0.85rem; margin-top: 28px; }

/* Footer */
.foot {
  padding: 40px 0 60px;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.9);
}
.foot .brand { color: white; }
.foot-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 24px;
  align-items: center;
}
.foot-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.foot-links a { color: rgba(255, 255, 255, 0.75); }
.foot-links a:hover { color: white; }
.foot .mute { color: rgba(255, 255, 255, 0.55); }
.small { font-size: 0.86rem; }

/* Document pages (privacy, disclaimer, support) */
.doc {
  max-width: 760px;
  margin: 60px auto;
  padding: 0 24px 80px;
}
.doc h1 { margin-bottom: 8px; }
.doc .doc-date { color: var(--mute); margin-bottom: 32px; }
.doc h2 { margin-top: 36px; font-size: 1.3rem; }
.doc p, .doc li { color: var(--text); }
.doc ul { padding-left: 22px; }
.doc .callout {
  background: var(--brand-muted);
  border-left: 4px solid var(--brand);
  padding: 18px 22px;
  border-radius: 10px;
  margin: 24px 0;
  color: var(--text);
}

/* Caregiver dedicated band — same 2-column layout as the privacy
   band but with a brand-tinted background so it stands out as a
   feature deep-dive between the features grid and how-it-works. */
.caregiver-band {
  padding: 90px 0;
  background: linear-gradient(135deg, var(--brand-muted), var(--surface));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.caregiver-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}
.caregiver-text .pill-label { display: inline-block; }
.caregiver-text h2 { margin-top: 12px; }
.caregiver-text .section-lead { max-width: 540px; margin-bottom: 4px; }
.caregiver-visual { display: flex; justify-content: center; align-items: center; min-height: 480px; }

/* Utilities / responsive */
.mute { color: var(--mute); }

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; height: 520px; }
  .privacy-inner { grid-template-columns: 1fr; }
  .caregiver-inner { grid-template-columns: 1fr; }
  .caregiver-visual { min-height: 460px; order: -1; }
  .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .foot-inner { grid-template-columns: 1fr; text-align: center; }
  .foot-links { justify-content: center; }
}
@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
  h1 { font-size: 2rem; }

  /* Features + Steps as horizontal snap-scroll carousels on phones —
   * same pattern as the screenshot showcase. The grid layout becomes a
   * flex track that breaks out of section-inner padding so the next
   * card peeks at the right edge. */
  .feature-grid,
  .steps {
    display: flex;
    grid-template-columns: none;
    gap: 14px;
    margin-top: 28px;
    margin-left: -24px;
    margin-right: -24px;
    padding: 8px 24px 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .feature-grid::-webkit-scrollbar,
  .steps::-webkit-scrollbar { display: none; }

  .feature,
  .step {
    flex: 0 0 78%;
    min-width: 240px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  /* Hover lift doesn't make sense on touch and breaks scroll feel. */
  .feature:hover { transform: none; box-shadow: none; }
}

/* Subtle entrance animation */
@media (prefers-reduced-motion: no-preference) {
  .hero-text, .phone-stack, .feature, .step {
    animation: rise 0.6s ease-out both;
  }
  .hero-text { animation-delay: 0.05s; }
  .phone-stack { animation-delay: 0.15s; }
  .feature:nth-child(1) { animation-delay: 0.05s; }
  .feature:nth-child(2) { animation-delay: 0.1s; }
  .feature:nth-child(3) { animation-delay: 0.15s; }
  .feature:nth-child(4) { animation-delay: 0.2s; }
  .feature:nth-child(5) { animation-delay: 0.25s; }
  .feature:nth-child(6) { animation-delay: 0.3s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
  /* gentle floating on hero phones */
  .phone-back { animation: float 6s ease-in-out infinite; }
  .phone-front { animation: float 6s ease-in-out infinite; animation-delay: -3s; }
  @keyframes float {
    0%, 100% { transform: rotate(-9deg) translateY(0); }
    50% { transform: rotate(-9deg) translateY(-12px); }
  }
  .phone-front { animation-name: floatRight; }
  @keyframes floatRight {
    0%, 100% { transform: rotate(6deg) translateY(0); }
    50% { transform: rotate(6deg) translateY(-12px); }
  }
}

/* iOS smart-banner */
.app-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(10, 14, 26, 0.05);
  font-size: 14px;
}
.app-banner[hidden] { display: none; }
.app-banner-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--mute);
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.app-banner-close:hover, .app-banner-close:active { background: rgba(10, 14, 26, 0.06); }
.app-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  display: block;
}
.app-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.app-banner-text strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-banner-text span {
  color: var(--mute);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-banner-cta {
  background: var(--brand);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.app-banner-cta:hover, .app-banner-cta:active { background: var(--brand-dark); }

/* When the banner is present, push the sticky nav below it. */
body.with-app-banner .nav { top: 64px; }

/* ===========================================================
 * Free tools band (rendered on the homepage)
 * =========================================================== */

.tools-band {
  padding: 64px 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--brand-muted) 100%);
}
.tools-band .section-inner > .pill-label { display: inline-block; }
.tools-band h2 { margin-top: 12px; }
.tools-band .section-lead { margin-bottom: 28px; max-width: 720px; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 720px) { .tools-grid { grid-template-columns: 1fr; } }
.tool-card {
  display: block;
  position: relative;
  padding: 26px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none !important;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, rgba(45, 108, 223, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 108, 223, 0.4);
  box-shadow:
    0 6px 14px rgba(10, 14, 26, 0.08),
    0 28px 56px rgba(45, 108, 223, 0.22);
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover .tool-card-cta { transform: translateX(4px); }
.tool-card-cta {
  display: inline-flex;
  align-items: center;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tool-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}
.tool-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-muted);
  color: var(--brand-dark);
  margin-bottom: 14px;
}
.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  color: var(--ink);
}
.tool-card p { margin: 0 0 12px; color: var(--text); font-size: 0.95rem; }
.tool-card-cta { color: var(--brand); font-weight: 700; font-size: 0.92rem; gap: 4px; }

/* ===========================================================
 * Tool pages (interaction checker, travel planner)
 * =========================================================== */

.tool-page { background: var(--bg); }
.nav-links a.active { color: var(--brand); font-weight: 700; }

/* Hard-override [hidden] inside the tool output so CSS display rules
 * (flex, grid) can't keep an element visible when it's been hidden. */
.tool-output [hidden],
.travel-output [hidden] { display: none !important; }

.tool-hero {
  padding: 56px 0 32px;
  background: linear-gradient(180deg, var(--brand-muted) 0%, var(--bg) 100%);
}
.tool-hero h1 {
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 2.8rem);
}
.tool-hero .lead {
  color: var(--text);
  max-width: 720px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.tool-main { padding: 16px 0 56px; }
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 880px) {
  .tool-grid { grid-template-columns: 1fr; }
}

.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.input-card-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}
.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}
.input-row .autocomplete { flex: 1; position: relative; }
.input-row input[type="text"],
.field input,
.field select,
.input-card input,
.input-card select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--ink);
  font-family: inherit;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}
.input-card input:focus,
.input-card select:focus,
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.18);
}
.input-hint {
  margin: 6px 0 16px;
  font-size: 0.85rem;
  color: var(--mute);
}
.input-foot {
  margin: 14px 4px 0;
  font-size: 0.82rem;
  line-height: 1.5;
}
.input-foot a { color: var(--brand); text-decoration: underline; }

.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
}
.suggestions li {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.suggestions li:hover,
.suggestions li:focus {
  background: var(--brand-muted);
  outline: none;
}
.suggestion-name { font-weight: 600; color: var(--ink); }
.suggestion-extra { font-size: 0.85rem; color: var(--mute); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
  min-height: 36px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 14px;
  background: var(--brand-muted);
  color: var(--brand-dark);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
}
.chip-remove {
  border: none;
  background: rgba(45, 108, 223, 0.18);
  color: var(--brand-dark);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  font-weight: 700;
}
.chip-remove:hover { background: rgba(45, 108, 223, 0.32); }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.reassure {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reassure-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.reassure-row > span:first-child { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }

.tool-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
.output-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--mute);
  padding: 40px 20px;
}
.output-empty h2 { color: var(--ink); margin: 12px 0 6px; font-size: 1.4rem; }
.output-empty-art { color: var(--brand); margin-bottom: 8px; }

.output-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}
.loading-status {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 1.4em;
  transition: opacity 0.3s ease;
}
.loading-hint {
  margin: 4px 0 0;
  font-size: 0.82rem;
  max-width: 320px;
  line-height: 1.45;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.output-results { display: flex; flex-direction: column; gap: 18px; }

@keyframes resultsFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.results-fade-in { animation: resultsFadeIn 0.35s ease-out; }
.results-fade-in > * {
  animation: resultsFadeIn 0.45s ease-out backwards;
}
.results-fade-in > *:nth-child(2) { animation-delay: 0.06s; }
.results-fade-in > *:nth-child(3) { animation-delay: 0.12s; }
.results-fade-in > *:nth-child(4) { animation-delay: 0.18s; }

/* Summary header at the top of results */
.result-summary {
  background: linear-gradient(135deg, var(--surface) 0%, var(--brand-muted) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.result-summary-meta {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.result-summary-count {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.result-summary-count.count-warn {
  background: linear-gradient(135deg, #FCD34D, #F59E0B);
  color: #78350F;
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.25);
}
.result-summary-count.count-clear {
  background: linear-gradient(135deg, #86EFAC, #22C55E);
  color: #14532D;
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.25);
}
.result-summary-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
}
.result-summary-sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
}
.result-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 0 0;
  border-top: 1px solid rgba(45, 108, 223, 0.15);
}
.result-summary-chips-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  margin-right: 4px;
}
.result-summary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.result-summary-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-recap {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(45, 108, 223, 0.12);
  color: var(--brand-dark);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.chip-recap.chip-mute {
  background: rgba(107, 114, 128, 0.12);
  color: var(--text);
}

/* Finding cards */
.findings-list { display: flex; flex-direction: column; gap: 14px; }

.finding {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(10, 14, 26, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.finding:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 14, 26, 0.08);
}
.finding.severity-high { border-left-color: var(--danger); }
.finding.severity-mid { border-left-color: var(--warn); }
.finding.severity-low { border-left-color: var(--brand); }

.finding-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.finding-drug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--brand-muted);
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.98rem;
}
.finding-drug strong { font-weight: 700; }
.finding-drug .pill-icon { color: var(--brand); }
.finding-arrow {
  color: var(--brand);
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1;
}
.finding-tag {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
}
.severity-high .finding-tag {
  background: rgba(220, 38, 38, 0.12);
  color: #991B1B;
}
.severity-mid .finding-tag {
  background: rgba(217, 119, 6, 0.14);
  color: #92400E;
}
.severity-low .finding-tag {
  background: rgba(45, 108, 223, 0.14);
  color: var(--brand-dark);
}

.finding-excerpt {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text);
  border-left: 2px solid var(--border);
  font-style: normal;
  quotes: none;
}
.finding-excerpt::before, .finding-excerpt::after { content: none; }
.finding-excerpt mark {
  background: rgba(245, 158, 11, 0.28);
  color: var(--ink);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.severity-high .finding-excerpt mark { background: rgba(220, 38, 38, 0.22); }
.severity-low .finding-excerpt mark { background: rgba(45, 108, 223, 0.22); }

.finding-foot {
  font-size: 0.78rem;
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.finding-foot strong { color: var(--text); font-weight: 700; }
.finding-foot span { font-style: italic; }

/* Unrecognized + disclaimer cards */
.unrecognized-card,
.disclaimer-card {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.unrecognized-card { background: rgba(107, 114, 128, 0.05); }
.disclaimer-card { background: rgba(45, 108, 223, 0.05); border-color: rgba(45, 108, 223, 0.18); }
.unrecognized-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mute);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.disclaimer-icon {
  flex-shrink: 0;
  color: var(--brand);
}
.unrecognized-card strong,
.disclaimer-card strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.unrecognized-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.unrecognized-hint,
.disclaimer-card p {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

.result-banner {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95rem;
}
.result-banner strong { font-weight: 700; }
.result-error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #991B1B;
}

/* FAQ accordion */
.tool-faq { padding: 32px 0 64px; background: var(--surface); border-top: 1px solid var(--border); }
.tool-faq h2 { margin-bottom: 16px; }
.tool-faq details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.tool-faq details:last-child { border-bottom: none; }
.tool-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-size: 1.02rem;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.tool-faq summary::-webkit-details-marker { display: none; }
.tool-faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.4rem;
  color: var(--brand);
  transition: transform 0.2s ease;
}
.tool-faq details[open] summary::after { content: "−"; }
.tool-faq details p {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 0.95rem;
}

/* Travel planner */
.travel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 880px) {
  .travel-grid { grid-template-columns: 1fr; }
}
.travel-form { display: flex; flex-direction: column; gap: 16px; }
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.travel-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  min-height: 440px;
}
.plan-summary { margin-bottom: 18px; }
.plan-summary h2 { font-size: 1.3rem; margin-bottom: 6px; }
.dose-list { display: flex; flex-direction: column; gap: 8px; }
.dose-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.dose-row.dose-shifting {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.06);
}
.dose-row.dose-destination {
  border-color: rgba(22, 163, 74, 0.3);
  background: rgba(22, 163, 74, 0.05);
}
.dose-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.dose-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dose-date { color: var(--ink); font-size: 0.95rem; }
.dose-phase {
  font-size: 0.75rem;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dose-note {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
}
.dose-times {
  display: flex;
  gap: 16px;
  text-align: right;
}
.dose-times > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}
.tz-label {
  font-size: 0.7rem;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dose-times strong { font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.dose-gap { grid-column: 1 / -1; text-align: right; }
.gap-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.gap-badge.gap-ok { background: rgba(22, 163, 74, 0.12); color: #166534; }
.gap-badge.gap-tight { background: rgba(220, 38, 38, 0.12); color: #991B1B; }
.gap-badge.gap-loose { background: rgba(217, 119, 6, 0.14); color: #92400E; }

.plan-disclaimer {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(45, 108, 223, 0.06);
  border: 1px solid rgba(45, 108, 223, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}
.plan-disclaimer strong { color: var(--ink); }

/* Print-friendly: when users print the travel plan or interaction
 * results to paper, hide the inputs and chrome. */
@media print {
  .nav, .tool-faq, .foot, .reassure, .action-row, .input-card { display: none !important; }
  .tool-output, .travel-output { box-shadow: none; border: none; padding: 0; }
  body { background: #fff; }
}
