/* CarbZen — Consolidated Styles */

/* ==============================
   1. Reset & Variables
   ============================== */

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

:root {
  /* Inspired by Supabase DESIGN.md — dark emerald, border-defined depth */
  --bg: #171717;              /* Supabase Dark — primary canvas */
  --bg-alt: #0f0f0f;          /* Near Black — deepest surface */
  --bg-card: #171717;         /* Flat, border-defined cards */
  --bg-card-elevated: #1b1b1b;
  --border: #2e2e2e;          /* Supabase border hierarchy */
  --border-mid: #363636;
  --border-accent: rgba(62,207,142,0.3); /* Brand-highlighted elevation */
  --accent: #3ecf8e;          /* Supabase Green — exact emerald */
  --accent-hover: #00c573;    /* Interactive green */
  --accent-dim: rgba(62,207,142,0.12);
  --text: #fafafa;            /* Off White — primary text */
  --text-muted: #b4b4b4;      /* Light Gray */
  --text-faint: #898989;      /* Mid Gray */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-display: 'DM Sans', var(--font);
  --max-w: 1080px;
  --max-w-narrow: 680px;
}

/* ==============================
   2. Base & Typography
   ============================== */

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: var(--font-display);
  text-wrap: balance;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tabular-nums { font-variant-numeric: tabular-nums; }

/* ==============================
   3. Skip Link
   ============================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  z-index: 200;
}
.skip-link:focus { top: 16px; }

/* ==============================
   4. Navigation
   ============================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(23,23,23,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--accent);
  color: var(--bg) !important;
  font-weight: 600;
  font-size: 13px !important;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav-cta:hover { opacity: 0.88; color: var(--bg) !important; }

.nav-cta svg { width: 14px; height: 14px; }

/* ==============================
   5. Buttons
   ============================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 24px;
  background: var(--accent);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 24px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

/* ==============================
   6. Section Utilities
   ============================== */

section {
  padding: 80px 24px;
}

.section-narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
}

.section-wide {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 540px;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ==============================
   7. Phone Frame Component
   ============================== */

.phone-frame {
  position: relative;
  width: 280px;
  aspect-ratio: 9 / 19.5;
  background: #000;
  border: 3px solid rgba(255,255,255,0.12);
  border-radius: 44px;
  overflow: hidden;
  flex-shrink: 0;
}

.phone-frame--sm {
  width: 260px;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.phone-frame__notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 28px;
  background: #000;
  border-radius: 14px;
  z-index: 2;
}

.phone-frame__screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 41px;
  display: block;
}

/* ==============================
   8. Glow Effect
   ============================== */

.glow {
  position: relative;
}

.glow::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 400px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(62,207,142,0.08) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* ==============================
   9. Hero
   ============================== */

.hero {
  text-align: center;
  padding: 80px 24px 0;
  max-width: var(--max-w);
  margin: 0 auto;
  overflow: hidden;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 60px;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -2.5px;
  margin-bottom: 20px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 span { color: var(--accent); }

.hero > p {
  font-size: 19px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.app-store-badge {
  display: block;
  height: 44px;
  width: auto;
}

.hero-phones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 56px;
  padding-bottom: 40px;
  position: relative;
}

.hero-phone--left .phone-frame,
.hero-phone--right .phone-frame {
  width: 210px;
  opacity: 0.85;
}

.hero-phone--left {
  transform: rotate(-8deg) translateX(60px);
  z-index: 1;
}

.hero-phone--right {
  transform: rotate(8deg) translateX(-60px);
  z-index: 1;
}

.hero-phone--center {
  z-index: 2;
  position: relative;
}

/* ==============================
   10. How It Works / Steps
   ============================== */

.how-it-works {
  border-top: 1px solid var(--border);
}

.steps {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  gap: 80px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
}

.step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.step:nth-child(even) { direction: rtl; }
.step:nth-child(even) > * { direction: ltr; }

.step-image-wrap {
  display: flex;
  justify-content: center;
}

.step-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-content h3 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.8px;
}

