:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --project-line: #edf0f3;
  --soft: #f8fafd;
  --link: #1a73e8;
  --link-visited: #6f42c1;
  --accent: #0b57d0;
  --shadow: rgba(60, 64, 67, 0.12);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111315;
  --ink: #f1f3f4;
  --muted: #b6bdc5;
  --line: #2c333a;
  --project-line: #20262c;
  --soft: #171b20;
  --link: #8ab4f8;
  --link-visited: #c58af9;
  --accent: #a8c7fa;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 160ms ease, color 160ms ease;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  text-decoration-thickness: 2px;
}

.site-header,
main,
footer {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--line);
}

.nameplate {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  line-height: 1.25;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.96rem;
  min-width: 0;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.theme-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
}

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

.theme-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset -5px -3px 0 var(--soft);
}

[data-theme="dark"] .theme-icon {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 199, 250, 0.12);
}

.intro {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
  padding: 58px 0 50px;
}

.portrait-frame {
  width: 250px;
  height: 250px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px var(--shadow);
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  transform: scale(1.22);
  transform-origin: 50% 38%;
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

h1 {
  margin-bottom: 16px;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 24px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.intro-copy p {
  max-width: 650px;
}

.inline-links,
.project-links,
.notes ul {
  padding: 0;
  list-style: none;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 24px 0 0;
}

.inline-links a,
.project-links a {
  font-weight: 600;
}

.section {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.timeline {
  display: grid;
  gap: 20px;
}

.timeline article {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
}

.time {
  color: var(--muted);
  font-size: 0.92rem;
}

.projects {
  display: grid;
  gap: 18px;
}

.projects article {
  padding: 18px 0;
  border-top: 1px solid var(--project-line);
}

.projects article:first-child {
  border-top: 0;
  padding-top: 0;
}

.projects p,
.timeline p,
.education p,
.notes li,
.contact p {
  color: var(--muted);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.notes ul {
  display: grid;
  gap: 10px;
  margin: 0;
}

.notes li {
  position: relative;
  padding-left: 18px;
}

.notes li::before {
  position: absolute;
  left: 0;
  color: var(--accent);
  content: "•";
}

.contact {
  background: linear-gradient(90deg, var(--soft), transparent);
  padding-left: 18px;
  padding-right: 18px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .site-header,
  main,
  footer {
    width: min(100% - 40px, 820px);
  }

  .intro {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 34px;
    padding: 48px 0 44px;
  }

  .portrait-frame {
    width: 210px;
    height: 210px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .site-header,
  main,
  footer {
    width: min(100% - 28px, 620px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-top: 22px;
  }

  .header-actions {
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 14px;
  }

  nav {
    gap: 8px 14px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 34px 0 38px;
  }

  .portrait-frame {
    width: 168px;
    height: 168px;
  }

  .section {
    padding: 30px 0;
  }

  .timeline article {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .projects {
    gap: 10px;
  }

  .projects article {
    padding: 16px 0;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 390px);
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .theme-toggle {
    min-height: 32px;
  }

  .intro {
    gap: 22px;
    padding-top: 30px;
  }

  .portrait-frame {
    width: 150px;
    height: 150px;
  }

  .inline-links {
    gap: 8px 14px;
  }

  .contact {
    padding-left: 14px;
    padding-right: 14px;
  }
}
