:root {
  color-scheme: dark;
  --bg: oklch(0.16 0.012 75);
  --bg-elev: oklch(0.2 0.012 75);
  --ink: oklch(0.95 0.015 90);
  --muted: oklch(0.74 0.02 80);
  --line: oklch(0.95 0.015 90 / 0.12);
  --accent: oklch(0.8 0.07 78);
  --accent-ink: oklch(0.2 0.03 75);
  --shadow: oklch(0.1 0.02 75 / 0.35);
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-ui: "Schibsted Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --space: clamp(1.25rem, 4vw, 2.5rem);
  --max: 46rem;
  --radius: 1.15rem;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.97 0.01 90);
  --bg-elev: oklch(0.995 0.006 90);
  --ink: oklch(0.22 0.02 75);
  --muted: oklch(0.42 0.02 70);
  --line: oklch(0.22 0.02 75 / 0.12);
  --accent: oklch(0.45 0.08 55);
  --accent-ink: oklch(0.98 0.01 90);
  --shadow: oklch(0.3 0.03 75 / 0.08);
}

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

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 8% -10%, oklch(0.8 0.07 78 / 0.08), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, oklch(0.4 0.03 70 / 0.18), transparent 50%),
    var(--bg);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > *:not(#wpadminbar) {
  position: relative;
  z-index: 1;
}

#wpadminbar {
  z-index: 99999;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

img {
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 0.4rem;
}

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

.top,
.hero,
.projects,
.foot {
  width: min(var(--max), calc(100% - var(--space) * 2));
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.35rem 0.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.45rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.top-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.theme-toggle {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:focus-visible,
.copy:focus-visible,
.mail-address:focus-visible,
.project-list a:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle-icon {
  display: block;
  width: 1rem;
  height: 1rem;
  margin: 0 auto;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 3v1.5M12 19.5V21M4.9 4.9l1.1 1.1M18 18l1.1 1.1M3 12h1.5M19.5 12H21M4.9 19.1 6 18M18 6l1.1-1.1'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

[data-theme="light"] .theme-toggle-icon {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 14.3A8.5 8.5 0 1 1 9.7 3 7 7 0 0 0 21 14.3z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.hero {
  padding-top: clamp(3.5rem, 12vw, 7rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  font-weight: 500;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.lead {
  max-width: 34rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.22rem);
}

.mail {
  margin-top: 2.4rem;
  padding: 1.25rem 1.3rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: 0 18px 50px var(--shadow);
}

.mail-label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.mail-address {
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.mail-address:hover {
  color: var(--accent);
}

.copy {
  min-height: 2.6rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

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

.copy.is-copied {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.4rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.project-list a {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto 1.1rem;
  gap: 0.9rem 1rem;
  align-items: baseline;
  padding: 1.15rem 0.7rem;
  margin-inline: -0.7rem;
  border-radius: 0.55rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.project-list a:hover {
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}

.project-index {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.project-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.project-name {
  font-weight: 600;
  letter-spacing: -0.03em;
}

.project-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.project-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-list a::after {
  content: "↗";
  grid-column: 4;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.project-list a:hover::after,
.project-list a:focus-visible::after {
  opacity: 1;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  padding-block: 3rem 2.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.foot p {
  margin: 0;
}

@media (max-width: 640px) {
  .top-note {
    display: none;
  }

  .project-list a {
    grid-template-columns: 2rem 1fr;
  }

  .project-list a .project-meta,
  .project-list a::after {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
    padding-right: 0;
  }

  .project-list a::after {
    display: none;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

  .theme-toggle,
  .copy,
  body::before {
    display: none;
  }

  .project-list a {
    color: black;
  }

  .project-list a::after {
    content: none;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #444;
  }
}
