:root {
  color-scheme: light;
  --bg: #f8f6fb;
  --surface: #fff;
  --soft: #efeaf5;
  --glass: rgb(255 255 255 / 84%);
  --text: #222;
  --muted: #514a59;
  --accent: #55458d;
  --focus: #5836a0;
  --line: #ded8e5;
  --art-ink: #413064;
  --shadow: 0 .25rem .75rem rgb(44 30 65 / 5%), 0 .85rem 2.5rem rgb(44 30 65 / 7%);
  --gradient: linear-gradient(120deg, #a770ef, #cf8bf3 50%, #fdb99b);
  --highlight-start: #e6c6fb;
  --highlight-end: #ffcdb7;
  --hero-glow-start: #ebdcfa;
  --hero-glow-end: #f9e3dd;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --container: 72rem;
  --radius-card: 1.5rem;
  --control-size: 2.75rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a192f;
  --surface: #10243f;
  --soft: #0e213e;
  --glass: rgb(16 36 63 / 86%);
  --text: #f2f1f8;
  --muted: #cbc9d9;
  --accent: #becbff;
  --focus: #f9d1ff;
  --line: #415171;
  --shadow: 0 .25rem .75rem rgb(0 0 0 / 14%), 0 .85rem 2.5rem rgb(0 0 0 / 18%);
  --gradient: linear-gradient(120deg, #cca8e9, #cadefc 50%, #defcf9);
  --highlight-start: #3b365f;
  --highlight-end: #344a67;
  --hero-glow-start: #292d50;
  --hero-glow-end: #172e4d;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.65 var(--sans);
  overflow-wrap: anywhere;
  --highlight: linear-gradient(110deg, var(--highlight-start), var(--highlight-end));
}

h1, h2, h3, p, figure, ul, ol { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: .14em; }
img { display: block; max-width: 100%; height: auto; }
:is(header, main, section, article)[id] { scroll-margin-block: 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 1;
  inset: .75rem auto auto .75rem;
  padding: .6rem 1rem;
  border-radius: .35rem;
  background: var(--surface);
}

.container { width: min(var(--container), calc(100% - 3rem)); margin-inline: auto; }
.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 1.5rem;
}

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: clamp(.7rem, 2.5vw, 1.5rem);
  min-height: 5rem;
  padding-block: .6rem;
}
.header-inner > .wordmark { justify-self: start; }
.wordmark, .site-nav a, .quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-size);
  color: var(--text);
}
.wordmark {
  gap: .65rem;
  font: 1.3rem var(--serif);
  text-decoration: none;
}
.wordmark span { color: var(--accent); font: 600 .9rem var(--sans); }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
  padding: 0;
  list-style: none;
}
.site-nav a, .quiet-link {
  padding-inline: clamp(.55rem, 1.45vw, 1rem);
  border-radius: .6rem;
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover, .quiet-link:hover { background: var(--soft); }
.site-header .nav-contact { color: var(--accent); }

.header-controls { display: flex; align-items: center; gap: .55rem; }
.header-divider { color: var(--muted); }
.theme-toggle[hidden] + .header-divider { display: none; }
.language-dropdown { position: relative; }
.language-dropdown > summary {
  gap: .55rem;
  list-style: none;
  cursor: pointer;
}
.language-dropdown > summary::-webkit-details-marker { display: none; }
.language-dropdown > summary::after {
  content: '';
  inline-size: .45rem;
  block-size: .45rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-.1rem) rotate(45deg);
}
.language-dropdown[open] > summary::after {
  transform: translateY(.1rem) rotate(225deg);
}
.language-options {
  position: absolute;
  z-index: 1;
  inset-block-start: calc(100% + .35rem);
  inset-inline-end: 0;
  min-inline-size: 100%;
  display: grid;
  gap: .15rem;
  padding: .3rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.language-options a { display: flex; justify-content: space-between; gap: .65rem; }
.language-options [aria-current="page"] { color: var(--accent); }
.language-options [aria-current="page"]::after {
  content: '';
  inline-size: .38rem;
  block-size: .65rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  inline-size: var(--control-size);
  block-size: var(--control-size);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--soft); }
