@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..800;1,9..144,400..600&family=Inter:wght@400..700&display=swap");

:root {
  --ink: #22302f;
  --muted: #5f7275;
  --paper: #ffffff;
  --soft: #f4f7f5;
  --line: #e2ebe7;
  --line-strong: #cdddd7;
  --green: #2f7d78;
  --green-dark: #1c4f4d;
  --green-soft: #eef8f5;
  --coral: #e2725b;
  --coral-soft: #fbeee9;
  --warm: #fffcf5;
  --warm-line: #ecdfc6;
  --shadow-sm: 0 1px 2px rgba(28, 79, 77, 0.05), 0 2px 8px rgba(28, 79, 77, 0.04);
  --shadow-md: 0 8px 24px rgba(28, 79, 77, 0.09);
  --shadow-lg: 0 18px 44px rgba(28, 79, 77, 0.14);
  --radius: 16px;
  --radius-sm: 12px;
  --sidebar: 268px;
  --heading: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 105% -5%, var(--green-soft) 0%, transparent 55%),
    radial-gradient(700px 500px at -10% 100%, var(--coral-soft) 0%, transparent 50%),
    var(--soft);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-left: var(--sidebar);
}

a {
  color: inherit;
}

h1, h2, h3 {
  font-family: var(--heading);
  font-weight: 600;
  letter-spacing: -0.01em;
}

::selection {
  background: rgba(47, 125, 120, 0.18);
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

[hidden] {
  display: none !important;
}

/* ---------- Sidebar ---------- */

.site-header {
  align-items: stretch;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  justify-content: flex-start;
  left: 0;
  overflow-y: auto;
  padding: 30px 20px;
  position: fixed;
  top: 0;
  width: var(--sidebar);
  z-index: 10;
}

.brand {
  align-items: center;
  color: var(--green-dark);
  display: inline-flex;
  font-family: var(--heading);
  font-size: 25px;
  font-weight: 700;
  gap: 10px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  padding: 4px 6px;
  text-decoration: none;
}

.brand::before {
  background: url("../favicon.svg") center / contain no-repeat;
  content: "";
  flex: none;
  height: 30px;
  width: 30px;
}

.nav-toggle {
  display: none;
}

.nav {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: flex-start;
  padding: 0;
}

.nav a {
  align-items: center;
  border-radius: 11px;
  color: var(--green-dark);
  display: inline-flex;
  font-family: var(--body);
  font-size: 15.5px;
  font-weight: 600;
  min-height: 44px;
  padding: 11px 14px;
  position: relative;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-label {
  color: var(--muted);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 14px 0 2px;
  padding: 14px 14px 4px;
  position: relative;
  text-transform: uppercase;
}

.nav-label::before {
  background: var(--line);
  content: "";
  height: 1px;
  left: 14px;
  position: absolute;
  right: 14px;
  top: 0;
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--green-soft);
  color: var(--green-dark);
  outline: none;
  transform: translateX(2px);
}

.nav a[aria-current="page"] {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  box-shadow: var(--shadow-sm);
  color: #ffffff;
}

.nav a[aria-current="page"]:hover {
  color: #ffffff;
  transform: none;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  margin: 0 auto;
  max-width: 1120px;
  padding: clamp(52px, 8vw, 104px) clamp(18px, 4vw, 56px);
}

.hero-copy h1,
.page h1,
.article h1 {
  color: var(--green-dark);
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 600;
  line-height: 1.0;
  margin: 0 0 22px;
  max-width: 820px;
}

.lead {
  color: #3a4c4e;
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.62;
  margin: 0;
  max-width: 760px;
}

.eyebrow {
  align-items: center;
  color: var(--green);
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
  text-transform: uppercase;
}

.eyebrow::before {
  background: var(--coral);
  border-radius: 999px;
  content: "";
  height: 7px;
  width: 7px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-family: var(--body);
  font-size: 15.5px;
  font-weight: 600;
  gap: 8px;
  padding: 14px 24px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button.primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  box-shadow: var(--shadow-sm);
  color: #fff;
}

.button.primary:hover,
.button.primary:focus-visible {
  box-shadow: var(--shadow-md);
  outline: none;
  transform: translateY(-2px);
}

.button.secondary {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--green-dark);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  border-color: var(--green);
  outline: none;
  transform: translateY(-2px);
}