.step-content p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 380px;
}

/* ==============================
   12. Features
   ============================== */

.features {
  border-top: 1px solid var(--border);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 56px;
}

.feature-card {
  padding: 28px 24px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

.feature-card:hover .feature-icon {
  box-shadow: 0 0 20px rgba(62,207,142,0.12);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==============================
   13. Pricing
   ============================== */

.pricing {
  border-top: 1px solid var(--border);
}

.pricing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  margin-top: 40px;
}

.pricing-toggle__btn {
  padding: 10px 24px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  touch-action: manipulation;
}

.pricing-toggle__btn.active {
  background: var(--accent);
  color: var(--bg);
}

.pricing-toggle__save {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.8;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-card {
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: border-color 0.2s;
}

.pricing-card:hover { border-color: rgba(255,255,255,0.12); }

.pricing-card.featured {
  border-color: var(--accent);
  position: relative;
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pricing-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
  transition: opacity 0.2s ease;
}

.pricing-price span {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-was {
  display: inline-block;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  margin-right: 10px;
  letter-spacing: 0;
  vertical-align: middle;
}

.pricing-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: opacity 0.2s ease;
}

.pricing-cta {
  margin-top: 24px;
  width: 100%;
  justify-content: center;
}

.pricing-cta-badge {
  display: block;
  text-align: center;
  margin-top: 24px;
}

.pricing-cta-badge .app-store-badge {
  margin: 0 auto;
}

.pricing-features {
  list-style: none;
  padding: 0;
  flex-grow: 1;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text-muted);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-dim);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%233ecf8e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
}

/* ==============================
   17. Trust Bar (new — diabetes positioning)
   ============================== */

.trust-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 32px 24px;
}

.trust-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.trust-item .trust-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trust-item strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.2px;
}

.trust-item span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 760px) {
  .trust-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==============================
   18. Built For (tabbed — CPP preview)
   ============================== */

.built-for {
  border-top: 1px solid var(--border);
}

.bf-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 9999px;
  margin: 36px 0 40px;
}

.bf-tab {
  padding: 10px 22px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  touch-action: manipulation;
}

.bf-tab:hover { color: var(--text); }

.bf-tab.active {
  background: var(--accent);
  color: #000;
}

.bf-panels {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.bf-panel {
  display: none;
  text-align: left;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  animation: fadeInUp 0.35s ease;
}

.bf-panel.active { display: block; }

.bf-panel h3 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}

.bf-panel > .bf-panel-copy > p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.bf-list {
  list-style: none;
  padding: 0;
}

.bf-list li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 15px;
  color: var(--text);
  line-height: 1.55;
}

.bf-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-dim);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233ecf8e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==============================
   19. Landing-page FAQ (distinct from content-page FAQ)
   ============================== */

.faq {
  border-top: 1px solid var(--border);
}

.faq-list {
  max-width: 720px;
  margin: 48px auto 0;
}

.faq-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-item dt {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}

.faq-item dd {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

.faq-item dd a { color: var(--accent); }

/* ==============================
   14. Final CTA
   ============================== */

.final-cta {
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.final-cta__badge {
  display: inline-block;
  margin-top: 32px;
}

/* ==============================
   15. Footer
   ============================== */

footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 12px 4px;
  touch-action: manipulation;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text); }

.footer-contact {
  color: var(--text-faint);
  font-size: 12px;
  margin-bottom: 8px;
}

.footer-contact a { color: var(--text-faint); text-decoration: none; }
.footer-contact a:hover { color: var(--text-muted); }

