/* =========================================================================
   CrohnOlogy marketing site — mobile-first stylesheet
   Base styles target phones (320–412px). @media (min-width) enhances upward.
   ========================================================================= */

:root {
  /* Brand palette (plans/site.md §6) */
  --color-primary: #7E57C2;        /* Crohn's Awareness Purple (canonical) */
  --color-primary-deep: #5E35B1;   /* Hover states, on-tint text */
  --color-primary-tint: #F3E5F5;   /* Backgrounds, callouts, cookie banner */
  --color-bg: #FFFBFF;             /* Page background */
  --color-surface: #FFFFFF;        /* Cards, nav, footer */
  --color-text: #1A1C1E;           /* Body text */
  --color-text-muted: #5A5C5E;     /* Secondary text */
  --color-outline: #E0E0E0;        /* Borders, dividers */
  --color-error: #BA1A1A;

  /* Feature accents (mirror the app's entry-type colours) */
  --color-food: #4CAF50;
  --color-stool: #795548;
  --color-pain: #E53935;
  --color-weight: #2196F3;

  --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container-max: 1100px;
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 48px;
}

/* ----------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-primary-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--color-primary); }

/* ----------------------------------------------------------- Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-primary-deep);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: clamp(1.05rem, 2.5vw, 1.2rem); }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem 1.25rem; padding: 0; }
li { margin: 0 0 0.4rem; }

strong { font-weight: 600; }

/* ------------------------------------------------------------- Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-main { padding: 1.5rem 0 3rem; }

/* Accessibility: skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------ Header / Nav */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-outline);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.5rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.brand-logo { border-radius: var(--radius-sm); }
.brand-name {
  font-weight: 700;
  color: var(--color-primary-deep);
  font-size: 1.25rem;
}

/* Hamburger (mobile only) — pure CSS checkbox toggle */
.nav-toggle-input { display: none; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: var(--tap);
  height: var(--tap);
  cursor: pointer;
  padding: 10px;
}
.nav-toggle-bar {
  display: block;
  height: 3px;
  width: 26px;
  background: var(--color-primary-deep);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-menu {
  display: none;
  flex-direction: column;
  width: 100%;
  order: 1;
  background: var(--color-surface);
  border-top: 1px solid var(--color-outline);
}
.nav-menu a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 1rem;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-outline);
}
.nav-menu a:hover,
.nav-menu a:focus {
  background: var(--color-primary-tint);
  color: var(--color-primary-deep);
}
.nav-menu a.active {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

#nav-toggle:checked ~ .nav-menu { display: flex; }

#nav-toggle:checked ~ .nav-toggle .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#nav-toggle:checked ~ .nav-toggle .nav-toggle-bar:nth-child(2) { opacity: 0; }
#nav-toggle:checked ~ .nav-toggle .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Desktop nav (≥ 768px) */
@media (min-width: 768px) {
  .nav-wrap { flex-wrap: nowrap; }
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex;
    flex-direction: row;
    width: auto;
    order: 0;
    border-top: none;
    background: transparent;
  }
  .nav-menu a {
    min-height: var(--tap);
    border-bottom: none;
    padding: 0 0.85rem;
  }
}

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-deep); color: #fff; }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary-deep);
  border: 2px solid var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary-tint); color: var(--color-primary-deep); }
.btn-block { display: flex; width: 100%; }

@media (min-width: 768px) {
  .btn-block { display: inline-flex; width: auto; }
}

/* --------------------------------------------------------------- Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* ----------------------------------------------------------- Callout box */
.callout {
  background: var(--color-primary-tint);
  border: 1px solid var(--color-primary);
  border-left-width: 5px;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.callout h2, .callout h3 { margin-top: 0; }

/* --------------------------------------------------------------- Footer */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-outline);
  padding: 2rem 0;
  margin-top: 2rem;
  color: var(--color-text-muted);
}
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; }
.footer-tagline { margin: 0; color: var(--color-text); font-size: 0.95rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.footer-links a { text-decoration: none; color: var(--color-primary-deep); }
.footer-links a:hover { text-decoration: underline; }
.footer-contact { margin: 0; font-size: 0.95rem; }
.footer-notice { margin: 0; font-size: 0.85rem; color: var(--color-text-muted); }
.footer-copy { margin: 0; font-size: 0.85rem; color: var(--color-text-muted); }

@media (min-width: 768px) {
  .footer-inner { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .footer-brand { flex: 1 1 300px; }
}

/* ------------------------------------------------------- Content helpers */
.prose { max-width: 46rem; }

/* Style Markdown-generated content within .prose (privacy policy, terms, etc.) */
.prose h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin-top: 0;
}
.prose h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  margin-top: 2rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--color-primary-tint);
}
.prose h3 {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  margin-top: 1.5rem;
}
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.25rem; }
.prose li { margin: 0 0 0.4rem; }
.prose code {
  background: var(--color-primary-tint);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.prose hr {
  border: none;
  border-top: 2px solid var(--color-outline);
  margin: 2rem 0;
}

.lead { font-size: clamp(1.1rem, 2.5vw, 1.35rem); color: var(--color-text-muted); }

.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }

