/* Colors come from the logo artwork: green #126f43, sky #75dfee and #8cf2ff.
   Every themed color is a light-dark() pair. It follows the system setting
   unless data-theme on <html> forces one side through color-scheme. */
:root {
  color-scheme: light dark;

  --brand-green: #126f43;
  --brand-sky: #75dfee;
  --brand-sky-bright: #8cf2ff;
  --ink-on-sky: #0a2a1c;

  --bg: light-dark(#f6fbf8, #0a1f16);
  --bg-alt: light-dark(#e9f4ee, #0e281c);
  --surface: light-dark(#ffffff, #123124);
  --text: light-dark(#12261c, #e8f5ef);
  --muted: light-dark(#44594e, #a9c3b7);
  --border: light-dark(#c9dfd3, #2a4d3c);
  --accent: light-dark(var(--brand-green), var(--brand-sky));
  --on-accent: light-dark(#ffffff, var(--ink-on-sky));
  --hero-bg: light-dark(var(--brand-green), #0e3b27);
}

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

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h3 { font-size: 1.1rem; }
p { margin: 0; }

a { color: var(--accent); }

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

.wrap {
  max-width: 60rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--text);
}
.skip-link:focus { top: 1rem; }

/* Header and hero share the brand background in both themes, so the logo
   always sits on green as it does in the original artwork. */
.site-header,
.hero {
  background: var(--hero-bg);
  color: #ffffff;
}

.site-header :focus-visible,
.hero :focus-visible { outline-color: var(--brand-sky-bright); }

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
}

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

.site-header nav a {
  color: #ffffff;
  text-decoration: none;
}
.site-header nav a:hover { text-decoration: underline; }

.theme-switch {
  display: inline-flex;
  border: 1px solid rgb(255 255 255 / 0.45);
  border-radius: 0.5rem;
  overflow: hidden;
}
.theme-switch[hidden] { display: none; }

.theme-switch button {
  padding: 0.25rem 0.7rem;
  border: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
.theme-switch button:focus-visible { outline-offset: -3px; }

.theme-switch button[aria-pressed="true"] {
  background: var(--brand-sky);
  color: var(--ink-on-sky);
  font-weight: 600;
}

.hero .wrap { padding-block: 2.5rem 5rem; }

.logo {
  display: block;
  width: min(100%, 24rem);
  height: auto;
  margin-bottom: 2.5rem;
}

.hero h1 {
  max-width: 20em;
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: -0.01em;
}

.lede {
  max-width: 38em;
  margin-block: 1.25rem 2rem;
  font-size: 1.2rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.button:hover { filter: brightness(1.1); }

.button-secondary {
  background: transparent;
  color: var(--accent);
}

.button-on-brand {
  border-color: var(--brand-sky);
  background: var(--brand-sky);
  color: var(--ink-on-sky);
}

.section { padding-block: 4rem; }
.section-alt { background: var(--bg-alt); }

.section-intro {
  max-width: 38em;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--surface);
}
.card h3 { margin-bottom: 0.5rem; font-size: 1.25rem; }

.tech-heading {
  margin-top: 2.5rem;
  font-size: 1.25rem;
}

.tech { margin: 1rem 0 0; }

.tech-group {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.25rem 1.5rem;
  padding-block: 0.75rem;
  border-top: 1px solid var(--border);
}

.tech dt {
  color: var(--muted);
  padding-top: 0.2rem;
}

.tech dd { margin: 0; }

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

.chips li {
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9375rem;
}

.homelab {
  max-width: 38em;
  margin-top: 1.25rem;
}

.career-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.career-intro .section-intro { flex: 1 1 18rem; margin-top: 0; }

.portrait {
  border: 3px solid var(--accent);
  border-radius: 50%;
}

.timeline {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.25rem 1.5rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--border);
}

.timeline-dates {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timeline h3 { margin-bottom: 0.25rem; }
.company { font-weight: 400; }

.earlier {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

noscript p { margin-top: 1rem; }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem;
}

@media (max-width: 34rem) {
  .timeline li,
  .tech-group { grid-template-columns: 1fr; }
}

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