/* ============================================
   Somatic Sensory — Design System
   Color Palette: "Warm Science"
   Fonts: Fraunces (headings) + Inter (body)
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-primary: #4A5568;
  --color-accent: #D97706;
  --color-secondary: #0D9488;
  --color-bg: #FAFAF7;
  --color-text: #1A1A2E;
  --color-subtle: #F0EEEB;
  --color-card: #FFFFFF;
  --color-dark: #1E293B;
  --color-muted: #6B7280;
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

/* --- Base Reset & Body --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-secondary);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-dark);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

/* --- Layout Utilities --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding: 5rem 0;
}

/* --- Eyebrow Text --- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 9999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background-color: #b45309;
  border-color: #b45309;
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent);
  color: #fff;
}

.btn-white {
  background-color: #fff;
  color: var(--color-dark);
  border-color: #fff;
}

.btn-white:hover {
  background-color: var(--color-bg);
  border-color: var(--color-bg);
  color: var(--color-dark);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}

.btn-secondary:hover {
  background-color: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-dark);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--color-accent);
}

.nav-logo svg {
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1010;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
@media (max-width: 768px) {
  .nav {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100dvh;
    flex-direction: column;
    background: #ffffff;
    padding: 5rem 2rem 2rem;
    gap: 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.35s ease;
    overflow-y: auto;
    z-index: 1005;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.875rem 0;
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--color-subtle);
    min-height: 44px;
  }

  .nav-links a:hover,
  .nav-links a.active {
    border-bottom-color: var(--color-accent);
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1002;
  }

  .nav-overlay.open {
    display: block;
  }
}

/* --- Hero Sections --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 7rem 1.5rem 4rem;
}

.hero-home {
  background: linear-gradient(165deg, var(--color-dark) 0%, #2d3a4e 30%, var(--color-primary) 60%, #8b9bb0 80%, var(--color-bg) 100%);
  min-height: 100vh;
}

.hero-page {
  min-height: 50vh;
  background: linear-gradient(165deg, var(--color-dark) 0%, #2d3a4e 50%, var(--color-primary) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-home .hero-content h1,
.hero-home .hero-content p,
.hero-page .hero-content h1,
.hero-page .hero-content p {
  color: #fff;
}

.hero-home .hero-content .eyebrow,
.hero-page .hero-content .eyebrow {
  color: var(--color-accent);
}

/* Neural SVG background motif */
.hero-bg-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.06;
}

/* --- Card Styles --- */
.card {
  background: var(--color-card);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.card-icon-accent {
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--color-accent);
}

.card-icon-secondary {
  background-color: rgba(13, 148, 136, 0.1);
  color: var(--color-secondary);
}

.card-icon-primary {
  background-color: rgba(74, 85, 104, 0.1);
  color: var(--color-primary);
}

/* Article cards */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  color: inherit;
}

.article-card-header {
  padding: 1.75rem 1.75rem 0;
}

.article-card-body {
  padding: 1rem 1.75rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-body h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.article-card-body p {
  color: var(--color-muted);
  font-size: 0.9375rem;
  flex: 1;
}

.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-subtle);
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.article-card-meta .read-time {
  font-weight: 500;
}

/* Category tags */
.category-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 9999px;
  text-transform: uppercase;
}

.tag-gut-brain {
  background-color: rgba(217, 119, 6, 0.1);
  color: #b45309;
}

.tag-heart-brain {
  background-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.tag-breath {
  background-color: rgba(13, 148, 136, 0.1);
  color: #0d9488;
}

.tag-fascia {
  background-color: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.tag-nutrition {
  background-color: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.tag-body-awareness {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

/* Category filter buttons */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1.5px solid var(--color-subtle);
  border-radius: 9999px;
  background: var(--color-card);
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(217, 119, 6, 0.05);
}

/* --- Section Headings --- */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--color-muted);
  font-size: 1.0625rem;
}

/* --- Decorative Line --- */
.divider-line {
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: 1rem auto;
}

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  text-align: center;
  padding: 4rem 1.5rem;
  border-radius: 1.5rem;
}

.cta-banner h2 {
  color: #fff;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.85);
}

/* --- Article Content --- */
.article-hero {
  min-height: 45vh;
  background: linear-gradient(165deg, var(--color-dark) 0%, #2d3a4e 50%, var(--color-primary) 100%);
}

.article-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-content p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-text);
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  font-size: 1.0625rem;
}

.article-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--color-subtle);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: var(--color-primary);
}

.article-content strong {
  font-weight: 600;
  color: var(--color-dark);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.article-meta .read-time {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* Key takeaway box */
.key-takeaway {
  background: rgba(13, 148, 136, 0.06);
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 2rem 0;
}

.key-takeaway h4 {
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Related articles */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--color-subtle);
}

.related-articles h3 {
  margin-bottom: 1.5rem;
}

.related-link {
  display: block;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--color-subtle);
  border-radius: 0.5rem;
  color: var(--color-dark);
  font-weight: 500;
  transition: all 0.2s ease;
}

.related-link:hover {
  background: rgba(217, 119, 6, 0.08);
  color: var(--color-accent);
}

.related-link span {
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-weight: 400;
  display: block;
  margin-top: 0.25rem;
}

/* --- Footer --- */
.footer {
  background-color: var(--color-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 0 2rem;
  position: relative;
}

.footer-divider {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.footer-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

.footer h4 {
  color: #fff;
  font-size: 1.0625rem;
  margin-bottom: 1.25rem;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--color-accent);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-links a {
  font-size: 0.9375rem;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Scroll margin for anchor targets --- */
[id] {
  scroll-margin-top: 80px;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .section-padding {
    padding: 3rem 0;
  }

  .hero {
    padding: 6rem 1.25rem 3rem;
  }

  .hero-page {
    min-height: 40vh;
  }

  .article-hero {
    min-height: 35vh;
  }

  .cta-banner {
    padding: 3rem 1.25rem;
    border-radius: 1rem;
  }

  .article-content {
    padding: 2rem 1.25rem 4rem;
  }
}