.hero-panel {
  align-self: center;
  background: linear-gradient(160deg, var(--green-dark) 0%, #16403f 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  color: #fff;
  overflow: hidden;
  padding: 32px;
  position: relative;
}

.hero-panel::before {
  background: radial-gradient(circle, rgba(226, 114, 91, 0.5) 0%, transparent 70%);
  border-radius: 50%;
  content: "";
  height: 180px;
  position: absolute;
  right: -60px;
  top: -60px;
  width: 180px;
}

.hero-panel p {
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
  padding: 18px 0;
  position: relative;
}

.hero-panel p:first-child {
  padding-top: 0;
}

.hero-panel p:last-child {
  border-bottom: 0;
  color: #ffe;
  font-family: var(--heading);
  font-size: 22px;
  font-style: italic;
  font-weight: 500;
  padding-bottom: 0;
}

/* ---------- Sections ---------- */

.section,
.page,
.article-page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 56px clamp(18px, 4vw, 56px);
}

.section-heading {
  margin-bottom: 28px;
}

.section h2,
.page h1,
.article h1 {
  margin-top: 0;
}

.section h2 {
  color: var(--green-dark);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.06;
  margin-bottom: 0;
}

/* ---------- Cards ---------- */

.topic-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.topic-card,
.article-preview,
.source-list article,
.callout {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.topic-card::before {
  background: linear-gradient(90deg, var(--green) 0%, var(--coral) 100%);
  content: "";
  height: 3px;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.topic-card:hover::before,
.topic-card:focus-visible::before {
  opacity: 1;
  transform: scaleX(1);
}

.topic-card span {
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  margin-top: auto;
  padding-top: 18px;
  transition: gap 0.18s ease;
}

.topic-card span::after {
  content: "\2192";
  transition: transform 0.18s ease;
}

.topic-card:hover span::after,
.topic-card:focus-visible span::after {
  transform: translateX(4px);
}

.topic-card h3,
.article-preview h2,
.source-list h2,
.callout h2 {
  color: var(--green-dark);
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 10px;
}

.topic-card p,
.article-preview p,
.source-list p,
.callout p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.split {
  align-items: start;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
}

.rich-text {
  color: #3a4c4e;
  font-size: 19px;
  line-height: 1.78;
}

.rich-text.wide {
  max-width: 800px;
}

.rich-text p {
  margin: 0 0 20px;
}

/* ---------- Blockquote ---------- */

blockquote {
  background: linear-gradient(135deg, var(--green-soft) 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-left: 4px solid var(--coral);
  border-radius: var(--radius-sm);
  color: var(--green-dark);
  font-family: var(--heading);
  font-size: clamp(21px, 3vw, 26px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.4;
  margin: 32px 0;
  padding: 26px 28px;
  position: relative;
}

/* ---------- Lists / grids ---------- */

.article-list,
.source-list {
  display: grid;
  gap: 18px;
  max-width: 860px;
}

.category-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px 0 46px;
  max-width: 860px;
}

.category-grid a {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--green-dark);
  display: flex;
  font-size: 17px;
  font-weight: 600;
  min-height: 58px;
  padding: 17px 20px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.category-grid a:hover,
.category-grid a:focus-visible,
.topic-card:hover,
.topic-card:focus-visible,
.article-preview:hover,
.article-preview:focus-visible {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  outline: none;
  transform: translateY(-3px);
}

.article-category {
  margin-top: 44px;
}

.search-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 30px 0 12px;
  max-width: 860px;
  padding: 24px;
}

.search-panel h2 {
  color: var(--green-dark);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 18px;
}

.search-form {
  align-items: center;
  display: flex;
  gap: 12px;
}

.search-form input {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  flex: 1;
  font: inherit;
  min-height: 52px;
  min-width: 0;
  padding: 0 20px;
}

.search-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 125, 120, 0.12);
  outline: none;
}

