:root {
  --ink: #17332f;
  --ink-soft: #526863;
  --forest: #102e2b;
  --forest-light: #194640;
  --paper: #f3f2e9;
  --paper-deep: #e7e8dc;
  --card: #fcfcf8;
  --line: #d9ddd0;
  --lime: #c9e35d;
  --lime-dark: #789424;
  --orange: #f2a65a;
  --shadow: 0 20px 55px rgba(25, 54, 49, 0.11);
  --shell: 1140px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--lime);
  color: var(--forest);
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 10px;
  background: white;
  padding: 10px 15px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: none;
}

/* Masthead */

.site-header {
  position: relative;
  overflow: hidden;
  min-height: 590px;
  background:
    radial-gradient(circle at 80% 15%, rgba(59, 135, 121, 0.29), transparent 32%),
    linear-gradient(135deg, #0a2422 0%, var(--forest) 58%, #17443e 100%);
  color: white;
}

.site-header::before {
  position: absolute;
  right: -145px;
  bottom: -260px;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 80px rgba(255, 255, 255, 0.022),
    0 0 0 160px rgba(255, 255, 255, 0.016);
  content: "";
}

.grid-lines {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(118deg, transparent 0 72%, rgba(255, 255, 255, 0.07) 72% 72.1%, transparent 72.1%),
    linear-gradient(28deg, transparent 0 82%, rgba(255, 255, 255, 0.045) 82% 82.1%, transparent 82.1%);
  background-size: 420px 420px, 520px 520px;
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.21);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--lime);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: -0.015em;
}

.brand-copy small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.house-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  padding: 9px 14px 9px 17px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: 0.2s ease;
}

.house-link:hover,
.house-link:focus-visible {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.11);
  color: white;
  transform: translateY(-1px);
}

.house-link svg {
  width: 17px;
  fill: none;
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.7fr);
  gap: 80px;
  align-items: end;
  padding: 95px 0 105px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(201, 227, 93, 0.12);
}

.hero h1 {
  margin: 21px 0 22px;
  font-size: clamp(58px, 7vw, 91px);
  font-weight: 850;
  letter-spacing: -0.072em;
  line-height: 0.91;
}

.hero h1 em {
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78em;
  font-weight: 400;
  letter-spacing: -0.055em;
}

.hero-intro {
  max-width: 610px;
  margin: 0;
  color: rgba(255, 255, 255, 0.67);
  font-size: 18px;
  line-height: 1.7;
}

.shelf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.shelf-stats div {
  display: grid;
  min-height: 112px;
  align-content: center;
  justify-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.shelf-stats div:last-child {
  border-right: 0;
}

.shelf-stats span {
  color: white;
  font-size: 26px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.shelf-stats small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.43);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Catalog */

.catalog {
  padding-top: 86px;
  padding-bottom: 112px;
}

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.section-label {
  color: #718d24;
}

.catalog-heading h2,
.principles-heading h2 {
  margin: 7px 0 0;
  color: var(--forest);
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 850;
  letter-spacing: -0.06em;
  line-height: 1;
}

.search-box {
  display: grid;
  grid-template-columns: 20px minmax(130px, 260px) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.7);
  padding: 0 13px;
  transition: 0.2s ease;
}

.search-box:focus-within {
  border-color: #89a533;
  background: white;
  box-shadow: 0 0 0 4px rgba(120, 148, 36, 0.1);
}

.search-box svg {
  width: 19px;
  fill: none;
  stroke: #82938f;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
}

.search-box input::placeholder {
  color: #8a9995;
}

.search-box kbd {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #d6dbd0;
  border-radius: 7px;
  background: #f3f4ed;
  color: #87938e;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
}

.catalog-toolbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 25px;
  border-top: 1px solid var(--line);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: #e5e8dd;
  padding: 7px 12px;
  color: #687a75;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
  background: var(--forest);
  color: var(--lime);
}

.result-count {
  flex: 0 0 auto;
  margin: 0;
  color: #81908c;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.document-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 51, 47, 0.09);
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 9px 28px rgba(25, 54, 49, 0.07);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.document-card:not(.document-card-loading):hover {
  border-color: rgba(120, 148, 36, 0.34);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.card-link {
  display: grid;
  grid-template-columns: minmax(210px, 0.83fr) minmax(0, 1.17fr);
  min-height: 330px;
  color: inherit;
  text-decoration: none;
}

.card-preview {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 20%, rgba(201, 227, 93, 0.35), transparent 28%),
    linear-gradient(145deg, #183f3a, #0c2927);
}

.card-preview::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.1), transparent 42%);
  content: "";
  pointer-events: none;
}

.card-preview img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0.88;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.document-card:hover .card-preview img {
  opacity: 0.96;
  transform: scale(1.03);
}

.preview-type {
  position: absolute;
  bottom: 15px;
  left: 15px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(12, 41, 39, 0.86);
  padding: 7px 10px;
  color: var(--lime);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 27px;
}

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

.card-category {
  color: #718d24;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.card-date {
  color: #92a09c;
  font-size: 8px;
  font-weight: 750;
}

.card-copy h3 {
  margin: 20px 0 11px;
  color: var(--forest);
  font-size: clamp(24px, 2.4vw, 31px);
  font-weight: 850;
  letter-spacing: -0.048em;
  line-height: 1.05;
}

.card-description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.card-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-tags li {
  border-radius: 7px;
  background: #eef0e8;
  padding: 5px 7px;
  color: #6a7d77;
  font-size: 7px;
  font-weight: 850;
}

