:root {
  color-scheme: light;
  --bg: #f3f7f4;
  --bg-accent: radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 30%), linear-gradient(180deg, #f8fbf9 0%, #eef4f0 100%);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-soft: rgba(234, 243, 238, 0.92);
  --ink: #111816;
  --muted: #5c6b65;
  --line: rgba(17, 24, 22, 0.1);
  --line-strong: rgba(17, 24, 22, 0.18);
  --accent: #0f766e;
  --accent-strong: #0b5e58;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --shadow: 0 20px 48px rgba(17, 24, 22, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --content-width: min(1180px, calc(100% - clamp(24px, 6vw, 112px)));
  --copy-width: 68ch;
  --section-gap: clamp(60px, 8vw, 108px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1210;
  --bg-accent: radial-gradient(circle at top left, rgba(45, 212, 191, 0.16), transparent 34%), linear-gradient(180deg, #0e1613 0%, #0a100f 100%);
  --surface: rgba(20, 29, 26, 0.9);
  --surface-soft: rgba(18, 33, 28, 0.92);
  --ink: #eef5f2;
  --muted: #a4b5ae;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #2dd4bf;
  --accent-strong: #8ae7dd;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --shadow: 0 24px 52px rgba(0, 0, 0, 0.24);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-accent);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
li {
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, white 28%);
  outline-offset: 3px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

.skip-link {
  position: absolute;
  top: -52px;
  left: 16px;
  z-index: 40;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 999px;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

.page-shell {
  width: var(--content-width);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) 0 clamp(56px, 8vw, 104px);
}

.hero {
  padding-top: clamp(4px, 1vw, 10px);
}

.site-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.top-actions,
.hero-actions,
.project-links,
.contact-links {
  display: flex;
  flex-wrap: wrap;
}

.top-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 14px 22px;
}

.top-action,
.theme-toggle,
.quiet-link,
.project-link {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.top-action:hover,
.top-action:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible,
.quiet-link:hover,
.quiet-link:focus-visible,
.project-link:hover,
.project-link:focus-visible {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

.theme-toggle {
  cursor: pointer;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.72fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 14px;
  align-content: start;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.hero-title {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(2.8rem, 5.8vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-subtitle {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 700;
  line-height: 1.16;
}

.hero-summary,
.section-intro p,
.education-entry p,
.project-summary,
.project-meta-line,
.contact-copy {
  color: var(--muted);
  font-size: clamp(1rem, 0.6vw + 0.92rem, 1.08rem);
}

.hero-summary {
  margin: 4px 0 0;
  max-width: 58ch;
}

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

.hero-actions {
  align-items: center;
  gap: 16px 24px;
  margin-top: 10px;
}

.project-links,
.contact-links {
  gap: 10px 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 720;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.button:hover,
.button:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

.portrait-card {
  position: relative;
  justify-self: end;
  width: clamp(260px, 28vw, 340px);
  max-width: 100%;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
}

.site-main {
  display: grid;
  gap: var(--section-gap);
  margin-top: var(--section-gap);
}

.section {
  display: grid;
  gap: 28px;
  padding-top: clamp(24px, 4vw, 42px);
  border-top: 1px solid var(--line);
}

.section-intro {
  display: grid;
  gap: 10px;
  max-width: var(--copy-width);
}

.section-label {
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 740;
  letter-spacing: 0.01em;
}

.section-title {
  margin: 0;
  font-size: clamp(1.9rem, 2.7vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.education-list {
  display: grid;
  gap: 18px;
  max-width: 860px;
}

.education-entry,
.selected-work-entry,
.work-heading,
.work-details {
  display: grid;
  gap: 10px;
}

.education-entry {
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
}

.education-entry h3,
.selected-work-entry h3 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

.education-institution {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
}

.selected-work-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line-strong);
}

.project-summary,
.project-meta-line {
  margin: 0;
}

.selected-work-entry {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  gap: 18px 40px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.work-number {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.work-details {
  align-content: start;
  gap: 12px;
  max-width: 68ch;
}

.section-contact .contact-links {
  padding-top: 10px;
  border-top: 1px solid var(--line-strong);
}

@media (max-width: 980px) {
  .hero-grid,
  .selected-work-entry {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .portrait-card {
    justify-self: start;
    width: min(78vw, 300px);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 100%);
    padding-top: 16px;
  }

  .site-topbar {
    margin-bottom: 24px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .hero-title {
    max-width: none;
    font-size: clamp(2.45rem, 12vw, 3.65rem);
  }

  .hero-actions {
    align-items: flex-start;
  }

}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.section-contact .section-title {
  max-width: 22ch;
  font-size: clamp(1.8rem, 2.4vw, 2.65rem);
}

.section-contact {
  padding-bottom: clamp(48px, 8vw, 96px);
}