:root {
  --page-width: 1000px;
  --bg: #fbfdff;
  --text: #22303d;
  --accent: #3878b5;
  --accent-hover: #3878b5;
  --accent-hover-soft: rgba(113, 165, 208, 0.24);
  --line: rgba(56, 120, 181, 0.34);
  --shadow: 0 10px 24px rgba(30, 42, 53, 0.07);
  --serif: "Instrument Serif", serif;
  --sans: "DM Sans", sans-serif;
}

[data-theme="dark"] {
  --bg: #243340;
  --text: #eef5fb;
  --accent: #5f9ed4;
  --accent-hover: #69a7da;
  --accent-hover-soft: rgba(105, 167, 218, 0.28);
  --line: rgba(95, 158, 212, 0.4);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in srgb, currentColor 70%, transparent);
  transition: color 0.2s ease, text-decoration-color 0.2s ease, background-size 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

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

.site {
  width: min(100%, var(--page-width));
  margin: 0 auto;
  padding: 56px 52px 96px;
}

.site-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding: 0 0 28px;
  border-bottom: 1.5px solid var(--accent);
}

.site-motif {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: color-mix(in srgb, var(--accent) 72%, var(--text) 28%);
}

.site-motif svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-left: auto;
  justify-content: flex-end;
}

.site-nav a {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 84%, var(--text) 16%);
  text-decoration: none;
}

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

.theme-toggle {
  background: none;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  cursor: pointer;
  padding: 5px;
  color: color-mix(in srgb, var(--accent) 82%, var(--text) 18%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent-hover);
  border-color: color-mix(in srgb, var(--accent-hover) 45%, transparent);
  background: color-mix(in srgb, var(--accent-hover) 7%, transparent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-moon {
  display: none;
}

.icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-areas:
    "portrait name"
    "portrait blurb";
  gap: 40px 84px;
  padding: 120px 0 0;
  align-items: start;
}

.hero-name {
  grid-area: name;
  margin: 0;
  display: flex;
  gap: 20px;
  align-items: baseline;
  font-family: var(--serif);
  font-size: clamp(72px, 8vw, 98px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.name-black {
  color: var(--text);
}

.name-blue {
  color: var(--accent);
  font-style: italic;
}

.hero-portrait {
  grid-area: portrait;
  position: relative;
  align-self: stretch;
  margin: 6px 0 0;
  width: 280px;
  padding: 0;
  box-shadow: var(--shadow);
}

.hero-portrait::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--accent);
  pointer-events: none;
}

.hero-portrait::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid #ffffff;
  pointer-events: none;
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-blurb {
  grid-area: blurb;
  align-self: end;
  padding: 20px 0;
  border-top: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  max-width: 650px;
  font-size: 18px;
  line-height: 1.6;
}

.hero-blurb a {
  display: inline;
  padding: 0 0.08em;
  margin: 0 -0.08em;
  border-radius: 0.08em;
  background-image: linear-gradient(var(--accent-hover-soft), var(--accent-hover-soft));
  background-repeat: no-repeat;
  background-size: 100% 0;
  background-position: 0 92%;
}

.hero-blurb a:hover,
.hero-blurb a:focus-visible {
  color: var(--accent-hover);
  background-size: 100% 1.05em;
  outline: none;
}

.hero-blurb p {
  margin: 0;
}

.hero-blurb p + p {
  margin-top: 28px;
}

@media (max-width: 860px) {
  .site {
    padding: 28px 24px 72px;
  }

  .site-header {
    padding-bottom: 24px;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "portrait"
      "blurb";
    gap: 36px;
    padding-top: 44px;
  }

  .hero-name {
    font-size: clamp(54px, 15vw, 72px);
    justify-content: center;
    margin-bottom: 0;
  }

  .hero-portrait {
    width: min(50vw, 220px);
    margin: 0 auto;
  }

  .hero-portrait img {
    height: auto;
  }

  .hero-blurb {
    max-width: none;
    font-size: 15px;
    padding: 22px 0;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 17px;
    line-height: 1.7;
  }

  .site-nav {
    gap: 18px;
  }

  .site-nav a {
    font-size: 16px;
    letter-spacing: 0.08em;
  }
}
