:root {
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-strong: #eef6f3;
  --text: #15252a;
  --muted: #5f7279;
  --border: rgba(21, 37, 42, 0.1);
  --brand: #0f7a76;
  --brand-dark: #0c5f5c;
  --accent: #3a8ddb;
  --success: #17795e;
  --danger: #b54444;
  --shadow: 0 18px 40px rgba(21, 37, 42, 0.08);
  --shadow-soft: 0 10px 24px rgba(21, 37, 42, 0.06);
  --radius-lg: 28px;
  --container: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(58, 141, 219, 0.11), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 122, 118, 0.1), transparent 26%),
    var(--bg);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(var(--container), calc(100% - 2rem)); margin: 0 auto; }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; background: var(--text); color: #fff;
  padding: 0.75rem 1rem; border-radius: 999px; z-index: 1000;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px);
  background: rgba(245, 248, 247, 0.84); border-bottom: 1px solid rgba(21, 37, 42, 0.06);
}
.nav-shell { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 82px; }
.brand-mark { display: inline-flex; align-items: center; gap: 0.9rem; }
.brand-badge {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 800; box-shadow: var(--shadow-soft);
}
.brand-mark strong, .footer-brand strong { display: block; font-size: 1rem; }
.brand-mark small, .footer-brand small { color: var(--muted); display: block; }
.site-nav { display: flex; align-items: center; gap: 0.35rem; }
.site-nav a { padding: 0.75rem 1rem; border-radius: 999px; color: var(--muted); font-weight: 600; transition: 0.2s ease; }
.site-nav a:hover, .site-nav a.active { color: var(--text); background: rgba(15, 122, 118, 0.1); }

.nav-toggle { display: none; border: 0; background: transparent; padding: 0.35rem; }
.nav-toggle span { display: block; width: 28px; height: 3px; background: var(--text); border-radius: 999px; margin: 5px 0; }

.hero, .page-hero { padding: 5.5rem 0 4rem; }
.page-hero-compact { padding-bottom: 2rem; }
.hero-grid, .split-section, .two-column, .form-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }

.hero-copy h1, .page-hero h1, .section-heading h2, .content-card h2, .final-cta h2 {
  font-family: "Source Serif 4", serif; line-height: 1.08; margin: 0 0 1rem;
}
.hero-copy h1, .page-hero h1 { font-size: clamp(2.8rem, 7vw, 5.2rem); max-width: 11ch; }
.hero-text, .page-hero p, .section-heading p { font-size: 1.08rem; color: var(--muted); max-width: 62ch; }

.eyebrow {
  display: inline-flex; margin: 0 0 1rem; padding: 0.45rem 0.8rem; border-radius: 999px;
  background: rgba(58, 141, 219, 0.12); color: var(--brand-dark); font-weight: 800;
  letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.8rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin: 1.75rem 0; }
.hero-actions.centered { justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px;
  padding: 0.9rem 1.3rem; border-radius: 999px; border: 1px solid transparent; font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; box-shadow: var(--shadow-soft); }
.btn-secondary { background: rgba(255,255,255,0.72); border-color: rgba(21,37,42,0.1); }

.hero-panel, .metric-card, .mini-card, .feature-card, .tile, .topic-card, .testimonial, .content-card, .article-card, .calculator-card, .education-card, .principle-card, .timeline-item, .popular-panel {
  background: rgba(255,255,255,0.92); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--radius-lg);
}
.hero-panel { padding: 1.25rem; background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(238,246,243,0.98)); }
.metric-card { padding: 1.6rem; margin-bottom: 1rem; }
.metric-card span, .tile-tag { color: var(--brand-dark); font-weight: 800; text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.03em; }
.metric-card strong { display: block; font-size: 1.7rem; margin: 0.35rem 0 0.6rem; }
.hero-stack { display: grid; gap: 1rem; }
.mini-card, .feature-card, .tile, .topic-card, .testimonial, .article-card, .principle-card { padding: 1.4rem; }

.hero-points, .check-list, .quick-tips, .contact-list, .footer-links, .number-list { margin: 0; padding-left: 1.15rem; }
.text-link { color: var(--brand-dark); font-weight: 700; }
.section { padding: 2rem 0 5rem; }
.surface { background: linear-gradient(180deg, rgba(15, 122, 118, 0.04), rgba(58, 141, 219, 0.03)); }
.section-heading { margin-bottom: 1.7rem; }

.feature-grid, .wellness-grid, .testimonial-grid, .article-grid, .calculator-grid, .education-grid, .principles-grid { display: grid; gap: 1.25rem; }
.feature-grid, .wellness-grid, .article-grid, .principles-grid, .testimonial-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.content-card, .checklist-card { padding: 1.8rem; }
.habit-list { display: grid; gap: 0.8rem; }
.habit-list label { display: flex; gap: 0.7rem; align-items: flex-start; }
.inline-form, .stack-form, .calculator-form { display: grid; gap: 0.8rem; }

