:root {
  --ink: #17211d;
  --muted: #5e6b65;
  --paper: #f6f7f3;
  --surface: #ffffff;
  --line: #dce2dc;
  --accent: #326c52;
  --accent-dark: #214f3b;
  --accent-soft: #dbe9e0;
  --max-width: 72rem;
  --radius: 1rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

main { flex: 1; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.6rem, 8vw, 5.8rem); }
h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
h3 { font-size: 1.35rem; }

.container { width: min(calc(100% - 2rem), var(--max-width)); margin-inline: auto; }
.narrow { max-width: 48rem; margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; top: 0; padding: .75rem 1rem; background: var(--ink); color: #fff; z-index: 20; }
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header { border-bottom: 1px solid var(--line); background: rgba(246, 247, 243, .95); }
.header-inner { min-height: 4.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .65rem; background: var(--ink); color: white; font-size: .75rem; letter-spacing: .06em; }
.nav-list { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1.3rem; list-style: none; padding: 0; margin: 0; }
.nav-list a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav-list a:hover, .nav-list a:focus-visible { color: var(--accent); }

.hero { padding: clamp(5rem, 12vw, 9rem) 0; background: radial-gradient(circle at 85% 15%, var(--accent-soft), transparent 31%); }
.hero__content { max-width: var(--max-width); }
.hero h1 { max-width: 14ch; margin-bottom: 1.75rem; }
.hero h1 span { color: var(--accent); }
.hero__lead { max-width: 38rem; color: var(--muted); font-size: clamp(1.15rem, 2.4vw, 1.4rem); margin-bottom: 2rem; }
.eyebrow { margin-bottom: .8rem; color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.button { display: inline-block; border: 0; border-radius: 999px; padding: .8rem 1.3rem; background: var(--accent); color: white; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover, .button:focus-visible { background: var(--accent-dark); }
.text-link, .back-link { color: var(--accent-dark); font-weight: 700; text-underline-offset: .2em; }
.back-link { display: inline-block; margin-bottom: 2rem; }

.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; }
.section-heading h2 { margin-bottom: 0; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.project-card { display: flex; flex-direction: column; min-height: 20rem; padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 35px rgba(23, 33, 29, .04); }
.project-card__meta { margin-bottom: auto; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.project-card h3 { margin: 2.5rem 0 .75rem; }
.project-card h3 a { text-decoration: none; }
.project-card h3 a::after { content: ""; position: absolute; inset: 0; }
.project-card { position: relative; }
.project-card p { color: var(--muted); }
.project-card__actions { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; }
.empty-state { max-width: 42rem; padding: clamp(2rem, 6vw, 4rem); border: 1px dashed #b8c5bc; border-radius: var(--radius); background: rgba(255,255,255,.5); text-align: center; margin-inline: auto; }
.empty-state__symbol { color: var(--accent); font-size: 2.6rem; line-height: 1; }

.page-header { padding: clamp(4rem, 9vw, 7rem) 0 3rem; background: linear-gradient(180deg, var(--accent-soft), transparent); }
.page-header h1 { margin-bottom: 1rem; }
.page-header p:not(.eyebrow) { color: var(--muted); font-size: 1.2rem; }
.project-detail .page-header h1 { font-size: clamp(2.8rem, 8vw, 5rem); }
.prose { padding-block: 3rem 7rem; font-size: 1.12rem; }
.prose p { margin-bottom: 1.4rem; }

.auth-page, .error-page { padding-block: clamp(4rem, 10vw, 8rem); }
.auth-page h1, .error-page h1 { font-size: clamp(2.5rem, 7vw, 4rem); }
.auth-form { margin: 2rem 0 1rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; margin-bottom: .35rem; font-weight: 700; }
.form-field input { width: 100%; padding: .75rem; border: 1px solid #aab7ae; border-radius: .5rem; font: inherit; }
.form-field input:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.checkbox-field { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.errorlist { color: #972e2e; }
.error-code { margin-bottom: 0; color: var(--accent); font-size: 1.2rem; font-weight: 800; letter-spacing: .15em; }
.messages { margin-top: 1rem; }
.message { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .6rem; background: white; }

.site-footer { padding: 2.5rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; }
.footer-inner p { margin: 0; }

@media (max-width: 48rem) {
  .header-inner { align-items: flex-start; flex-direction: column; padding-block: 1rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 16rem; }
  .section-heading, .footer-inner { align-items: flex-start; flex-direction: column; }
}

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