.footer-copy {
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ==============================
   16. Content Pages (privacy, terms, support)
   ============================== */

.content-container {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.content-container h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.content-container h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 12px;
}

.content-container p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.content-container a { color: var(--accent); }
.content-container strong { color: var(--text); }

.date {
  color: var(--text-faint);
  font-size: 14px;
  margin-bottom: 32px;
}

/* TL;DR summary box */
.tldr {
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.tldr p {
  color: var(--text);
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.7;
}

.tldr strong {
  color: var(--accent);
}

/* FAQ Accordion */

.faq-group-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 40px 0 16px;
}

.faq-group-title:first-of-type { margin-top: 0; }

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover { border-color: rgba(255,255,255,0.12); }

.faq-item summary {
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item[open] summary::after {
  content: '\2212';
}

.faq-answer {
  padding: 0 24px 18px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

/* ==============================
   17. Animations & Keyframes
   ============================== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-anim {
  opacity: 0;
  animation: fadeUp 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-anim:nth-child(1) { animation-delay: 0ms; }
.hero-anim:nth-child(2) { animation-delay: 100ms; }
.hero-anim:nth-child(3) { animation-delay: 200ms; }
.hero-anim:nth-child(4) { animation-delay: 300ms; }
.hero-anim:nth-child(5) { animation-delay: 400ms; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0ms);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-anim {
    opacity: 1;
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==============================
   18. Responsive Breakpoints
   ============================== */

@media (max-width: 768px) {
  section { padding: 56px 20px; }

  .section-title { font-size: 30px; letter-spacing: -1px; }
  .section-subtitle { font-size: 16px; }

  .nav-links a:not(.nav-cta) { display: none; }

  .hero { padding: 48px 20px 0; }
  .hero h1 { font-size: 40px; letter-spacing: -1.5px; }
  .hero > p { font-size: 17px; }
  .hero-phones { margin-top: 40px; }
  .hero-phone--left,
  .hero-phone--right { display: none; }
  .hero-phone--center .phone-frame { width: 240px; }

  .steps { gap: 48px; }
  .steps::before { display: none; }
  .step { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .step:nth-child(even) { direction: ltr; }
  .step-content { align-items: center; }
  .step-content p { margin: 0 auto; }
  .step .phone-frame--sm { width: 220px; }

  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
  .pricing-card.featured { order: -1; }

  .content-container { padding: 32px 20px 60px; }
  .content-container h1 { font-size: 28px; }
}

@media (max-width: 480px) {
  .section-title { font-size: 26px; }

  .hero h1 { font-size: 32px; letter-spacing: -1px; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ==============================
   19. Article / Guide / Glossary / Comparison pages
   ============================== */

.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.article-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.05;
  margin-bottom: 16px;
  text-wrap: balance;
}

.article-lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 640px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  font-size: 14px;
  color: var(--text-faint);
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.article-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.article-meta-item strong { color: var(--text-muted); font-weight: 600; }

.article h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text);
  margin: 56px 0 16px;
  scroll-margin-top: 80px;
}

.article h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 12px;
  scroll-margin-top: 80px;
}

.article p {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 18px;
}

.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article a:hover { color: var(--accent-hover); }
.article strong { color: var(--text); font-weight: 600; }
.article em { color: var(--text); font-style: italic; }

.article ul, .article ol {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 22px 22px;
  padding: 0;
}

.article ul li, .article ol li { margin-bottom: 8px; }
.article ul li::marker { color: var(--accent); }
.article ol li::marker { color: var(--accent); font-weight: 600; }

.article blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  padding: 18px 24px;
  margin: 28px 0;
  border-radius: 0 12px 12px 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
}

.article blockquote cite {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-faint);
  font-style: normal;
}

.article-callout {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  border-radius: 12px;
  margin: 28px 0;
}

.article-callout-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.article-callout p { margin: 0; color: var(--text); font-size: 16px; line-height: 1.6; }
.article-callout p strong { color: var(--accent); }

/* Table of contents */
.article-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 40px;
}

.article-toc-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.article-toc ol {
  margin: 0;
  padding: 0 0 0 22px;
  font-size: 15px;
}

.article-toc li {
  margin-bottom: 6px;
  color: var(--text-muted);
}

.article-toc a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.article-toc a:hover { color: var(--accent); }