/* Feature-coloured accents */
.accent-food { border-left: 5px solid var(--color-food); }
.accent-stool { border-left: 5px solid var(--color-stool); }
.accent-pain { border-left: 5px solid var(--color-pain); }
.accent-weight { border-left: 5px solid var(--color-weight); }

/* Badge */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--color-primary-tint);
  color: var(--color-primary-deep);
}

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--color-outline); vertical-align: top; }
th { background: var(--color-primary-tint); color: var(--color-primary-deep); }

/* ----------------------------------------------------------- Page sections */
.section { padding: 2rem 0; }
.section-tint { background: var(--color-primary-tint); }

.hero {
  padding: 2.5rem 0 2rem;
  background: linear-gradient(180deg, var(--color-primary-tint) 0%, var(--color-bg) 100%);
  text-align: center;
}
.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.hero-content { text-align: center; }
.hero-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  border-radius: var(--radius);
}
.hero-sub { margin: 0.5rem auto 1.5rem; max-width: 36rem; }

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
@media (min-width: 768px) {
  .hero-cta { flex-direction: row; justify-content: center; }
}

/* Hero two-column layout on desktop */
@media (min-width: 900px) {
  .hero-grid {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
  }
  .hero-content {
    flex: 1 1 50%;
    text-align: left;
  }
  .hero-content .hero-logo { margin-left: 0; }
  .hero-content .hero-sub { margin-left: 0; }
  .hero-content .hero-cta {
    justify-content: flex-start;
  }
  .hero-mockup {
    flex: 0 0 300px;
  }
}

/* Phone frame placeholder */
.phone-frame {
  width: 280px;
  max-width: 100%;
  aspect-ratio: 9 / 19.5;
  border: 4px solid var(--color-primary-deep);
  border-radius: 36px;
  padding: 14px;
  background: var(--color-primary-tint);
  box-shadow: 0 8px 32px rgba(94, 53, 177, 0.15);
  margin: 0 auto;
}
.phone-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-placeholder-content {
  text-align: center;
  color: var(--color-text-muted);
}
.phone-placeholder-content p { margin: 0; }
.phone-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem !important;
}
.phone-placeholder-note {
  font-size: 0.85rem;
  opacity: 0.7;
}
.phone-placeholder-sm { width: 220px; }
.phone-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

/* Step number circles (Family Sync) */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* Appointment preview */
.appointment-preview {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* "Coming soon" disabled-looking button (app not yet on Play Store) */
.btn-disabled,
.btn[aria-disabled="true"] {
  background: var(--color-outline);
  color: var(--color-text-muted);
  cursor: default;
  pointer-events: none;
}

/* Conditions list (home "who it's for") */
.conditions {
  list-style: none;
  margin: 1.25rem auto;
  padding: 0;
  max-width: 30rem;
  display: grid;
  gap: 0.5rem;
}
.conditions li {
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 0;
  text-align: center;
}

.cta-final { padding: 2.5rem 0; }

/* Numbered step cards (How It Works) — numbers are in the headings */
.steps {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.steps li {
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0;
}
.steps h3 { margin-top: 0; }

/* FAQ accordion (JS-free <details>/<summary>) */
.faq {
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--tap);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary-deep);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-primary);
  flex-shrink: 0;
}
.faq[open] summary::after { content: "\2212"; }
.faq-answer { padding: 0 1rem 1rem; }
.faq-answer p { margin: 0 0 0.5rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* Contact details block */
.contact-card {
  background: var(--color-primary-tint);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.25rem 0;
}
.contact-card dt { font-weight: 700; margin-top: 0.5rem; }
.contact-card dd { margin: 0 0 0.25rem; }

/* Cookie banner removed — now a minimal notice in the footer */
