:root {
  color-scheme: light;
  --ink: #1f2b27;
  --muted: #68736f;
  --paper: #f7f5ee;
  --card: #fffefa;
  --line: #d9d8ce;
  --green: #235c4b;
  --green-soft: #dfece5;
  --gold: #bc7a28;
  --shadow: 0 12px 28px rgba(43, 55, 49, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 10;
  border-radius: 8px;
  background: white;
  color: var(--green);
  padding: .7rem 1rem;
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  background: var(--green);
  color: white;
  padding: 3rem 1.5rem 2.75rem;
}

.header-inner,
main {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 .5rem;
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow { color: #cce5d9; }
.section-kicker { color: var(--gold); }

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 1;
}

.intro {
  max-width: 660px;
  margin: 1rem 0 0;
  color: #e4eee9;
  font-size: 1.05rem;
  line-height: 1.55;
}

main { padding: 0 1.5rem 5rem; }

.controls {
  position: relative;
  z-index: 2;
  margin: -1.25rem 0 3.25rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.search-label {
  display: block;
  margin-bottom: .5rem;
  font-weight: 700;
}

input[type="search"] {
  width: 100%;
  border: 1px solid #bfc5c1;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  padding: .9rem 1rem;
  font: inherit;
}

input[type="search"]:focus {
  outline: 3px solid rgba(35, 92, 75, .2);
  border-color: var(--green);
}

.tab-scroller {
  overflow-x: auto;
  margin: 1rem -.25rem -.25rem;
  padding: 0 .25rem .25rem;
  scrollbar-width: thin;
}

.tab-list {
  display: flex;
  min-width: max-content;
  gap: .35rem;
  border-bottom: 1px solid var(--line);
  padding: 0 .15rem;
}

.tab-button {
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #58645f;
  padding: .65rem .8rem .75rem;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--green);
  background: #f3f6f2;
}

.tab-button:focus-visible {
  outline: 3px solid rgba(35, 92, 75, .25);
  outline-offset: 2px;
  border-radius: 6px 6px 0 0;
}

.tab-button[aria-selected="true"] {
  border-bottom-color: var(--green);
  color: var(--green);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  font-weight: 500;
}

.updated-at {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.section-status { text-align: right; }

.result-count {
  margin: 0 0 .25rem;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 750;
}

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

.resource-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 1.2rem;
}

.resource-card:hover {
  border-color: #b6b9ae;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.resource-card h3 {
  margin: 1rem 0 .65rem;
  font-size: 1.08rem;
  line-height: 1.35;
}

.summary {
  margin: 0;
  color: #505b57;
  font-size: .92rem;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.2rem;
}

.card-footer time {
  color: var(--muted);
  font-size: .8rem;
}

.open-link {
  color: var(--green);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: none;
}

.open-link:hover { text-decoration: underline; }

.empty-state,
.error-state {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 2rem;
  text-align: center;
}

.error-state { color: #8a2f2f; }

@media (max-width: 800px) {
  .resource-grid { grid-template-columns: 1fr; }
  .header-inner,
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-status { text-align: left; }
  .site-header { padding-top: 2rem; }
}
