:root {
  color-scheme: light dark;
  --background: #f6f3ed;
  --background-elevated: #fffdf8;
  --background-subtle: #ece7dd;
  --border: #d7d0c3;
  --border-strong: #b9ae9e;
  --text: #211f24;
  --text-muted: #625d66;
  --accent: #674b91;
  --accent-strong: #4b2d78;
  --accent-soft: #e7ddf6;
  --focus: #7e57c2;
  --success: #25634a;
  --warning: #7d5111;
  --shadow: 0 22px 55px rgb(43 35 51 / 10%);
  --radius-small: 0.75rem;
  --radius-medium: 1.25rem;
  --radius-large: 2rem;
  --content-width: 76rem;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  margin: 0;
  background:
    radial-gradient(circle at 8% -10%, rgb(114 78 157 / 12%), transparent 28rem),
    var(--background);
  color: var(--text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

:focus-visible {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-200%);
  border-radius: var(--radius-small);
  background: var(--text);
  color: var(--background);
  font-weight: 700;
}

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

.site-header,
.site-footer,
main {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.5rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 0.3rem var(--background);
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-nav a,
.footer-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--accent-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.85fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  min-height: min(47rem, calc(100vh - 5rem));
  padding-block: clamp(4rem, 10vw, 8rem);
}

.hero-copy {
  max-width: 52rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.1;
}

h1 {
  max-width: 13ch;
  margin-bottom: 1.5rem;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.055em;
}

.hero-summary {
  max-width: 43rem;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions {
  margin-top: 2rem;
}

.button,
.card-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button {
  padding: 0.72rem 1.1rem;
  border: 1px solid transparent;
}

.button:hover,
.card-link:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent-strong);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent);
}

.button-secondary {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--background-elevated) 82%, transparent);
}

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: var(--radius-large);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 42%), transparent),
    var(--background-elevated);
  box-shadow: var(--shadow);
}

.hero-panel::after {
  position: absolute;
  right: -4rem;
  bottom: -5rem;
  width: 12rem;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 1.4rem color-mix(in srgb, var(--accent) 5%, transparent),
    0 0 0 3rem color-mix(in srgb, var(--accent) 4%, transparent);
  content: "";
  pointer-events: none;
}

.panel-kicker {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.principles {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  margin: 1rem 0 0;
}

.principles div {
  padding-block: 1.25rem;
  border-top: 1px solid var(--border);
}

.principles dt {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.principles dd {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.catalogue {
  scroll-margin-top: 1.5rem;
  padding-block: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--border);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  letter-spacing: -0.04em;
}

.catalogue-status {
  max-width: 26rem;
  margin: 0 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: right;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-top: 2rem;
}

.search-field {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  gap: 0.75rem;
  padding-inline: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--background-elevated);
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--accent) 14%, transparent);
}

.search-field svg {
  flex: none;
  fill: none;
  stroke: var(--text-muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 78%, transparent);
}

.sort-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.sort-field select {
  min-height: 3.25rem;
  padding: 0.65rem 2.4rem 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--background-elevated);
  color: var(--text);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-block: 1rem 2rem;
}

.filter-button {
  min-height: 2.3rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.filter-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

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

.repository-card {
  display: flex;
  min-height: 25rem;
  flex-direction: column;
  padding: clamp(1.25rem, 2vw, 1.6rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: color-mix(in srgb, var(--background-elevated) 96%, transparent);
  box-shadow: 0 1px 0 rgb(255 255 255 / 45%);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.repository-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 18px 35px rgb(43 35 51 / 8%);
  transform: translateY(-2px);
}

.card-topline {
  display: flex;
  min-height: 1.7rem;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.category-badge,
.featured-badge,
.archived-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.category-badge {
  color: var(--accent-strong);
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.35rem;
}

.featured-badge,
.archived-badge {
  padding: 0.38rem 0.5rem;
}

.featured-badge {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.archived-badge {
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  color: var(--warning);
}

.card-heading {
  margin-top: 2.2rem;
}

.card-heading h3 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  letter-spacing: -0.025em;
}

.repository-description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.75rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.topic-list li {
  padding: 0.24rem 0.5rem;
  border-radius: 0.45rem;
  background: var(--background-subtle);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.repository-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  margin: auto 0 1.25rem;
  padding-top: 1.5rem;
}

.repository-meta div {
  display: grid;
  gap: 0.1rem;
}

.repository-meta dt {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.repository-meta dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.card-actions {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.card-link {
  min-height: 2.3rem;
  padding: 0.45rem 0.72rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.card-link:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.card-link-primary {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.card-link-primary:hover {
  background: var(--accent);
  color: #fff;
}

.empty-state,
.notice {
  padding: 3rem 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-medium);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  font-size: 1.6rem;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
}

.skeleton {
  min-height: 25rem;
  border-color: transparent;
  background:
    linear-gradient(
      105deg,
      transparent 35%,
      rgb(255 255 255 / 40%) 48%,
      transparent 61%
    ),
    var(--background-subtle);
  background-size: 230% 100%;
  animation: shimmer 1.4s linear infinite;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.86rem;
}

.site-footer > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-footer p {
  margin: 0;
}

.footer-mark {
  display: grid;
  width: 2rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
}

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

@keyframes shimmer {
  to {
    background-position-x: -230%;
  }
}

@media (max-width: 62rem) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-panel {
    max-width: 42rem;
  }

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

@media (max-width: 42rem) {
  .site-header {
    min-height: 4.5rem;
  }

  .site-nav a:first-child {
    display: none;
  }

  .hero {
    padding-block: 4rem 5rem;
  }

  h1 {
    font-size: clamp(2.8rem, 15vw, 4.8rem);
  }

  .section-heading,
  .site-footer {
    align-items: start;
    flex-direction: column;
  }

  .catalogue-status {
    text-align: left;
  }

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

  .sort-field {
    justify-content: space-between;
  }

  .sort-field select {
    flex: 1;
    max-width: 13rem;
  }

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

  .repository-card {
    min-height: 23rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #111018;
    --background-elevated: #191720;
    --background-subtle: #24212b;
    --border: #35303e;
    --border-strong: #52495e;
    --text: #f3eef5;
    --text-muted: #b8b0be;
    --accent: #b89ae4;
    --accent-strong: #d2bcf0;
    --accent-soft: #2d253a;
    --focus: #cab0ee;
    --success: #88d5b3;
    --warning: #e2b36a;
    --shadow: 0 22px 55px rgb(0 0 0 / 28%);
  }

  .button-primary,
  .card-link-primary {
    color: #1b1324;
  }

  .button-primary:hover,
  .card-link-primary:hover {
    color: #140f19;
  }

  .repository-card {
    box-shadow: 0 1px 0 rgb(255 255 255 / 3%);
  }

  .skeleton {
    background:
      linear-gradient(
        105deg,
        transparent 35%,
        rgb(255 255 255 / 5%) 48%,
        transparent 61%
      ),
      var(--background-subtle);
    background-size: 230% 100%;
  }
}

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

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