.card-open {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--forest);
  font-size: 10px;
  font-weight: 900;
}

.card-open b {
  color: #779122;
  font-size: 14px;
}

.document-card-loading {
  display: grid;
  grid-template-columns: 42% 58%;
  min-height: 330px;
}

.document-card-loading .card-preview,
.document-card-loading .card-copy span,
.document-card-loading .card-copy h3,
.document-card-loading .card-copy p {
  background: linear-gradient(90deg, #e7e9e1 25%, #f2f3ed 50%, #e7e9e1 75%);
  background-size: 200% 100%;
  animation: skeleton 1.3s ease infinite;
}

.document-card-loading .card-copy {
  gap: 15px;
}

.document-card-loading .card-copy span {
  width: 80px;
  height: 11px;
  border-radius: 5px;
}

.document-card-loading .card-copy h3 {
  width: 80%;
  height: 32px;
  margin: 8px 0 0;
  border-radius: 7px;
}

.document-card-loading .card-copy p {
  width: 100%;
  height: 11px;
  margin: 0;
  border-radius: 5px;
}

@keyframes skeleton {
  to { background-position: -200% 0; }
}

.empty-state,
.noscript-card {
  grid-column: 1 / -1;
  border: 1px dashed #cbd2c5;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.46);
  padding: 42px;
  text-align: center;
}

.empty-state > span {
  color: #7b9629;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty-state h3 {
  margin: 8px 0 4px;
  color: var(--forest);
  font-size: 24px;
  letter-spacing: -0.03em;
}

.empty-state p,
.noscript-card {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.fallback-link,
.noscript-card a {
  display: inline-block;
  margin-top: 14px;
  color: #617d12;
  font-weight: 850;
}

/* Principles */

.principles {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(60px, 8vw, 110px);
  border-top: 1px solid var(--line);
  padding-top: 94px;
  padding-bottom: 118px;
}

.principles-heading h2 {
  max-width: 440px;
  font-size: clamp(42px, 5vw, 61px);
}

.principle-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--line);
}

.principle-grid article {
  position: relative;
  background: rgba(255, 255, 255, 0.63);
  padding: 24px 26px 25px 76px;
}

.principle-grid article > span {
  position: absolute;
  top: 25px;
  left: 25px;
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 10px;
  background: var(--forest);
  color: var(--lime);
  font-size: 8px;
  font-weight: 900;
}

.principle-grid h3 {
  margin: 0;
  color: var(--forest);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.principle-grid p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0c2523;
  color: white;
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.footer-brand .brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 12px;
}

.footer-inner > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.43);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

/* Error page */

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 20%, rgba(59, 135, 121, 0.28), transparent 30%),
    var(--forest);
  padding: 24px;
  color: white;
}

.error-card {
  width: min(600px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.055);
  padding: clamp(28px, 6vw, 58px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.2);
}

.error-code {
  margin: 65px 0 12px;
  color: var(--lime);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.error-card h1 {
  max-width: 480px;
  margin: 0;
  font-size: clamp(42px, 8vw, 68px);
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.error-card > p:not(.error-code) {
  max-width: 460px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.61);
  font-size: 14px;
}

.error-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  margin-top: 31px;
  border-radius: 13px;
  background: var(--lime);
  padding: 12px 17px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

/* Responsive */

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .shelf-stats {
    width: min(100%, 480px);
  }

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

  .card-link {
    grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1.25fr);
  }

  .principles {
    grid-template-columns: 1fr;
    gap: 38px;
  }
}

@media (max-width: 660px) {
  .shell {
    width: calc(100% - 30px);
  }

  .site-header {
    min-height: 0;
  }

  .topbar {
    min-height: 76px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    font-size: 9px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .house-link {
    width: 41px;
    justify-content: center;
    padding: 0;
  }

  .house-link {
    font-size: 0;
  }

  .hero {
    gap: 45px;
    padding: 70px 0 72px;
  }

  .hero h1 {
    font-size: clamp(47px, 15vw, 68px);
    line-height: 0.93;
  }

  .hero h1 em {
    font-size: 0.72em;
  }

  .hero-intro {
    font-size: 15px;
  }

  .shelf-stats div {
    min-height: 88px;
  }

  .shelf-stats span {
    font-size: 22px;
  }

  .catalog {
    padding-top: 62px;
    padding-bottom: 82px;
  }

  .catalog-heading {
    display: grid;
    align-items: start;
  }

  .catalog-heading h2,
  .principles-heading h2 {
    font-size: 40px;
  }

  .search-box {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    width: 100%;
  }

  .catalog-toolbar {
    align-items: end;
  }

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

  .card-preview,
  .card-preview img {
    min-height: 235px;
    max-height: 235px;
  }

  .card-copy {
    min-height: 290px;
    padding: 23px;
  }

  .card-copy h3 {
    font-size: 28px;
  }

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

  .principles {
    padding-top: 70px;
    padding-bottom: 82px;
  }

  .footer-inner {
    display: grid;
  }

  .footer-inner > p {
    padding-left: 51px;
  }
}

@media (max-width: 390px) {
  .shell {
    width: calc(100% - 24px);
  }

  .brand-copy small {
    font-size: 7px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .catalog-toolbar {
    display: grid;
  }

  .result-count {
    order: -1;
  }

  .card-meta {
    align-items: start;
    flex-direction: column;
  }

  .card-footer {
    align-items: start;
  }

  .principle-grid article {
    padding-right: 20px;
    padding-left: 66px;
  }

  .principle-grid article > span {
    left: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
