:root {
  color-scheme: light dark;
  --background: #f4f1ea;
  --surface: #fbfaf6;
  --foreground: #121212;
  --secondary: #5d5b56;
  --border: #cbc7bd;
  --accent: #ff5c35;
  --accent-ink: #371007;
  --focus: #075bd8;
  --max-width: 1440px;
  --page-padding: clamp(1rem, 4vw, 4rem);
  font-family: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(18, 18, 18, 0.05) calc(100% - 1px)) 0 0 / 25% 100%,
    var(--background);
  color: var(--foreground);
  line-height: 1.6;
}

a { color: inherit; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  background: var(--foreground);
  color: var(--surface);
  transform: translateY(-200%);
}

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

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

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

.wordmark,
.header-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wordmark { font-weight: 700; letter-spacing: -0.06em; }
.header-link { color: var(--secondary); font-size: 0.8125rem; }
.header-link:hover { color: var(--foreground); text-decoration: underline; }

.hero,
.featured,
.catalog {
  padding-inline: var(--page-padding);
  border-bottom: 1px solid var(--border);
}

.hero {
  min-height: min(720px, calc(100dvh - 72px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-block: clamp(3rem, 7vw, 7rem) clamp(2rem, 5vw, 4rem);
}

.eyebrow,
.section-heading > p,
.project-card__meta,
.project-card__footer,
.results-summary,
.site-footer,
.search span {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.6875rem;
}

.eyebrow { margin: 0; color: var(--secondary); }

h1 {
  max-width: 11ch;
  margin: auto 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(4rem, 15vw, 13rem);
  line-height: 0.82;
  letter-spacing: -0.09em;
  font-weight: 800;
}

h1 span { color: var(--accent); }

.hero__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.6fr);
  gap: 3rem;
  align-items: end;
}

.hero__footer > p {
  max-width: 680px;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0;
}

.stats div { border-top: 1px solid var(--foreground); padding-top: 0.75rem; }
.stats dt { color: var(--secondary); font-size: 0.6875rem; text-transform: uppercase; }
.stats dd { margin: 0.4rem 0 0; font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1; }

.featured,
.catalog { padding-block: clamp(4rem, 8vw, 8rem); }

.section-heading {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
  align-items: baseline;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.section-heading > p { margin: 0; color: var(--secondary); }
.section-heading h2 {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.featured-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

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

.project-card {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background: color-mix(in srgb, var(--surface) 64%, transparent);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background-color 180ms ease-out;
}

.project-card:hover { background: var(--surface); }
.project-card--featured { min-height: 430px; }
.project-card--featured:nth-child(3n + 1) { background: var(--foreground); color: var(--surface); }
.project-card--featured:nth-child(3n + 1) .project-card__meta,
.project-card--featured:nth-child(3n + 1) .project-card__footer { color: #c5c2b9; }

.project-card__meta,
.project-card__footer,
.project-card__links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.project-card__meta,
.project-card__footer { color: var(--secondary); }
.status { color: var(--accent); }

.project-card h3 {
  margin: 3rem 0 1rem;
  overflow-wrap: anywhere;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.project-grid .project-card h3 { font-size: clamp(1.5rem, 2vw, 2.25rem); }
.project-card__body p { max-width: 52ch; margin: 0; color: var(--secondary); font-size: 0.875rem; }
.project-card--featured:nth-child(3n + 1) .project-card__body p { color: #c5c2b9; }
.project-card__footer { margin-top: 3rem; flex-wrap: wrap; }
.project-card__links a { min-height: 44px; display: inline-flex; align-items: center; }
.project-link { color: var(--foreground); font-weight: 700; }
.project-card--featured:nth-child(3n + 1) .project-link { color: var(--surface); }

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
}

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter,
.empty-state button {
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.filter:hover { border-color: var(--foreground); }
.filter.is-active { background: var(--foreground); border-color: var(--foreground); color: var(--surface); }
.filter span { margin-left: 0.5rem; opacity: 0.6; }

.search { display: grid; gap: 0.5rem; }
.search span { color: var(--secondary); }
.search input {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0;
  border: 0;
  border-bottom: 1px solid var(--foreground);
  border-radius: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 1rem;
}

.search input::placeholder { color: var(--secondary); }
.results-summary { margin: 0 0 1rem; color: var(--secondary); }

.empty-state {
  padding: 5rem 1rem;
  text-align: center;
  border: 1px solid var(--border);
}
.empty-state h3 { margin: 0; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 2rem; }
.empty-state p { color: var(--secondary); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem var(--page-padding) 3rem;
  color: var(--secondary);
}

@media (max-width: 900px) {
  .hero__footer,
  .section-heading,
  .catalog-tools { grid-template-columns: 1fr; }
  .featured-grid,
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { gap: 0.75rem; }
}

@media (max-width: 600px) {
  body { background-size: 50% 100%; }
  .site-header { min-height: 64px; }
  .hero { min-height: calc(100dvh - 64px); }
  h1 { font-size: clamp(3.9rem, 23vw, 7rem); }
  .stats { margin-top: 1rem; }
  .featured-grid,
  .project-grid { grid-template-columns: 1fr; }
  .project-card,
  .project-card--featured { min-height: 310px; }
  .site-footer { flex-direction: column; gap: 0; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #141412;
    --surface: #1d1d1a;
    --foreground: #f1eee6;
    --secondary: #aaa69d;
    --border: #45443f;
    --accent: #ff6d47;
    --accent-ink: #3d1108;
    --focus: #80b5ff;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
