:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b675f;
  --border: #e6e2da;
  --accent: #2f6b4f;
  --accent-contrast: #ffffff;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --radius: 10px;
}

/* Dark tokens apply when the system prefers dark (unless the visitor picked light),
   or when the visitor picked dark with the header toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141412;
    --surface: #1c1c19;
    --text: #ecebe6;
    --muted: #a19d93;
    --border: #2e2d29;
    --accent: #7cc4a0;
    --accent-contrast: #10201a;
  }
}

:root[data-theme="dark"] {
  --bg: #141412;
  --surface: #1c1c19;
  --text: #ecebe6;
  --muted: #a19d93;
  --border: #2e2d29;
  --accent: #7cc4a0;
  --accent-contrast: #10201a;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* Fade colours while the theme switches; the class is only set briefly by the toggle,
   so hovers and the first paint stay instant. */
@media (prefers-reduced-motion: no-preference) {
  .theme-transition,
  .theme-transition *,
  .theme-transition *::before,
  .theme-transition *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding-inline: 1.25rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3.5rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-header nav a:hover {
  color: var(--text);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Show the icon of the theme a click switches to. */
[data-theme="dark"] .theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

/* Sections */

main section {
  padding-top: 3.5rem;
  padding-bottom: 1rem;
}

h2 {
  font-size: 1.6rem;
  margin: 0 0 1rem;
}

.hero {
  padding-top: 5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 2.9rem);
  margin: 0 0 1.25rem;
}

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

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.social a:hover {
  border-color: var(--accent);
}

.social svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

/* Projects */

.projects {
  display: grid;
  gap: 1.25rem;
}

.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.project-shot {
  display: block;
  margin-bottom: 1.25rem;
}

.project-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
}

.project-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.project-icon {
  flex-shrink: 0;
  border-radius: 10px;
}

.project h3 {
  font-size: 1.35rem;
  margin: 0;
}

.project h3 a {
  color: var(--text);
  text-decoration: none;
}

.project h3 a:hover {
  color: var(--accent);
}

.project-kind {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
  font-size: 0.8rem;
}

.project-links {
  margin: 0;
}

/* Contact */

.button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.08);
}

.muted {
  color: var(--muted);
  margin-top: 2rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form .button {
  justify-self: start;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.form-status {
  margin: 0;
  color: var(--muted);
  min-height: 1.65em;
}

/* Footer */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
  margin-left: 1rem;
}

.site-footer a:first-child {
  margin-left: 0;
}

.site-footer a:hover {
  color: var(--text);
}

@media (max-width: 480px) {
  .site-header nav {
    gap: 0.9rem;
  }

  .hero {
    padding-top: 3rem;
  }
}