.search-status {
  color: var(--muted);
  font-size: 15px;
  margin: 14px 0 0;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading.compact h2 {
  color: var(--green-dark);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

.empty-state {
  background: var(--warm);
  border: 1px solid var(--warm-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  max-width: 860px;
  padding: 24px;
}

.empty-state p {
  color: #6b5a3c;
  font-size: 18px;
  line-height: 1.65;
  margin: 0 0 16px;
}

.empty-state p:last-child {
  margin-bottom: 0;
}

/* ---------- Article preview ---------- */

.article-preview {
  display: block;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.article-preview span {
  color: var(--green);
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* ---------- Article page ---------- */

.article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin: 0 auto;
  max-width: 800px;
  padding: clamp(28px, 5vw, 60px);
}

.article h1 {
  font-size: clamp(38px, 6vw, 64px);
  margin-bottom: 8px;
}

.article p {
  color: #35474a;
  font-size: 19px;
  line-height: 1.8;
}

.article-meta,
.source-note,
.note {
  color: var(--muted);
}

.article-meta {
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

/* ---------- Text-to-speech player ---------- */

.tts-player {
  margin: 0 0 24px;
}

.tts-archive {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 18px;
}

.tts-home {
  margin: 0;
}

.tts-toggle {
  align-items: center;
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-dark);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--body);
  font-size: 14.5px;
  font-weight: 700;
  gap: 10px;
  padding: 10px 20px 10px 12px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.tts-toggle:hover,
.tts-toggle:focus-visible {
  background: #fff;
  border-color: var(--green);
  outline: none;
  transform: translateY(-1px);
}

.tts-home .tts-toggle {
  background: #fff;
  border-color: var(--line-strong);
  font-size: 15.5px;
  font-weight: 600;
  padding: 14px 24px 14px 14px;
}

.tts-home .tts-toggle:hover,
.tts-home .tts-toggle:focus-visible {
  background: #fff;
  border-color: var(--green);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.tts-icon {
  align-items: center;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.tts-stop {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
}

.tts-stop:hover,
.tts-stop:focus-visible {
  border-color: var(--coral);
  color: var(--green-dark);
  outline: none;
}

.tts-status {
  color: var(--muted);
  flex-basis: 100%;
  font-size: 14px;
  margin: 0;
}

.callout {
  background: linear-gradient(135deg, var(--coral-soft) 0%, #ffffff 100%);
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-sm);
  margin: 32px 0;
}

.callout h2 {
  align-items: center;
  color: var(--coral);
  display: flex;
  font-size: 18px;
  gap: 8px;
}

.callout h2::before {
  content: "\2728";
  font-size: 18px;
}

.source-note {
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.6;
  margin-top: 36px;
  padding-top: 20px;
}

.source-list a,
.source-note a {
  color: var(--green);
  font-weight: 700;
  text-decoration-color: rgba(47, 125, 120, 0.35);
  text-underline-offset: 3px;
}

.source-list a:hover,
.source-note a:hover {
  text-decoration-color: var(--green);
}

/* ---------- Back link ---------- */

.back-link {
  margin: 0 auto 22px;
  max-width: 800px;
}

.back-link a {
  align-items: center;
  color: var(--green);
  display: inline-flex;
  font-size: 14.5px;
  font-weight: 600;
  gap: 6px;
  text-decoration: none;
  transition: gap 0.18s ease;
}

.back-link a::before {
  content: "\2190";
}

.back-link a:hover {
  gap: 10px;
}

/* ---------- Tags ---------- */

.tag {
  align-items: center;
  background: var(--green-soft);
  border-radius: 999px;
  color: var(--green-dark);
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 700;
  gap: 6px;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.18s ease, color 0.18s ease;
}

a.tag:hover,
a.tag:focus-visible {
  background: var(--green);
  color: #fff;
  outline: none;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  margin-top: 56px;
  padding: 44px clamp(18px, 4vw, 56px) 32px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 48px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
}

.footer-brand {
  max-width: 360px;
}

.footer-title {
  align-items: center;
  color: var(--green-dark);
  display: inline-flex;
  font-family: var(--heading);
  font-size: 20px;
  font-weight: 700;
  gap: 9px;
  margin: 0 0 8px;
}

.footer-title::before {
  background: url("../favicon.svg") center / contain no-repeat;
  content: "";
  height: 22px;
  width: 22px;
}

.footer-tag {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-content: flex-start;
}

.footer-nav a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--green);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-legal {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  margin: 32px auto 0;
  max-width: 1120px;
  padding-top: 22px;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 850px) {
  body {
    padding-left: 0;
  }

  .site-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
    border-right: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    height: auto;
    justify-content: space-between;
    padding: 14px 18px;
    position: sticky;
    width: 100%;
  }

  .brand {
    font-size: 22px;
  }

  .nav-toggle {
    align-items: center;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    border: 0;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    gap: 9px;
    min-height: 44px;
    padding: 10px 18px;
  }

  .nav-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(47, 125, 120, 0.28);
    outline: none;
  }

  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 18px;
  }

  .nav-toggle-icon {
    position: relative;
  }

  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    content: "";
    left: 0;
    position: absolute;
  }

  .nav-toggle-icon::before {
    top: -6px;
  }

  .nav-toggle-icon::after {
    top: 6px;
  }

  .nav {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: none;
    flex-basis: 100%;
    margin-top: 4px;
    padding: 8px;
    width: 100%;
  }

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

  .nav a {
    font-size: 16px;
    min-height: 46px;
  }

  .nav a:hover {
    transform: none;
  }

  .nav-label {
    padding-left: 12px;
  }

  .nav-label::before {
    left: 12px;
    right: 12px;
  }

  .hero,
  .split {
    display: block;
  }

  .hero-panel {
    margin-top: 32px;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .search-form .button {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .hero-copy h1,
  .page h1,
  .article h1 {
    font-size: 40px;
  }

  .lead,
  .rich-text,
  .article p {
    font-size: 17px;
  }

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

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