.theme-icon { position: relative; display: block; inline-size: 1.45rem; block-size: 1.45rem; }
.theme-sun, .theme-moon {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: transform .32s ease, opacity .28s ease;
}
.theme-sun {
  inline-size: .73rem;
  block-size: .73rem;
  border-radius: 50%;
  background: currentColor;
}
.theme-sun::before {
  content: '';
  position: absolute;
  inset: -.32rem;
  border-radius: 50%;
  background: repeating-conic-gradient(from -6deg, currentColor 0deg 12deg, transparent 12deg 45deg);
  mask-image: radial-gradient(circle, transparent 0 53%, #000 55%);
}
.theme-moon {
  inline-size: 1.2rem;
  block-size: 1.2rem;
  border-radius: 50%;
  box-shadow: inset -.39rem -.28rem 0 currentColor;
  opacity: 0;
  transform: rotate(-24deg) scale(.86);
}
.theme-toggle[aria-pressed="true"] .theme-sun { opacity: 0; transform: rotate(24deg) scale(.86); }
.theme-toggle[aria-pressed="true"] .theme-moon { opacity: 1; transform: rotate(0) scale(1); }

.hero {
  border-bottom: 1px solid var(--line);
  background-image:
    radial-gradient(ellipse at 86% 22%, var(--hero-glow-start), transparent 42%),
    radial-gradient(ellipse at 76% 88%, var(--hero-glow-end), transparent 38%);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding-block: clamp(3.75rem, 8vw, 7.25rem);
}
.eyebrow {
  color: var(--accent);
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: .075em;
  line-height: 1.45;
  text-transform: uppercase;
}
.hero-label { margin-bottom: 1rem; }
h1 { font-size: clamp(2.6rem, 5.1vw, 4.65rem); letter-spacing: -.055em; }
h1 em {
  background: var(--highlight) no-repeat left 94% / 100% .22em;
  font-weight: 400;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.hero-lead { max-width: 42ch; margin-top: 1.5rem; font-size: clamp(1.13rem, 2vw, 1.38rem); line-height: 1.5; }
.hero-note { max-width: 47ch; margin-top: .9rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.6rem; }
.actions > a { display: inline-flex; align-items: center; min-height: 2.85rem; }
.button {
  justify-content: center;
  padding: .55rem 1.2rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--text);
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.button:hover { box-shadow: 0 0 0 1px currentColor; }
.button-primary { background: var(--highlight); box-shadow: var(--shadow); }
.button-secondary { border-color: var(--line); background: var(--surface); }

.portrait { width: min(100%, 22rem); margin-inline: auto; }
.portrait-frame {
  position: relative;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--glass);
  box-shadow: var(--shadow);
  transition: box-shadow .28s ease;
  backdrop-filter: blur(1rem);
}
.portrait-frame img { width: 100%; aspect-ratio: 4 / 4.65; object-fit: cover; border-radius: 1.08rem; }
.portrait figcaption { margin-top: 1.15rem; color: var(--muted); font-size: .9rem; text-align: center; }

.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section-heading { max-width: 56ch; }
.section-heading > * + * { margin-top: .75rem; }
.section-heading h2 { font-size: clamp(2.45rem, 5vw, 4rem); letter-spacing: -.045em; }
.section-heading > p:not(.eyebrow) { color: var(--muted); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 1.25rem;
  margin-top: 2.25rem;
}
.project {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.project-art {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  aspect-ratio: 2.5;
  overflow: hidden;
  border-start-start-radius: calc(var(--radius-card) - 1px);
  border-start-end-radius: calc(var(--radius-card) - 1px);
  background: var(--highlight);
  color: var(--art-ink);
}
.project-art span { position: absolute; display: block; }
.project-art--picture-in-picture { background: var(--gradient); }
.project-art--picture-in-picture span:first-child { width: 41%; aspect-ratio: 1.75; border: 2px solid currentColor; border-radius: .5rem; background: #fefdfd; }
.project-art--picture-in-picture span:nth-child(2) { width: 19%; aspect-ratio: 1.65; left: 55%; top: 50%; border: 2px solid currentColor; border-radius: .3rem; background: #e8c8f7; }
.project-art--picture-in-picture span:last-child { width: 0; height: 0; top: 43%; left: 44%; border: .48rem solid transparent; border-left: .72rem solid currentColor; }
.project-art--design-system { background: #e3dcf9; }
.project-art--design-system span { width: 22%; max-width: 4.7rem; aspect-ratio: 1; border-radius: .7rem; border: 2px solid currentColor; }
.project-art--design-system span:first-child { transform: translateX(-82%) rotate(-12deg); background: #fefdfd; }
.project-art--design-system span:nth-child(2) { transform: translateX(83%) rotate(12deg); background: #f9c5ae; }
.project-art--design-system span:last-child { background: #cbadee; }
.project-art--player-settings { background: #f8e5df; }
.project-art--player-settings span { width: 39%; height: 13%; border: 2px solid currentColor; border-radius: .9rem; background: #fefdfd; }
.project-art--player-settings span:first-child { top: 25%; }
.project-art--player-settings span:last-child { bottom: 25%; }
.project-art--player-settings span::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 25%;
  width: .9rem;
  height: .9rem;
  transform: translate(-50%, -50%);
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #dbb2f3;
}
.project-art--player-settings span:nth-child(2)::before { left: 70%; }
.project-art--player-settings span:last-child::before { left: 45%; }

.project-body { padding: clamp(1.15rem, 2.1vw, 1.7rem); }
.project h3, .feature h3 { margin-top: .55rem; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.025em; }
.project-body > p:not(.eyebrow), .feature-copy > p:not(.eyebrow) { margin-top: .85rem; color: var(--muted); }
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 0;
  margin-top: 1.15rem;
  list-style: none;
}
.tags li { border-radius: 1rem; padding: .16rem .6rem; background: var(--soft); color: var(--muted); font-size: .875rem; }
.project details { margin-top: .9rem; border-top: 1px solid var(--line); }
.project summary { padding: .75rem 0 .45rem; min-height: 2.75rem; color: var(--accent); font-weight: 650; cursor: pointer; }
.project summary:hover { background: var(--soft); }
.project details p { margin-top: .65rem; color: var(--muted); }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.4rem, 4vw, 3.5rem);
  margin-top: 2.5rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--soft);
}
.feature-visual { border-radius: 1rem; background: var(--highlight); }
.feature-copy .button { display: inline-flex; align-items: center; min-height: var(--control-size); margin-top: .8rem; }
.career { background: var(--soft); border-block: 1px solid var(--line); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(1.75rem, 7vw, 6rem); }
.section-heading .skills { margin-top: 1.5rem; }
.skills strong { color: var(--text); }
.timeline { padding: 0; list-style: none; }
.timeline-entry {
  display: grid;
  grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr);
  gap: .5rem 1rem;
  padding-block: 1.3rem;
  border-top: 1px solid var(--line);
}
.timeline-period { font-size: .94rem; }
.timeline-entry h3 { font-size: 1.55rem; }
.timeline-entry .timeline-role { margin: .25rem 0 .35rem; color: var(--text); font-weight: 650; }
.timeline-entry p, .about-copy p { color: var(--muted); }
.timeline-entry .timeline-period { color: var(--accent); }
.about-copy > p + p { margin-top: .9rem; }
.contact { background: var(--highlight); }
.contact .eyebrow, .contact .actions > a { color: var(--text); }
.contact-copy p { font-size: 1.13rem; }
.contact .actions { margin-top: 1rem; }
.contact .button-primary { background: var(--surface); }
.contact .quiet-link:hover { background: var(--surface); }
.site-footer { padding-block: .65rem; border-top: 1px solid var(--line); }

@media (max-width: 53rem) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline-entry { grid-template-columns: 1fr; }
}

@media (max-width: 50rem) {
  .container { width: calc(100% - 2rem); }
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .75rem; }
  .header-inner > .wordmark { grid-column: 1 / -1; }
  .header-controls { margin-top: .13rem; }
  .hero-inner, .feature, .split { grid-template-columns: 1fr; }
  .portrait { width: min(88%, 17.5rem); margin-inline: 0 auto; }
  .portrait-frame img { aspect-ratio: 1; object-position: center 32%; }
  .portrait figcaption { text-align: left; }
  .project-grid { grid-template-columns: 1fr; }
  .project-art { aspect-ratio: 3; }
}

@media (max-width: 39rem) {
  .header-inner { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .header-controls { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-sun, .theme-moon, .portrait-frame { transition: none; }
}

@media (forced-colors: active) {
  .button-primary, .portrait-frame { box-shadow: none; }
  .project-art { display: none; }
  :is(.site-nav a, .quiet-link, summary):hover:not(:focus-visible) {
    outline: 1px solid LinkText;
    outline-offset: -2px;
  }
  .theme-sun, .theme-moon { forced-color-adjust: none; color: ButtonText; }
}
