:root {
  color-scheme: dark;
  --page: #005f6b;
  --panel: #343838;
  --panel-soft: #008c9e;
  --text: #f4f4f2;
  --muted: #c8d5d7;
  --faint: #9bb7bb;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #00b4cc;
  --accent-soft: #00dffc;
  --teal-deep: #005f6b;
  --teal: #008c9e;
  --charcoal: #343838;
  --profile-height: 680px;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

html[data-theme="light"] {
  color-scheme: light;
  --page: #e2f2f3;
  --panel: #fff;
  --panel-soft: #e2f2f3;
  --text: #263233;
  --muted: #4e6062;
  --faint: #52757a;
  --line: rgba(0, 95, 107, 0.18);
  --accent: #007b8a;
  --accent-soft: #008c9e;
}

* {
  box-sizing: border-box;
}

body {
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  padding: 4.5vh 1.25rem;
  background-color: var(--page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  transition: background-color 180ms ease, color 180ms ease;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.02);
  background-image: linear-gradient(
    135deg,
    transparent 40%,
    rgba(0, 223, 252, 0.12) 46%,
    rgba(164, 160, 239, 0.22) 49%,
    rgba(230, 168, 187, 0.22) 51%,
    rgba(135, 221, 192, 0.12) 54%,
    transparent 60%
  );
  background-size: 300% 300%;
  background-repeat: no-repeat;
  mask-image:
    repeating-linear-gradient(32deg, transparent 0 34px, #000 35px 36px, transparent 37px 70px),
    repeating-linear-gradient(148deg, transparent 0 52px, #000 53px 54px, transparent 55px 104px);
  pointer-events: none;
  animation: grid-shimmer 24s linear infinite;
  content: "";
}

@keyframes grid-shimmer {
  from {
    background-position: 100% 100%;
  }

  to {
    background-position: 0% 0%;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.8rem;
  transform: translateY(-160%);
  background: var(--accent);
  color: #fff;
}

.skip-link:focus {
  transform: translateY(0);
}

.portfolio {
  display: grid;
  grid-template-columns: 64px minmax(210px, 260px) minmax(0, 570px);
  align-items: stretch;
  width: min(100%, 1000px);
  min-height: 84vh;
  margin-inline: auto;
  overflow: clip;
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.3);
}

.icon-rail {
  position: sticky;
  top: 4.5vh;
  display: flex;
  height: var(--profile-height);
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0 1rem;
  background: var(--panel);
}

.rail-brand {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.09em;
}

.rail-brand span {
  color: var(--text);
}

.rail-links {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}

.rail-link {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--faint);
  font-size: 1.15rem;
  transition: color 150ms ease, transform 150ms ease;
}

.rail-link:hover,
.rail-link.is-current {
  color: var(--accent);
}

.rail-link:hover {
  transform: translateY(-2px);
}

.theme-toggle {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.1rem;
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  font-size: 1.1rem;
}

.theme-toggle > span:first-child {
  color: var(--accent);
}

.theme-toggle-label {
  font-size: 0;
}

.profile-card {
  position: sticky;
  top: 4.5vh;
  height: var(--profile-height);
  overflow: hidden;
  background: var(--charcoal);
}

.profile-photo,
.profile-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.profile-photo {
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(0.82) brightness(0.77);
}

.profile-shade {
  background: linear-gradient(180deg, transparent 35%, rgba(8, 8, 9, 0.2) 52%, rgba(8, 8, 9, 0.96) 100%);
}

.profile-copy {
  position: absolute;
  right: 1rem;
  bottom: 1.25rem;
  left: 1rem;
}

.profile-location {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  color: #dedee0;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.profile-copy h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -0.065em;
  line-height: 1.02;
}

.profile-role {
  margin: 0.45rem 0 0;
  color: var(--accent-soft);
  font-size: 0.85rem;
}

.profile-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.profile-links a {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  transition: border-color 150ms ease, background-color 150ms ease;
}

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

.portfolio-content {
  min-width: 0;
  padding: 3.25rem 2rem 1.25rem;
  background: var(--panel);
}

.content-section {
  padding-bottom: 2.8rem;
  border-bottom: 1px solid var(--line);
}

.content-section + .content-section {
  padding-top: 2.35rem;
}

.section-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.7;
  text-transform: uppercase;
}

.section-kicker span {
  margin-inline: 0.25rem;
  color: var(--faint);
}

.about-section h1,
.section-title-row h2,
.contact-section h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 750;
  letter-spacing: -0.065em;
  line-height: 1.08;
}

