/* ---------- Colours (light + automatic dark mode) ---------- */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1d1f1e;
  --muted: #5d625f;
  --line: #e2ded5;
  --accent: #1f6f5c;
  --accent-soft: #e3f0ec;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131615;
    --surface: #1b1f1e;
    --text: #ecefed;
    --muted: #9aa39f;
    --line: #2a302e;
    --accent: #5cc4a6;
    --accent-soft: #1f302b;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */
.hero { padding: 96px 0 56px; }

.kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
}

.lead {
  max-width: 34em;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.15rem;
}

.quicklinks { display: flex; flex-wrap: wrap; gap: 10px; }

.quicklinks a {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: border-color .15s, color .15s;
}
.quicklinks a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Sections ---------- */
section { padding: 40px 0; border-top: 1px solid var(--line); }

section h2 { margin: 0 0 24px; font-size: 1.7rem; }

/* ---------- Project cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }

.card h3 { margin: 6px 0 8px; font-size: 1.25rem; }
.card p { margin: 0 0 16px; color: var(--muted); font-size: 0.97rem; }

.tag {
  align-self: flex-start;
  margin: 0 !important;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent) !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.more { margin-top: auto; font-weight: 600; text-decoration: none; font-size: 0.95rem; }
.more:hover { text-decoration: underline; }

/* ---------- Links list ---------- */
.links { list-style: none; margin: 0; padding: 0; }

.links li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.links li:last-child { border-bottom: 0; }
.links a { font-weight: 600; text-decoration: none; }
.links a:hover { text-decoration: underline; }
.links span { color: var(--muted); font-size: 0.93rem; text-align: right; }

/* ---------- Footer ---------- */
.foot {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- 404 page ---------- */
.notfound { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.notfound h1 { font-size: clamp(3rem, 10vw, 6rem); margin: 0 0 12px; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .hero { padding: 64px 0 40px; }
  .links li { flex-direction: column; gap: 2px; }
  .links span { text-align: left; }
}
