:root {
  color-scheme: dark;
  --background: #212121;
  --surface: #2a2a2a;
  --soft-background: #303030;
  --text: #ededed;
  --text-strong: #ffffff;
  --body-text: #d4d4d4;
  --muted: #a3a3a3;
  --light-muted: #7a7a7a;
  --heading-color: #7a7a7a;
  --border: #363636;
  --border-strong: #4a4a4a;
  --role-line: #363636;
  --accent: #ededed;
  --accent-soft: rgba(255, 255, 255, 0.06);
  --accent-border: rgba(255, 255, 255, 0.16);
  --link-hover: #ffffff;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  --max-width: 960px;
  --font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-name: "Source Serif 4", Georgia, serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --background: #ffffff;
  --surface: #ffffff;
  --soft-background: #f6f7f8;
  --text: #1a1c1f;
  --text-strong: #3b3e43;
  --body-text: #3b3e43;
  --muted: #62666d;
  --light-muted: #8a8e95;
  --heading-color: #1a1c1f;
  --border: #e6e7e9;
  --border-strong: #cdd0d4;
  --role-line: #d8d9db;
  --accent: #2b5a86;
  --accent-soft: #eef3f8;
  --accent-border: #d3e0ec;
  --link-hover: #1b3f61;
  --shadow: 0 6px 20px rgba(20, 24, 30, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.page-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 80px 0 48px;
}

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

.intro {
  padding-top: 0;
  padding-bottom: 24px;
  border-bottom: 0;
}

.intro + .section {
  padding-top: 16px;
}

.intro-top,
.item-header,
.role-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

h1 {
  margin: 0;
  font-family: var(--font-name);
  font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  color: var(--accent);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

.intro-links a {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  transition: background 150ms ease, border-color 150ms ease;
}

.intro-links a:hover {
  background: var(--soft-background);
  border-color: var(--border-strong);
  color: var(--text);
}

.intro-copy {
  max-width: 700px;
  margin-top: 40px;
  color: var(--body-text);
  font-size: 1.04rem;
  line-height: 1.7;
}

.intro-copy p {
  margin: 0 0 12px;
}

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

.intro-copy li {
  margin-bottom: 3px;
  color: var(--text-strong);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.section-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.section-heading h2 {
  margin: 0;
  color: var(--heading-color);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.item-subtitle,
.project-stack,
.location {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.date {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
}


.experience-block,
.education-block {
  max-width: 830px;
}

.role-block {
  position: relative;
  margin-top: 16px;
  padding-left: 20px;
  border-left: 1px solid var(--role-line);
}

.role-block::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.role-title h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.role-title span {
  color: var(--light-muted);
  font-size: 0.83rem;
  white-space: nowrap;
}

.role-desc {
  max-width: 720px;
  margin: 4px 0 0;
  color: var(--text-strong);
}

ul {
  margin: 13px 0 0;
  padding-left: 20px;
}

li {
  margin-bottom: 8px;
  color: var(--body-text);
}

li:last-child {
  margin-bottom: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.project-card:focus-within {
  border-color: var(--accent);
}

.project-media {
  aspect-ratio: 3/ 1;
  overflow: hidden;
  background: var(--soft-background);
  border-radius: 8px;
}

html[data-theme="light"] .project-media {
  background: var(--tint, var(--soft-background));
}

.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 12px 8px 6px;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-title-row h3 {
  font-size: 1rem;
}

.card-link {
  color: var(--text);
}

.card-link:hover {
  color: var(--text);
}

.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 14px;
}

.card-link:focus-visible {
  outline: none;
}

.tag {
  padding: 1px 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
}

.arrow {
  width: 12px;
  height: 12px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--light-muted);
  transition: color 150ms ease;
}

.project-card:hover .arrow {
  color: var(--accent);
}

.project-desc {
  margin: 8px 0 0;
  color: var(--body-text);
  font-size: 0.86rem;
  line-height: 1.5;
}

.project-desc.secondary {
  margin-top: 4px;
  color: var(--muted);
}

.project-body .project-stack {
  margin-top: 8px;
  color: var(--light-muted);
  font-size: 0.78rem;
}

.project-icons {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.project-icons a {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  transition: background 150ms ease, border-color 150ms ease;
}

.project-icons a:hover {
  background: var(--soft-background);
  border-color: var(--border-strong);
  color: var(--text);
}

.project-icons svg {
  width: 14px;
  height: 14px;
}

.project-card-wide {
  grid-column: 1 / -1;
  padding: 8px;
}

.project-card-wide:hover {
  border-color: var(--border);
  box-shadow: none;
}

.project-card-wide .project-body {
  padding: 12px 12px 12px;
}

.project-card-wide .project-stack {
  margin-top: 3px;
}

.project-card-wide li a {
  font-weight: 500;
}

.profiles-section {
  border-bottom: 0;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 150ms ease, border-color 150ms ease;
}

.profile-links a:hover {
  background: var(--soft-background);
  border-color: var(--border-strong);
  color: var(--text);
}

footer {
  padding-top: 20px;
  color: var(--light-muted);
  font-size: 0.8rem;
}

.theme-toggle {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

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

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

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

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

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

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .page-shell {
    width: min(calc(100% - 28px), var(--max-width));
    padding-top: 40px;
  }

  .section {
    padding: 34px 0;
  }

  .intro {
    padding-bottom: 16px;
  }

  .intro + .section {
    padding-top: 16px;
  }

  .intro-top,
  .item-header,
  .role-title {
    flex-direction: column;
    gap: 8px;
  }

  .intro-links {
    padding-top: 0;
  }

  .intro-copy {
    margin-top: 24px;
    font-size: 1rem;
  }

  .date,
  .role-title span {
    white-space: normal;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-card-wide {
    grid-column: auto;
  }

  .project-title-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .tag {
    white-space: normal;
  }

  .project-body {
    padding: 12px 6px 6px;
  }

  .project-icons a {
    width: 32px;
    height: 32px;
  }

  .role-block {
    padding-left: 15px;
  }

  .profile-links a {
    flex: 1 1 calc(50% - 10px);
    justify-content: center;
  }

  .theme-toggle {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 420px) {
  .project-media {
    aspect-ratio: 2 / 1;
  }

  .section-heading {
    margin-bottom: 22px;
  }
}

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

  * {
    transition: none !important;
  }
}