.about-section h1 span,
.section-title-row h2 span,
.contact-section h2 span {
  color: var(--accent);
}

.about-section h1 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.about-lead {
  margin: 1rem 0 0;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.6;
}

.about-copy {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.75;
}

.facts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.facts-row div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.facts-row strong {
  color: var(--accent);
  font-size: 0.9rem;
}

.facts-row div span {
  color: var(--muted);
  font-size: 0.6rem;
}

.language-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}

.facts-row .language-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  color: inherit;
  font-size: inherit;
  white-space: nowrap;
}

.language-item img {
  display: block;
  width: 1.5cap;
  height: 1cap;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center;
}

.section-title-row {
  margin-bottom: 1.3rem;
}

.section-title-row .section-kicker {
  margin-bottom: 0.5rem;
}

.section-title-row h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
}

.section-nav-icon {
  display: inline-block;
  margin-right: 0.65em;
  color: var(--accent);
  font-size: 0.55em;
  vertical-align: 0.08em;
}

.navigation-icon {
  width: 1.2em;
  height: 1.2em;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 1.5rem;
}

.service-card {
  min-width: 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.service-icon {
  display: inline-block;
  color: var(--accent);
  font-size: 1.55rem;
  line-height: 1;
}

.service-card h3 {
  margin: 0.45rem 0 0.25rem;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.service-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.6;
}

.project-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
  padding-block: 1rem;
  border-top: 1px solid var(--line);
}

.project-art {
  position: relative;
  display: flex;
  min-height: 160px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 0.65rem;
  background: #292b31;
}

.art-caption,
.art-footer,
.project-type,
.project-status {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.47rem;
  letter-spacing: 0.055em;
  line-height: 1.5;
}

.art-footer {
  color: rgba(255, 255, 255, 0.63);
  font-size: 0.43rem;
}

.reboot-art {
  background: radial-gradient(circle at 50% 52%, var(--teal), var(--teal-deep) 68%);
}

.reboot-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  color: #f5f1f4;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.1em;
  line-height: 0.8;
  transform: translate(-50%, -50%);
}

.reboot-mark span:last-child {
  color: var(--accent);
}

.reuse-loop {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 94px;
  height: 94px;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.reuse-loop::before,
.reuse-loop::after {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  content: "";
}

.reuse-loop::after {
  inset: 19px;
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
}

.reuse-loop i {
  position: absolute;
  z-index: 1;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.reuse-loop i:nth-child(1) {
  top: 12px;
  left: 7px;
}

.reuse-loop i:nth-child(2) {
  top: 36px;
  right: 1px;
}

.reuse-loop i:nth-child(3) {
  bottom: 5px;
  left: 31px;
}

.project-image-art {
  padding: 0;
  background: #17191c;
}

.project-image-link {
  position: absolute;
  inset: 0;
  display: block;
  cursor: zoom-in;
}

.project-image-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 180ms ease;
}

.project-image-link:hover img {
  transform: scale(1.035);
}

.image-dialog {
  position: relative;
  max-width: min(96vw, 1280px);
  max-height: 96vh;
  padding: 2.8rem 1rem 1rem;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: #17191c;
  color: #fff;
}

.image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.image-dialog form {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.image-dialog-close {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.image-dialog-content {
  display: block;
  max-width: min(92vw, 1200px);
  max-height: 82vh;
  object-fit: contain;
}

.project-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.project-type {
  color: var(--accent);
}

.project-info h3 {
  margin: 0.45rem 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.05em;
}

.project-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.6;
}

.project-status {
  margin-top: auto;
  padding-top: 0.7rem;
  color: var(--faint);
  font-size: 0.41rem;
}

.project-status i {
  color: var(--accent);
  font-style: normal;
}

.project-link {
  margin-top: auto;
  padding-top: 0.65rem;
  font-size: 0.68rem;
}

.project-link span {
  margin-left: 0.2rem;
}

.background-list article {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.background-list article > span {
  padding-top: 0.2rem;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.48rem;
  letter-spacing: 0.05em;
}

.background-list h3 {
  margin: 0;
  font-size: 0.8rem;
}

.background-list h3 small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 400;
}

.background-list article p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.6;
}

.background-list h4 {
  margin: 0.85rem 0 0.35rem;
  color: var(--text);
  font-size: 0.65rem;
}

.responsibility-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.55;
}

