/* ===== WellAged — Senior Health & Wellness ===== */
/* Warm, accessible, calming design for active seniors */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400&family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ===== CSS Variables ===== */
:root {
  --sage: #8fbc8f;
  --sage-dark: #6a9a6a;
  --sage-light: #b5d5b5;
  --sage-pale: #dceadc;
  --tan: #d4b896;
  --tan-dark: #b89b6f;
  --tan-light: #e5d4bc;
  --tan-pale: #f0e6d8;
  --cream: #faf5ef;
  --cream-dark: #f0e8dc;
  --white: #ffffff;
  --text-primary: #2d2a26;
  --text-secondary: #4a4540;
  --text-muted: #7a7470;
  --text-light: #9a9490;
  --border-light: #e8e0d5;
  --border-medium: #d4cec5;
  --shadow-sm: 0 2px 8px rgba(45, 42, 38, 0.06);
  --shadow-md: 0 4px 16px rgba(45, 42, 38, 0.08);
  --shadow-lg: 0 8px 32px rgba(45, 42, 38, 0.10);
  --shadow-hover: 0 8px 24px rgba(45, 42, 38, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-display: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', Tahoma, sans-serif;
  --transition: 0.3s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  font-size: 18px;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== Focus Visible ===== */
*:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--sage-dark);
  color: white;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 1rem;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 1rem;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.3;
  color: var(--text-primary);
  font-weight: 700;
}

h1 { font-size: 2.8rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }
p { margin-bottom: 1rem; }

a {
  color: var(--sage-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
a:hover { color: var(--tan-dark); }

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--sage);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto;
}

/* ===== Header / Navigation ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(250, 245, 239, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--sage), var(--sage-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.logo-tagline {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Desktop Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--sage-pale);
  color: var(--sage-dark);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--cream);
  z-index: 9999;
  flex-direction: column;
  padding: 2rem;
  overflow-y: auto;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0.5rem;
}

.mobile-nav a {
  display: block;
  padding: 1rem 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-light);
  transition: color var(--transition);
}

.mobile-nav a:hover {
  color: var(--sage-dark);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  background: linear-gradient(170deg, var(--sage-pale) 0%, var(--cream) 50%, var(--tan-pale) 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(143, 188, 143, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 184, 150, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(143, 188, 143, 0.2);
  color: var(--sage-dark);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(143, 188, 143, 0.3);
}

.hero h1 {
  margin-bottom: 1.25rem;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--sage-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--sage);
  color: white;
  border-color: var(--sage);
  box-shadow: 0 4px 12px rgba(143, 188, 143, 0.3);
}

.btn-primary:hover {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(143, 188, 143, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--white);
  border-color: var(--sage);
  color: var(--sage-dark);
}

/* ===== Category Cards ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--sage-light);
}

.category-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.25rem;
}

.category-icon.heart { background: #fde8e8; }
.category-icon.brain { background: #e8eafd; }
.category-icon.bone { background: #fdf3e8; }
.category-icon.sleep { background: #e8f0fd; }
.category-icon.medicare { background: #e8fdf0; }
.category-icon.fall { background: #fde8f5; }
.category-icon.nutrition { background: #f5fde8; }
.category-icon.pain { background: #fdf0e8; }
.category-icon.mental { background: #e8f8fd; }
.category-icon.vision { background: #f0e8fd; }

.category-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.category-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.6;
}

/* ===== Article / Guide Sections ===== */
.guide-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.guide-section h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--sage-dark);
}

.guide-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.guide-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.guide-section h3 {
  font-size: 1.3rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

.guide-section h4 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text-secondary);
}

.guide-section ul,
.guide-section ol {
  margin: 0.75rem 0 1rem 1.5rem;
  line-height: 2;
}

.guide-section li {
  margin-bottom: 0.35rem;
}

.guide-tip {
  background: var(--sage-pale);
  border-left: 4px solid var(--sage);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-size: 1rem;
}

.guide-tip strong {
  color: var(--sage-dark);
}

.guide-warning {
  background: #fef3e8;
  border-left: 4px solid var(--tan-dark);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
}

/* ===== Ad Slots ===== */
.ad-slot {
  min-height: 250px;
  background: #f0ebe3;
  border: 1px dashed #d4d0c8;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.5rem auto;
  max-width: 728px;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* ===== Interactive Tools ===== */
.tool-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.tool-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--sage-dark);
}

