:root {
  color-scheme: light;
  --bg: #f7f3ed;
  --text: #1a1814;
  --muted: #5c574f;
  --link: #1a1814;
  --link-underline: rgba(26, 24, 20, 0.35);
  --link-underline-hover: rgba(26, 24, 20, 0.75);
  --border: rgba(26, 24, 20, 0.12);
  --toggle-bg: rgba(26, 24, 20, 0.06);
  --toggle-bg-hover: rgba(26, 24, 20, 0.1);
  --focus: #8b6914;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141210;
  --text: #ece7de;
  --muted: #a39d93;
  --link: #ece7de;
  --link-underline: rgba(236, 231, 222, 0.35);
  --link-underline-hover: rgba(236, 231, 222, 0.8);
  --border: rgba(236, 231, 222, 0.12);
  --toggle-bg: rgba(236, 231, 222, 0.08);
  --toggle-bg-hover: rgba(236, 231, 222, 0.14);
  --focus: #d4a843;
}

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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 400;
  font-optical-sizing: auto;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.page {
  width: min(100%, 38rem);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5rem;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.site-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.55rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
}

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.15rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--toggle-bg-hover);
}

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

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

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

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

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

.profile-photo {
  margin: 0 0 2rem;
}

.profile-photo img {
  display: block;
  width: 260px;
  height: 260px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.intro {
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
  max-width: 34rem;
}

.intro p {
  margin: 0 0 1rem;
}

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

.section-label {
  margin: 0 0 0.85rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.links,
.contact-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links li + li,
.contact-links li + li {
  margin-top: 0.35rem;
}

.site-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.2s ease;
}

a:hover {
  text-decoration-color: var(--link-underline-hover);
}

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

.page-heading {
  margin: 0 0 1rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
}

.error-code {
  margin: 0 0 0.5rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}

@media (max-width: 40rem) {
  .page {
    padding-top: 3.5rem;
  }

  .site-header {
    margin-bottom: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
