@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --navy:       #0D1F3C;
  --teal:       #00B8A9;
  --teal-dim:   rgba(0,184,169,0.1);
  --teal-mid:   rgba(0,184,169,0.2);
  --amber:      #EF9F27;
  --bg:         #dee3e8;
  --bg-mid:     #f0f4f7;
  --surface:    #ffffff;
  --border:     rgba(13,31,60,0.1);
  --border-mid: rgba(13,31,60,0.07);
  --text:       #0D1F3C;
  --muted:      rgba(13,31,60,0.55);
  --faint:      rgba(13,31,60,0.38);
  --shadow-sm:  0 1px 3px rgba(13,31,60,0.06), 0 4px 16px rgba(13,31,60,0.05);
  --shadow-md:  0 4px 24px rgba(13,31,60,0.08);
  --radius:     16px;
  --radius-sm:  10px;
  --max-w:      1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: 'Outfit', sans-serif; }
img { display: block; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal);
  color: #04342C;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(222, 227, 232, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo {
  height: 36px;
  width: auto;
  mix-blend-mode: multiply;
}

.nav-blog-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex: 1;
}

.nav-cat {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-cat:hover { color: var(--text); background: rgba(13,31,60,0.05); }
.nav-cat.active { color: var(--teal); background: var(--teal-dim); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.search-icon { color: var(--muted); flex-shrink: 0; }
.search-input {
  border: none;
  outline: none;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  width: 160px;
}
.search-input::placeholder { color: var(--faint); }

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  margin-left: auto;
}
.nav-mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(13,31,60,0.7);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── Mobile Menu ── */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }

.mobile-close {
  position: absolute;
  top: 1.25rem; right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--muted);
  cursor: pointer;
}

.mob-cat {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s;
}
.mob-cat:hover, .mob-cat.active { color: var(--teal); }

/* ── Hero Section ── */
.hero-section {
  padding: 112px 0 64px;
  background: var(--bg);
}

.featured-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 52px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.featured-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), rgba(0,184,169,0.3));
}

.featured-left { display: flex; flex-direction: column; align-items: flex-start; }

.featured-title {
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 14px 0 18px;
}

.featured-sub {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 560px;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.author-chip { display: flex; align-items: center; gap: 12px; }
.author-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #085041);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.author-name { font-size: 13px; font-weight: 600; color: var(--text); }
.author-date { font-size: 11px; color: var(--faint); margin-top: 2px; }

.btn-read {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  padding: 10px 20px;
  border: 1.5px solid var(--teal-mid);
  border-radius: 8px;
  background: var(--teal-dim);
  transition: all 0.2s;
}
.btn-read:hover { background: rgba(0,184,169,0.18); }

/* Featured stat card */
.featured-visual { display: flex; justify-content: center; }

.featured-stat-card {
  background: var(--navy);
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%;
  max-width: 300px;
}
.fsc-num {
  font-size: 4rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.fsc-pct { font-size: 2rem; }
.fsc-label { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.5; margin-bottom: 20px; }
.fsc-divider { height: 1px; background: rgba(255,255,255,0.08); margin-bottom: 16px; }
.fsc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 10px;
}
.fsc-row:last-child { margin-bottom: 0; }
.fsc-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fsc-dot.teal  { background: var(--teal); }
.fsc-dot.amber { background: var(--amber); }

/* ── Category pill variants ── */
.cat-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.cat-nutrition  { background: rgba(16,185,129,0.12);  color: #059669; }
.cat-sleep      { background: rgba(99,102,241,0.12);  color: #6366f1; }
.cat-exercise   { background: rgba(239,159,39,0.12);  color: #c47d0a; }
.cat-biomarkers { background: rgba(0,184,169,0.12);   color: #00807a; }
.cat-protocol   { background: rgba(13,31,60,0.08);    color: #0D1F3C; }
.cat-longevity  { background: rgba(236,72,153,0.1);   color: #be185d; }

/* ── Category Filter Bar ── */
.cat-bar-wrap {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 68px;
  z-index: 50;
}

.cat-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }

.cat-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  transition: all 0.15s;
}
.cat-btn:hover { color: var(--text); background: rgba(13,31,60,0.05); }
.cat-btn.active {
  color: var(--teal);
  background: var(--teal-dim);
  border-color: var(--teal-mid);
}

/* ── Articles Section ── */
.articles-section { padding: 48px 0 80px; }

.articles-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.article-count {
  font-size: 12px;
  color: var(--faint);
  font-weight: 500;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── Article Card ── */
a.article-card, a.featured-card {
  text-decoration: none;
  color: inherit;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0,184,169,0.2);
}

.article-img {
  height: 180px;
  position: relative;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.article-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(13,31,60,0.18) 100%);
}
.art-pill { position: absolute; bottom: 12px; left: 14px; }

/* Gradient placeholder backgrounds per category */
.art-nutrition  { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.art-sleep      { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); }
.art-exercise   { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }
.art-biomarkers { background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); }
.art-protocol   { background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%); }
.art-nutrition2 { background: linear-gradient(135deg, #ecfdf5 0%, #bbf7d0 100%); }
.art-sleep2     { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); }
.art-longevity  { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.art-biomarkers2{ background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%); }

.article-body {
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  flex: 1;
}

.article-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--faint);
  font-weight: 500;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-mid);
}
.meta-dot { opacity: 0.5; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 80px 0;
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 14px; color: var(--muted); }

/* ── Newsletter ── */
.newsletter-section {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  padding: 72px 0;
}

.newsletter-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 52px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.newsletter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), rgba(0,184,169,0.3));
}

.nl-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.nl-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}

.nl-sub {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
}

.nl-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nl-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}
.nl-input:focus { border-color: var(--teal); }
.nl-input::placeholder { color: var(--faint); }

.nl-btn { width: 100%; justify-content: center; padding: 14px 20px; font-size: 14px; }

.nl-disclaimer { font-size: 11px; color: var(--faint); text-align: center; }

/* ── Footer ── */
.footer {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}

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

.footer-brand p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 240px;
  margin-top: 14px;
}

.footer-logo {
  height: 40px;
  width: auto;
  mix-blend-mode: multiply;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--teal); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 2rem;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--faint);
  line-height: 1.6;
  max-width: 520px;
}

/* ── Hidden state for filtering ── */
.article-card.hidden {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-card { grid-template-columns: 1fr; }
  .featured-visual { display: none; }
  .newsletter-card { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-actions { display: none; }
  .nav-mobile-toggle { display: flex; }

  .hero-section { padding: 96px 0 40px; }
  .featured-card { padding: 28px 24px; }
  .featured-title { font-size: 1.5rem; }

  .articles-grid { grid-template-columns: 1fr; }

  .newsletter-card { padding: 32px 24px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
