:root {
  --green-900: #16401f;
  --green-700: #1a5f2b;
  --green-600: #237a38;
  --sage-100: #eef5ef;
  --sage-200: #e0eee3;
  --gold-500: #f2c14e;
  --ink-900: #22252a;
  --ink-600: #565d5f;
  --slate-500: #6b7280;
  --white: #ffffff;
  --line: #d9e4db;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(22,64,31,0.06), 0 1px 3px rgba(22,64,31,0.08);
  --shadow-md: 0 4px 14px rgba(22,64,31,0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--sage-100);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Fraunces', serif; letter-spacing: -0.01em; }
a { text-decoration: none; color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--green-700); color: white; padding: 10px 16px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-500);
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--green-900);
  line-height: 1.1;
}
.brand-name span {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--slate-500);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 1px;
}
.header-nav { display: flex; gap: 28px; font-size: 14.5px; font-weight: 500; color: var(--ink-600); }
.header-nav a:hover { color: var(--green-700); }

.hero { max-width: 1080px; margin: 0 auto; padding: 56px 24px 40px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--green-700);
  background: var(--sage-200); padding: 5px 12px; border-radius: 100px;
  margin-bottom: 18px; letter-spacing: 0.02em;
}
.hero h1 {
  font-size: clamp(32px, 4.5vw, 46px);
  line-height: 1.12; font-weight: 600; color: var(--green-900);
  margin: 0 0 14px; max-width: 14ch;
}
.hero p { font-size: 16.5px; color: var(--ink-600); max-width: 46ch; line-height: 1.6; margin: 0 0 28px; }

.filter-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
}
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-600); }
.field select {
  font-family: 'Inter', sans-serif; font-size: 14.5px; padding: 10px 12px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--sage-100); color: var(--ink-900);
}
.field select:focus { outline: 2px solid var(--green-600); outline-offset: 1px; }
.btn-primary {
  background: var(--green-700); color: white; font-weight: 600; font-size: 14.5px;
  padding: 11px 22px; border-radius: 9px; border: none; cursor: pointer; white-space: nowrap;
}
.btn-primary:hover { background: var(--green-900); }
.btn-primary:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

.section { max-width: 1080px; margin: 0 auto; padding: 8px 24px 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; font-weight: 600; color: var(--green-900); margin: 0; }
.section-head .count { font-size: 13.5px; color: var(--slate-500); }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 40px; }
.subject-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px 14px; display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease; cursor: pointer;
}
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--green-600); }
.subject-tab {
  width: 34px; height: 34px; border-radius: 8px; background: var(--sage-200); color: var(--green-700);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.subject-card h3 { font-size: 14.5px; font-weight: 600; margin: 0; font-family: 'Inter', sans-serif; color: var(--ink-900); }

.paper-list { display: flex; flex-direction: column; gap: 10px; }
.paper-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px 18px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm);
}
.paper-icon {
  width: 40px; height: 40px; border-radius: 9px; background: var(--sage-200); color: var(--green-700);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 17px; font-weight: 700; font-family: 'Fraunces', serif;
}
.paper-info { flex: 1; min-width: 0; }
.paper-info h4 {
  font-size: 15px; font-weight: 600; margin: 0 0 4px; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.paper-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 100px; color: var(--green-700); background: var(--sage-200); }
.tag.year { color: var(--slate-500); background: transparent; padding-left: 0; }
.btn-download {
  background: var(--sage-100); border: 1px solid var(--line); color: var(--green-700);
  font-weight: 600; font-size: 13.5px; padding: 9px 16px; border-radius: 9px;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.btn-download:hover { background: var(--sage-200); }

.empty-state {
  background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius-lg);
  padding: 48px 24px; text-align: center;
}
.empty-state .empty-icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--sage-200); color: var(--green-700);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 22px;
}
.empty-state h3 { font-family: 'Fraunces', serif; font-size: 18px; color: var(--green-900); margin: 0 0 6px; }
.empty-state p { font-size: 14px; color: var(--slate-500); margin: 0 auto; max-width: 36ch; }

.site-footer { border-top: 1px solid var(--line); background: var(--white); margin-top: 24px; }
.site-footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 28px 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--slate-500); flex-wrap: wrap; gap: 10px;
}

@media (max-width: 640px) {
  .site-header-inner { padding: 14px 18px; }
  .header-nav { display: none; }
  .hero { padding: 36px 18px 28px; }
  .section { padding: 8px 18px 36px; }
  .filter-card { flex-direction: column; align-items: stretch; }
  .btn-primary { width: 100%; }
  .paper-card { flex-wrap: wrap; }
  .btn-download { width: 100%; justify-content: center; }
}