.tool-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--cream);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--sage);
  outline: none;
  background: var(--white);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tool-result {
  background: var(--sage-pale);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin-top: 1.5rem;
  text-align: center;
  display: none;
}

.tool-result.visible {
  display: block;
}

.tool-result .result-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--sage-dark);
  line-height: 1.2;
}

.tool-result .result-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.tool-result .result-detail {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ===== Exercise Library ===== */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.exercise-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.exercise-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.exercise-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--sage-pale), var(--sage-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.exercise-card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.exercise-card .exercise-meta-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.exercise-tag {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: var(--tan-pale);
  color: var(--tan-dark);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.exercise-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.exercise-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.exercise-steps li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.exercise-steps li::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.2rem;
  height: 1.2rem;
  background: var(--sage-light);
  color: var(--sage-dark);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Medicare Table ===== */
.medicare-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin: 2rem 0;
  -webkit-overflow-scrolling: touch;
}

.medicare-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  background: var(--white);
  font-size: 1rem;
}

.medicare-table thead th {
  background: var(--sage);
  color: white;
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.medicare-table thead th:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}

.medicare-table thead th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

.medicare-table tbody td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  line-height: 1.6;
}

.medicare-table tbody tr:nth-child(even) {
  background: var(--cream);
}

.medicare-table tbody tr:hover {
  background: var(--sage-pale);
}

.medicare-table tbody td:first-child {
  font-weight: 700;
  color: var(--sage-dark);
  white-space: nowrap;
}

/* ===== Medication Checklist ===== */
.med-checklist {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.med-checklist h3 {
  color: var(--sage-dark);
  margin-bottom: 0.5rem;
}

.med-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.med-row.med-header {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-medium);
  padding-bottom: 0.75rem;
}

.med-row input[type="text"],
.med-row input[type="time"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--cream);
}

.med-row input:focus {
  border-color: var(--sage);
  outline: none;
  background: var(--white);
}

.med-row button {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  transition: color var(--transition);
}

.med-row button:hover {
  color: #d9534f;
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--white);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  line-height: 1.4;
}

.faq-question:hover {
  color: var(--sage-dark);
}

.faq-icon {
  font-size: 1.5rem;
  color: var(--sage);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 600px;
}

.faq-answer-inner {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== Disclaimer ===== */
.disclaimer {
  background: var(--tan-pale);
  border: 2px solid var(--tan);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 2rem 0;
}

.disclaimer h3 {
  color: var(--tan-dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.disclaimer p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.8);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .logo-text {
  color: white;
  font-size: 1.4rem;
}

.footer-brand .logo-tagline {
  color: rgba(255,255,255,0.5);
}

.footer-brand p {
  margin-top: 1rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  line-height: 1.7;
}

.site-footer h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-footer ul {
  list-style: none;
  padding: 0;
}

.site-footer ul li {
  margin-bottom: 0.5rem;
}

.site-footer ul a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition);
}

.site-footer ul a:hover {
  color: var(--sage-light);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.4);
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: var(--sage);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--sage-dark);
  transform: translateY(-2px);
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Print Styles ===== */
@media print {
  .site-header, .site-footer, .back-to-top, .ad-slot, .nav-toggle, .mobile-nav {
    display: none !important;
  }
  .guide-section, .tool-card, .exercise-card, .med-checklist {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  body {
    background: white;
    color: black;
  }
  .hero {
    background: white;
  }
  .hero h1 {
    -webkit-text-fill-color: unset;
    background: none;
    color: #2d2a26;
  }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  html { font-size: 17px; }

  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.7rem; }

  .hero { padding: 3.5rem 0 3rem; }
  .hero h1 { font-size: 2.4rem; }

  .main-nav { display: none; }
  .nav-toggle { display: block; }

  .container { padding: 0 1.25rem; }
  .section { padding: 3rem 0; }

  .guide-section { padding: 2rem 1.5rem; }
  .tool-card { padding: 2rem 1.5rem; }

  .form-row { grid-template-columns: 1fr; }

  .med-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .med-row.med-header { display: none; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }

  .exercise-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 480px) {
  html { font-size: 16px; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1.1rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .guide-section { padding: 1.5rem 1.25rem; }
}