/* Comparison tables inside articles */
.article-table-wrap {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.article-table th,
.article-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.article-table th {
  background: var(--bg-card-elevated);
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.article-table tr:last-child td { border-bottom: none; }
.article-table td { color: var(--text-muted); }
.article-table td:first-child { color: var(--text); font-weight: 500; }
.article-table .yes { color: var(--accent); font-weight: 600; }
.article-table .no { color: #ff6b6b; }
.article-table .meh { color: #ffa94d; }

/* Author / reviewed footer */
.article-end {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.article-cta {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-card-elevated) 100%);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 32px 28px;
  margin: 48px 0;
  text-align: center;
}

.article-cta h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.article-cta p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.article-cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--bg);
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  transition: transform 0.15s;
}

.article-cta a:hover { transform: translateY(-1px); }

.article-related {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.article-related h2 { margin-top: 0; }

.article-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.article-related-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  text-decoration: none !important;
  transition: border-color 0.2s, transform 0.2s;
}

.article-related-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }

.article-related-card-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.article-related-card-title {
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
}

/* Glossary index */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.glossary-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none !important;
  transition: border-color 0.15s, transform 0.15s;
}

.glossary-card:hover { border-color: var(--border-accent); transform: translateY(-1px); }

.glossary-card-term {
  display: block;
  font-weight: 600;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 4px;
}

.glossary-card-def {
  display: block;
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.45;
}

/* Index pages (guides, blog, compare) */
.index-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 24px;
  text-align: center;
}

.index-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.05;
  margin-bottom: 16px;
}

.index-hero p {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto;
}

.index-list {
  max-width: 880px;
  margin: 32px auto 96px;
  padding: 0 24px;
  display: grid;
  gap: 14px;
}

.index-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  text-decoration: none !important;
  display: block;
  transition: border-color 0.2s, transform 0.2s;
}

.index-list-item:hover { border-color: var(--border-accent); transform: translateY(-2px); }

.index-list-item-meta {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.index-list-item h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.4px;
}

.index-list-item p {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* Programmatic /carbs/[food] pages */
.food-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 32px;
}

.food-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 16px;
}

.food-stat-headline {
  font-size: 15px;
  color: var(--text-muted);
}

.food-stat-number {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent);
  line-height: 1;
}

.food-stat-unit {
  font-size: 16px;
  color: var(--text-muted);
  margin-left: 4px;
}

.food-portions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.food-portion {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.food-portion-label { font-size: 13px; color: var(--text-faint); margin-bottom: 4px; }
.food-portion-value { font-size: 18px; color: var(--text); font-weight: 600; }
.food-portion-value strong { color: var(--accent); }

@media (max-width: 768px) {
  .article { padding: 36px 20px 64px; }
  .article-title { font-size: 30px; letter-spacing: -1px; }
  .article-lede { font-size: 17px; }
  .article h2 { font-size: 24px; margin-top: 44px; }
  .article h3 { font-size: 19px; }
  .index-hero { padding: 36px 20px 16px; }
  .food-hero { padding: 36px 20px 24px; }
  .food-stat-number { font-size: 36px; }
}

/* Food search box (on /carbs index) */
.food-search {
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 0 24px;
}

.food-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.food-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.food-search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.food-search-box input[type="search"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  padding: 14px 0;
  min-width: 0;
}

.food-search-box input::placeholder { color: var(--text-faint); }
.food-search-box input::-webkit-search-cancel-button { display: none; }

.food-search-box button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.food-search-box button:hover {
  background: var(--bg-card-elevated);
  color: var(--text);
}

.food-search-meta {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  margin: 12px 0 0;
}

.food-search-results {
  margin: 24px 0 96px;
}

@media (max-width: 720px) {
  .food-search { padding: 0 16px; }
  .food-search-box input[type="search"] { font-size: 15px; }
}

/* Standardized footer (used by all article/index pages) */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 40px 24px 48px;
}

.site-footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  font-size: 14px;
}

.site-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer-links a:hover { color: var(--accent); }

.site-footer-meta {
  font-size: 13px;
  color: var(--text-faint);
}

.site-footer-meta a { color: var(--text-muted); text-decoration: none; }

