:root {
  --ink: #17251d;
  --muted: #627368;
  --paper: #f5fbf4;
  --paper-deep: #eaf6e9;
  --surface: rgba(255, 255, 250, 0.74);
  --surface-strong: rgba(255, 255, 250, 0.9);
  --saffron: #4f8a63;
  --marigold: #b9dcc0;
  --indigo: #1f5e42;
  --leaf: #1f7250;
  --line: rgba(23, 37, 29, 0.14);
  --shadow: 0 24px 70px rgba(42, 86, 57, 0.13);
  --body-bg:
    radial-gradient(circle at 8% 12%, rgba(179, 220, 189, 0.54), transparent 24rem),
    radial-gradient(circle at 92% 8%, rgba(155, 205, 168, 0.28), transparent 26rem),
    linear-gradient(135deg, #fbfff8 0%, var(--paper) 48%, #eef8ec 100%);
}

body.dark-theme {
  --ink: #ecf7ee;
  --muted: #b4c9ba;
  --paper: #101a14;
  --paper-deep: #15231a;
  --surface: rgba(21, 35, 26, 0.78);
  --surface-strong: rgba(25, 42, 31, 0.94);
  --saffron: #9fd6ad;
  --marigold: #345f42;
  --indigo: #a5d8b3;
  --leaf: #9fd6ad;
  --line: rgba(236, 247, 238, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --body-bg:
    radial-gradient(circle at 10% 10%, rgba(65, 115, 79, 0.28), transparent 25rem),
    radial-gradient(circle at 88% 6%, rgba(111, 151, 122, 0.14), transparent 28rem),
    linear-gradient(135deg, #08110c 0%, var(--paper) 52%, #0d1711 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--body-bg);
  font-family: Manrope, sans-serif;
  min-height: 100vh;
  transition: background 220ms ease, color 220ms ease;
}

a {
  color: inherit;
}

code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.1rem 0.35rem;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(90deg, rgba(31, 94, 66, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(31, 94, 66, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
}

.hero,
main,
.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0;
}

.brand,
.nav-link,
.button {
  text-decoration: none;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: Alegreya, serif;
  font-size: 1.4rem;
}

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px 14px;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--leaf);
  transform: translateY(-2px);
}

.nav-link {
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 42px;
  align-items: center;
  padding: 44px 0 54px;
}

.eyebrow,
.section-kicker,
.label {
  color: var(--saffron);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: Alegreya, serif;
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.8rem, 6.4vw, 5.8rem);
}

h2 {
  font-size: clamp(2.1rem, 5vw, 4.2rem);
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  line-height: 1.65;
  margin: 22px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.resource-card:hover {
  transform: translateY(-4px);
}

.primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 8px 8px 0 var(--marigold);
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(145deg, var(--surface-strong), rgba(255, 255, 255, 0.08)),
    var(--paper-deep);
  box-shadow: var(--shadow);
  padding: 32px;
}

.card-ring {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -58px;
  top: -46px;
  border: 38px solid rgba(79, 138, 99, 0.2);
  border-radius: 50%;
}

.hero-card strong {
  display: block;
  font-family: Alegreya, serif;
  font-size: 6.7rem;
  line-height: 0.8;
  margin-top: 88px;
}

.hero-card span {
  color: var(--muted);
  font-weight: 800;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 36px;
}

.mini-stats div {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 16px;
}

.mini-stats b {
  display: block;
  font-size: 1.45rem;
}

.mini-stats small {
  color: var(--muted);
  font-weight: 700;
}

.panel,
.resources {
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: 0 12px 44px rgba(42, 86, 57, 0.08);
  margin: 22px 0;
  padding: clamp(24px, 4vw, 44px);
}

.intro-panel,
.section-heading {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 28px;
  align-items: end;
}

.panel p,
.steps {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  margin: 0;
}

.resources {
  margin-top: 44px;
}

.search-wrap {
  display: grid;
  gap: 8px;
}

.search-wrap label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  outline: none;
  padding: 16px 20px;
}

.search-wrap input:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 4px rgba(79, 138, 99, 0.14);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}

.filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 16px;
}

.filter.active {
  background: var(--indigo);
  border-color: var(--indigo);
  color: var(--paper);
}

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

.resource-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface-strong);
  overflow: hidden;
  padding: 22px;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.resource-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: var(--accent, var(--saffron));
}

.resource-card:hover {
  border-color: color-mix(in srgb, var(--leaf) 45%, var(--line));
  box-shadow: 10px 10px 0 rgba(31, 94, 66, 0.09);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.type-pill {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, var(--saffron)) 16%, transparent);
  color: var(--accent, var(--saffron));
  font-size: 0.75rem;
  font-weight: 900;
  padding: 8px 10px;
  text-transform: uppercase;
}

.year {
  color: var(--muted);
  font-weight: 800;
}

.resource-card h3 {
  font-family: Alegreya, serif;
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 28px 0 12px;
}

.resource-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 9px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  margin: 18px 0 0;
  padding: 28px;
  text-align: center;
}

.steps {
  padding-left: 22px;
}

.steps li + li {
  margin-top: 10px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-weight: 700;
  padding: 34px 0 44px;
}

@media (max-width: 900px) {
  .hero-grid,
  .intro-panel,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding-top: 28px;
  }

  .hero-card {
    min-height: 340px;
  }

  .hero-card strong {
    margin-top: 70px;
  }

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

@media (max-width: 620px) {
  .hero,
  main,
  .footer {
    width: min(100% - 22px, 1180px);
  }

  .nav {
    align-items: flex-start;
    gap: 16px;
  }

  .nav-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 10px;
  }

  .nav-link {
    display: none;
  }

  h1 {
    font-size: clamp(2.65rem, 12.5vw, 3.9rem);
  }

  .hero-card strong {
    font-size: 5.4rem;
  }

  .mini-stats,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}
