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

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: #000;
  background: #fff;
  padding-bottom: 4rem; /* space for fixed nav */
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Righteous', 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.3rem); }

p { font-size: 1rem; line-height: 1.7; }

a {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 200ms ease;
}
a:hover { opacity: 0.6; }

/* ===== Layout ===== */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main > article > section {
  padding: 3rem 0;
}

/* ===== Fixed Bottom Nav ===== */
header {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #000;
  border-top: 2px solid #000;
}

header > nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 56px;
}

.nav-brand {
  font-family: 'Righteous', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem 0.75rem 0;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-brand:hover { opacity: 0.75; color: #fff; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links > a {
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.75rem 0.65rem;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(255,255,255,0.15);
  transition: background 200ms ease, opacity 200ms ease;
}
.nav-links > a:hover { background: rgba(255,255,255,0.1); opacity: 1; }
.nav-links > a.active { border-bottom: 2px solid #fff; }

.nav-search {
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
}

.nav-search input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  width: 140px;
  outline: none;
  transition: border-color 200ms ease, background 200ms ease;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.5); }
.nav-search input:focus {
  border-color: #fff;
  background: rgba(255,255,255,0.15);
}

.nav-search button {
  background: #fff;
  border: none;
  color: #000;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: opacity 200ms ease;
  min-height: 40px;
}
.nav-search button:hover { opacity: 0.8; }

/* ===== Hero ===== */
.hero {
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 0;
  border-bottom: 3px solid #000;
  background: #fff;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2.5rem;
  width: 100%;
}

.hero-eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: #000;
}

.hero h1 {
  margin-bottom: 1rem;
  max-width: 900px;
}

.hero-desc {
  font-size: 1.1rem;
  max-width: 680px;
  color: #333;
  line-height: 1.6;
}

/* ===== eyebrow for h2 ===== */
h2 small.eyebrow {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.4rem;
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin-top: 2rem;
}

.card {
  border: 2px solid #000;
  padding: 1.5rem;
  background: #fff;
  box-shadow: 4px 4px 0 #000;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.card h3 a { text-decoration: none; color: #000; }
.card h3 a:hover { text-decoration: underline; opacity: 1; }

.card p {
  font-size: 0.875rem;
  color: #444;
  line-height: 1.55;
  margin: 0;
}

.card-date {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

/* ===== Page Header ===== */
.page-header {
  border-bottom: 3px solid #000;
  padding-bottom: 2.5rem !important;
}

.page-header .section-inner {
  padding-top: 2rem;
}

.page-desc {
  font-size: 1.05rem;
  color: #333;
  max-width: 680px;
  margin-top: 1rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.pub-date, .mod-date {
  display: inline-block;
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 1rem;
}
.breadcrumb a { color: #666; }
.breadcrumb a:hover { color: #000; }

/* ===== Prose ===== */
.prose {
  max-width: 780px;
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p {
  margin-bottom: 1.2rem;
}

.prose ul, .prose ol {
  margin: 1rem 0 1.2rem 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

.prose a {
  color: #000;
  font-weight: 600;
}

.prose blockquote {
  border-left: 4px solid #000;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: #f8f8f8;
  font-style: italic;
}

.prose code {
  background: #f0f0f0;
  padding: 0.15em 0.4em;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
}

.prose pre {
  background: #000;
  color: #fff;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.prose th, .prose td {
  border: 1px solid #000;
  padding: 0.6rem 0.9rem;
  text-align: left;
}

.prose th {
  background: #000;
  color: #fff;
  font-weight: 600;
}

.prose tr:nth-child(even) td { background: #f8f8f8; }

.prose img {
  max-width: 100%;
  height: auto;
  border: 2px solid #000;
  margin: 1.5rem 0;
  display: block;
}

/* ===== Children / Related Sections ===== */
.cards-section h2, .children-section h2, .related-section h2 {
  margin-bottom: 0;
}

.children-list {
  list-style: none;
  margin-top: 1.5rem;
  display: grid;
  gap: 1px;
  border: 2px solid #000;
}

.children-list > li > article {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #000;
  transition: background 200ms ease;
}
.children-list > li:last-child > article { border-bottom: none; }
.children-list > li > article:hover { background: #f5f5f5; }

.children-list h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.children-list h3 a { text-decoration: none; color: #000; }
.children-list h3 a:hover { text-decoration: underline; }

.children-list p {
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 0.3rem;
}

.children-list time {
  font-size: 0.75rem;
  color: #888;
}

/* ===== Article Hero Image ===== */
.article-hero-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border: 2px solid #000;
  display: block;
}

/* ===== Link List ===== */
.link-list {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.link-list a {
  display: inline-block;
  border: 2px solid #000;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 200ms ease, color 200ms ease;
}
.link-list a:hover {
  background: #000;
  color: #fff;
  opacity: 1;
}

/* ===== Footer ===== */
footer {
  background: #000;
  color: #fff;
  padding: 3.5rem 0 2rem;
  border-top: 3px solid #000;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-brand {
  font-family: 'Righteous', sans-serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 2.5rem;
  line-height: 1;
  display: block;
  text-decoration: none;
}
.footer-brand:hover { opacity: 0.75; color: #fff; }

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-cols dl { margin: 0; }

.footer-cols dt {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #333;
}

.footer-cols dd {
  margin: 0 0 0.6rem;
}

.footer-cols dd a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 200ms ease;
  display: inline-block;
  min-height: 28px;
  padding: 2px 0;
}
.footer-cols dd a:hover { color: #fff; opacity: 1; }

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
  line-height: 1.7;
}

.footer-bottom a {
  color: #888;
  text-decoration: none;
}
.footer-bottom a:hover { color: #fff; opacity: 1; }

/* ===== Reveal / Scroll Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

.stagger-list > li {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.stagger-list.visible > li { opacity: 1; transform: translateY(0); }
.stagger-list.visible > li:nth-child(1) { transition-delay: 0.05s; }
.stagger-list.visible > li:nth-child(2) { transition-delay: 0.12s; }
.stagger-list.visible > li:nth-child(3) { transition-delay: 0.19s; }
.stagger-list.visible > li:nth-child(4) { transition-delay: 0.26s; }
.stagger-list.visible > li:nth-child(5) { transition-delay: 0.33s; }
.stagger-list.visible > li:nth-child(6) { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger-list > li {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body { padding-bottom: 56px; }

  header > nav {
    grid-template-columns: auto 1fr;
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
  }

  .nav-search {
    padding-left: 0;
  }

  .nav-search input {
    width: 120px;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

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

  .hero {
    min-height: 40vh;
  }

  .prose {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .section-inner { padding: 0 1rem; }
  .hero-inner { padding: 2rem 1rem 2rem; }
  .footer-inner { padding: 0 1rem; }
  .nav-search input { width: 90px; font-size: 0.75rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .footer-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-cols dl:last-child {
    grid-column: 1 / -1;
  }
}