label { font-weight: 700; }
input, select, textarea {
  width: 100%; border: 1px solid rgba(21, 37, 42, 0.16); border-radius: 16px;
  padding: 0.95rem 1rem; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, button:focus, summary:focus { outline: 3px solid rgba(58, 141, 219, 0.24); outline-offset: 2px; }
.form-note, .help-text, .footer-copy { color: var(--muted); }
.form-message { min-height: 1.5rem; font-weight: 700; }
.form-message.success { color: var(--success); }
.form-message.error { color: var(--danger); }
.final-cta { text-align: center; padding-bottom: 5.5rem; }

.site-footer { padding: 3rem 0 1.2rem; background: #eaf2ef; border-top: 1px solid rgba(21, 37, 42, 0.08); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; }
.footer-grid h2 { font-size: 1rem; margin-top: 0; }
.footer-bottom { padding-top: 1rem; margin-top: 1.2rem; border-top: 1px solid rgba(21, 37, 42, 0.08); color: var(--muted); }

.back-to-top {
  position: fixed; right: 1rem; bottom: 1rem; border: 0; background: var(--text); color: #fff;
  padding: 0.85rem 0.95rem; border-radius: 999px; box-shadow: var(--shadow-soft); opacity: 0;
  pointer-events: none; transform: translateY(12px); transition: 0.2s ease;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.tools-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.search-field { flex: 1; }
.popular-panel { padding: 1rem 1.2rem; min-width: 280px; }
.popular-panel h2 { margin: 0 0 0.7rem; font-size: 1rem; }
.popular-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.popular-links a, .filter-chip {
  display: inline-flex; align-items: center; padding: 0.65rem 0.9rem; border-radius: 999px;
  background: rgba(15, 122, 118, 0.08); color: var(--brand-dark); font-weight: 700;
}
.filter-chip { border: 1px solid transparent; }
.filter-chip.active { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; }
.calculator-grid, .education-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calculator-card, .education-card { padding: 1.5rem; }
.result-box { background: var(--surface-strong); border: 1px dashed rgba(15,122,118,0.24); padding: 1rem; border-radius: 18px; min-height: 80px; }
.result-box.error { border-color: rgba(181,68,68,0.3); background: rgba(181,68,68,0.08); }
.filter-bar, .faq-list, .timeline { display: grid; gap: 1rem; }
.filter-bar { display: flex; flex-wrap: wrap; margin-bottom: 1.5rem; }
.faq-item { background: rgba(255,255,255,0.9); border: 1px solid var(--border); border-radius: 18px; padding: 1rem 1.2rem; box-shadow: var(--shadow-soft); }
.faq-item summary { cursor: pointer; font-weight: 800; }
.timeline-item { display: grid; grid-template-columns: 56px 1fr; gap: 1rem; padding: 1.35rem; }
.timeline-item span {
  width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 800; font-size: 1.2rem;
}

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.hidden-card { display: none; }

.compact-heading { margin-bottom: 1rem; }
.input-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.input-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-group { display: grid; gap: 0.45rem; }
.form-group-inline { max-width: 280px; }
.field-error { min-height: 1.15rem; color: var(--danger); font-size: 0.88rem; }
.invalid { border-color: rgba(181, 68, 68, 0.65); background: rgba(181, 68, 68, 0.04); }
.action-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.2rem; }
.interpretation-text { margin: 0; color: var(--muted); }
.save-status { margin: 0; color: var(--brand-dark); font-weight: 700; min-height: 1.4rem; }
.checkin-card { margin-bottom: 1.5rem; }
.checkin-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.trend-panel { background: var(--surface-strong); border: 1px dashed rgba(15,122,118,0.24); border-radius: 18px; padding: 1rem; }
.trend-panel h3 { margin-top: 0; margin-bottom: 0.5rem; }
.education-accordion { display: grid; gap: 1rem; }
.education-detail { background: rgba(255,255,255,0.92); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-soft); overflow: hidden; }
.education-detail summary { list-style: none; cursor: pointer; padding: 1.2rem 1.4rem; font-weight: 800; }
.education-detail summary::-webkit-details-marker { display: none; }
.education-detail-body { padding: 0 1.4rem 1.3rem; color: var(--muted); }
.submit-button:disabled { opacity: 0.75; cursor: wait; transform: none; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.checkbox-grid label { display: flex; gap: 0.65rem; align-items: flex-start; font-weight: 600; }
.checkbox-grid input { width: auto; margin-top: 0.2rem; }
.plan-output { min-height: 120px; }
.plan-placeholder { margin: 0; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.plan-wide { grid-column: 1 / -1; }

@media (max-width: 980px) {
  .hero-grid, .split-section, .two-column, .form-layout, .footer-grid, .calculator-grid, .education-grid, .feature-grid, .wellness-grid, .testimonial-grid, .article-grid, .principles-grid, .tile-grid { grid-template-columns: 1fr; }
  .tools-toolbar { flex-direction: column; align-items: stretch; }
  .popular-panel { min-width: 0; }
  .input-grid, .input-grid-5, .checkin-insights, .checkbox-grid, .plan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: calc(100% + 0.5rem); left: 1rem; right: 1rem; background: rgba(255,255,255,0.98);
    border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); padding: 0.75rem;
    display: none; flex-direction: column; align-items: stretch; transform-origin: top; animation: navFade 0.18s ease;
  }
  .site-nav.open { display: flex; }
  .site-nav a { border-radius: 16px; }
  .hero, .page-hero { padding-top: 4rem; }
  .hero-copy h1, .page-hero h1 { max-width: 100%; }
}

@keyframes navFade {
  from { opacity: 0; transform: scaleY(0.94) translateY(-6px); }
  to { opacity: 1; transform: scaleY(1) translateY(0); }
}