.experience-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.experience-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--faint);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
  transition: background-color 180ms ease, color 180ms ease;
}

.experience-links a:hover,
.experience-links a:focus-visible {
  background: var(--text);
  color: var(--panel);
}

.experience-links svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.experience-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.experience-tags li {
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.56rem;
}

.education-list {
  display: grid;
}

.education-list article {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.education-list article > span {
  padding-top: 0.2rem;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.48rem;
  letter-spacing: 0.05em;
}

.education-list h3 {
  margin: 0;
  font-size: 0.8rem;
}

.education-list h3 small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 400;
}

.education-list p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.6;
}

.education-list p.education-project {
  margin-top: 0.9rem;
}

.publication-list article {
  padding-block: 1rem;
  border-top: 1px solid var(--line);
}

.publication-list h3 {
  margin: 0.4rem 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.publication-list p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.6;
}

.contact-section {
  padding-bottom: 2rem;
}

.contact-section h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.contact-section > p:not(.section-kicker) {
  max-width: 390px;
  margin: 0.8rem 0 1rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  transition: background-color 150ms ease;
}

.contact-button:hover {
  background: var(--accent-soft);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 0.61rem;
}

.contact-links a:hover {
  color: var(--accent);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 0.8rem;
  color: var(--faint);
  font-size: 0.57rem;
}

.site-footer a:hover {
  color: var(--accent);
}

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

@media (max-width: 900px) {
  body {
    padding-inline: 0.75rem;
  }

  .portfolio {
    grid-template-columns: 54px minmax(180px, 230px) minmax(0, 1fr);
  }

  .portfolio-content {
    padding-inline: 1.4rem;
  }

  .hero-role {
    font-size: 0.56rem;
  }
}

@media (max-width: 680px) {
  body {
    padding: 0;
    background-image: none;
  }

  .portfolio {
    grid-template-columns: 48px minmax(0, 1fr);
    width: 100%;
    min-height: 100vh;
  }

  .icon-rail {
    position: sticky;
    top: 0;
    z-index: 4;
    grid-column: 1;
    grid-row: 1 / 3;
    height: 100dvh;
    padding-block: 1rem;
  }

  .rail-links {
    justify-content: center;
    gap: 0.8rem;
  }

  .rail-link {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .profile-card {
    position: relative;
    top: auto;
    grid-column: 2;
    grid-row: 1;
    width: calc(100% - 1.5rem);
    height: 300px;
    margin: 1.4rem 0.75rem 0;
  }

  .profile-photo {
    object-position: center 24%;
  }

  .portfolio-content {
    grid-column: 2;
    grid-row: 2;
    padding: 1.5rem 1.2rem 1.5rem;
  }
}

@media (max-width: 420px) {
  .portfolio {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .profile-card {
    width: calc(100% - 1rem);
    height: 255px;
    margin: 1rem 0.5rem 0;
  }

  .portfolio-content {
    padding-inline: 0.85rem;
  }

  .services-grid {
    gap: 1rem;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .project-art {
    min-height: 175px;
  }

  .project-info {
    min-height: 145px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body::before {
    display: none;
  }

  :root,
  html[data-theme="light"] {
    color-scheme: light;
    --page: #fff;
    --panel: #fff;
    --panel-soft: #e2f2f3;
    --text: #111;
    --muted: #333;
    --faint: #555;
    --line: #ccc;
    --accent: #007b8a;
  }

  body {
    padding: 0;
    background: #fff;
  }

  .portfolio {
    grid-template-columns: 1fr 2fr;
    width: 100%;
    box-shadow: none;
  }

  .icon-rail {
    display: none;
  }

  .profile-card {
    position: relative;
    top: auto;
    grid-column: 1;
    grid-row: 1;
    height: 500px;
  }

  .portfolio-content {
    grid-column: 2;
    grid-row: 1;
  }

  .project-art {
    print-color-adjust: exact;
  }
}
