:root {
  color-scheme: light;
  --background: #f3f1eb;
  --surface: #fffdf7;
  --text: #262626;
  --title-text: #03b503;
  --muted: #656565;
  --accent: #175f70;
  --border: #c8c5bc;
  --code-background: #e8e5dc;
  --max-width: 76rem;
  --content-width: 72ch;
  font-family: "Go Mono", "Source Code Pro", "DejaVu Sans Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #292827;
  --surface: #343230;
  --text: #f1eee8;
  --title-text: #00ff00;
  --muted: #bbb7af;
  --accent: #65b9cd;
  --border: #5a5651;
  --code-background: #403d39;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

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

a:hover,
a:focus-visible {
  text-decoration-thickness: 0.15em;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  padding: 0.65rem 0.9rem;
  background: var(--text);
  color: var(--background);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 6rem;
}

.site-title {
  color: var(--title-text);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 700;
  text-decoration: none;
}

.site-subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem 1.1rem;
}

#theme-toggle {
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.35rem 0.65rem;
  background: var(--code-background);
  color: var(--text);
  cursor: pointer;
}

main {
  padding-block: 3rem 5rem;
}

section {
  padding-block: 2.2rem;
  border-bottom: 1px solid var(--border);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 18rem);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding-top: 1rem;
}

.hero-copy {
  max-width: var(--content-width);
}

.eyebrow,
.period,
.organisation,
.stack {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 24ch;
  margin-bottom: 1.4rem;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.7rem;
  color: var(--accent);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

h2::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--border);
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  line-height: 1.4;
}

.intro {
  font-size: 1.08rem;
}

.portrait {
  margin: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5rem;
}

.portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.03);
}

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

.contact-list div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.75rem;
}

.contact-list dt {
  color: var(--muted);
}

.contact-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

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

.tag-list li,
.stack {
  border: 1px solid var(--border);
  background: var(--code-background);
  padding: 0.2rem 0.45rem;
  font-size: 0.86rem;
}

.timeline-item {
  max-width: 72rem;
  padding: 1.35rem 0;
}

.timeline-item + .timeline-item {
  border-top: 1px dotted var(--border);
}

.timeline-item > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: start;
}

.organisation,
.period {
  margin-bottom: 0.7rem;
}

.timeline-item ul,
.details ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.compact p:last-child {
  margin-bottom: 0;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 13rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.25rem;
}

.project-card p:last-child {
  margin-top: auto;
  margin-bottom: 0;
}

.stack {
  align-self: flex-start;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding-block: 1.5rem;
  font-size: 0.85rem;
}

.site-footer p {
    text-align: center;
    margin: 0;
}

@media (max-width: 800px) {
  .header-row,
  .hero {
    display: block;
  }

  .header-row {
    padding-block: 1rem;
  }

  .header-actions {
    justify-content: flex-start;
    margin-top: 1rem;
  }

  .portrait {
    width: min(100%, 18rem);
    margin-top: 2rem;
  }

  .columns,
  .project-grid,
  .contact-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 0.94rem;
  }

  .contact-list div,
  .timeline-item > header {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .period {
    order: -1;
    margin-bottom: 0.3rem;
  }

  h2::after {
    display: none;
  }
}

@media print {
  :root,
  :root[data-theme="dark"] {
    --background: #fff;
    --surface: #fff;
    --text: #000;
    --muted: #333;
    --accent: #000;
    --border: #888;
    --code-background: #fff;
  }

  body {
    font-size: 9.5pt;
  }

  .site-header,
  .site-footer,
  .portrait,
  #theme-toggle,
  .skip-link {
    display: none;
  }

  main {
    padding: 0;
  }

  section {
    break-inside: avoid;
    padding-block: 0.8rem;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .project-card {
    min-height: 0;
    break-inside: avoid;
  }
}


