:root {
  color-scheme: dark;
  --ink: #f1f5f9;
  --muted: #b7c1ce;
  --line: #334155;
  --paper: #0f172a;
  --accent: #67d5d0;
  --accent-dark: #91e4df;
  --surface: #182438;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
}

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

.site-header,
.site-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
  padding: 24px 32px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  gap: 24px;
}

.wordmark {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover,
.text-link:hover {
  color: var(--accent);
}

.site-nav a[aria-current="page"] {
  color: var(--accent-dark);
  font-weight: 650;
}

.social-links {
  align-items: center;
  display: flex;
  gap: 14px;
}

.social-links a {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.82rem;
  gap: 7px;
  padding: 4px;
  text-decoration: none;
}

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

.social-links svg {
  fill: currentColor;
  height: 20px;
  width: 20px;
}

.nav-toggle {
  display: none;
}

.section {
  margin: 0 auto;
  max-width: 1120px;
  padding: 104px 32px;
  scroll-margin-top: 24px;
}

.hero {
  padding-bottom: 128px;
  padding-top: 132px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 16px;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.045em;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5.3rem);
  margin-bottom: 24px;
  max-width: 780px;
}

h2 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  margin-bottom: 0;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.hero-copy {
  color: var(--muted);
  font-size: 1.16rem;
  margin-bottom: 32px;
  max-width: 620px;
}

.hero-role {
  color: var(--accent);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  margin-bottom: 18px;
}

.focus-section h2,
.experience-section h2 {
  margin-bottom: 20px;
}

.section-intro {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 720px;
}

.focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.focus-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.9rem;
  padding: 8px 14px;
}

.experience-card {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  padding: 32px 0;
  position: relative;
}

.experience-card:hover .experience-card-header h2 {
  color: var(--accent);
}

.experience-list {
  border-top: 1px solid var(--line);
  display: grid;
}

.experience-card-meta {
  color: var(--muted);
  justify-self: end;
  padding-top: 8px;
  text-align: right;
}

.experience-card-header {
  margin-bottom: 16px;
}

.experience-card h2,
.experience-card h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.experience-role {
  color: var(--accent);
  font-weight: 650;
  margin-bottom: 0;
}

.experience-card .date-range {
  font-family: var(--mono);
  margin: 0;
}

.date-range {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  margin: 0 0 12px;
}

.experience-body {
  color: var(--muted);
}

.experience-body p:last-child {
  margin-bottom: 0;
}

.experience-open-hint {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 650;
  margin: 18px 0 0;
  pointer-events: none;
}

.experience-open-hint span {
  margin-left: 4px;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.section-heading {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
}

.section-heading .eyebrow {
  margin-bottom: 12px;
}

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

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.project-filter {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  padding: 7px 12px;
}

.project-filter:hover,
.project-filter[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: border-color 180ms ease, transform 180ms ease;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-card[hidden] {
  display: none;
}

.project-card-open,
.experience-card-open {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: inherit;
  cursor: pointer;
  inset: 0;
  position: absolute;
  z-index: 1;
}

.project-card-open:focus-visible,
.experience-card-open:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.project-image-frame {
  margin: 0;
}

.project-image,
.project-image-placeholder {
  aspect-ratio: 16 / 8;
  display: block;
  width: 100%;
}

.project-image {
  object-fit: cover;
}

.project-image-placeholder {
  align-items: center;
  background: linear-gradient(135deg, var(--surface), #17404b);
  color: var(--muted);
  display: flex;
  font-family: var(--mono);
  justify-content: center;
}

.project-image-frame figcaption {
  color: var(--muted);
  font-size: 0.72rem;
  padding: 8px 24px 0;
}

.project-card-body {
  padding: 20px 24px 24px;
}

.project-card h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.project-summary {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.project-tags,
.experience-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag,
.experience-tag {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.74rem;
  padding: 4px 8px;
}

.experience-tags {
  margin-top: 16px;
}

.project-open-hint {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 650;
  margin: 18px 0 0;
  pointer-events: none;
}

.project-open-hint span {
  margin-left: 4px;
}

.project-dialog-close:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.project-dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  height: min(94vh, 1000px);
  margin: auto;
  max-height: 94vh;
  max-width: none;
  overflow: hidden;
  padding: 0;
  width: min(96vw, 1440px);
}

.project-dialog::backdrop {
  backdrop-filter: blur(4px);
  background: rgb(2 6 23 / 82%);
}

.project-dialog[open] {
  animation: project-dialog-enter 220ms ease-out both;
}

.project-dialog[open]::backdrop {
  animation: project-backdrop-enter 220ms ease-out both;
}

@keyframes project-dialog-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes project-backdrop-enter {
  from {
    background-color: transparent;
    backdrop-filter: blur(0);
  }
  to {
    background-color: rgb(2 6 23 / 82%);
    backdrop-filter: blur(4px);
  }
}

.project-dialog-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.project-dialog-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 16px clamp(20px, 4vw, 48px) 22px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.project-dialog-topbar {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.project-dialog-topbar .eyebrow {
  margin: 0;
}

.project-dialog-close {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 1.6rem;
  height: 40px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  width: 40px;
}

.project-dialog-close:hover {
  background: var(--surface);
  color: var(--accent);
}

.project-dialog-header h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  margin-bottom: 10px;
}

.project-dialog-summary {
  color: var(--muted);
  margin: 0;
  max-width: 760px;
}

.project-dialog-body {
  margin: 0 auto;
  max-width: 1200px;
  padding: 28px clamp(20px, 4vw, 48px) 48px;
}

.experience-dialog-body {
  --experience-dialog-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  display: grid;
  gap: clamp(24px, 4vw, 48px);
  grid-template-columns: var(--experience-dialog-columns);
}

.experience-dialog-feature {
  margin: 0;
}

.project-dialog-feature {
  margin: 0 0 28px;
}

.project-dialog-feature img,
.project-dialog-feature .project-image-placeholder {
  aspect-ratio: 16 / 8;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: block;
  max-height: 58vh;
  object-fit: contain;
  width: 100%;
}

.project-dialog-feature figcaption,
.project-gallery figcaption {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 8px;
}

.project-gallery {
  margin: 0 0 36px;
}

.project-gallery h3 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.project-gallery-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.project-gallery-grid figure {
  margin: 0;
}

.project-gallery-grid img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.project-content {
  padding-top: 14px;
}

.project-detail-intro {
  color: var(--muted);
}

.project-content > :last-child {
  margin-bottom: 0;
}

.case-study {
  margin: 0 0 24px;
}

.case-study div {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.case-study dt {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 650;
  margin-bottom: 5px;
}

.case-study dd {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.project-link {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 650;
  text-underline-offset: 4px;
}

code,
pre {
  font-family: var(--mono);
}

.resume-section {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.resume-content {
  color: var(--muted);
  max-width: 640px;
}

.resume-document {
  padding: 0;
}

.resume-document h2 {
  color: var(--ink);
  font-size: 2rem;
  margin-bottom: 8px;
}

.resume-document h3 {
  color: var(--ink);
  font-size: 1.1rem;
}

.resume-document section {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 24px;
}

.resume-specialty {
  color: var(--accent);
}

.resume-content p {
  margin-bottom: 24px;
}

.resume-document li {
  margin-bottom: 6px;
}

.contact-section {
  padding-bottom: 112px;
}

.contact-section h2 {
  margin-bottom: 16px;
}

.contact-section > p:not(.eyebrow) {
  color: var(--muted);
  margin-bottom: 28px;
}

.button-link {
  background: var(--accent);
  border-radius: 6px;
  color: var(--paper);
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 650;
  padding: 12px 18px;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-dark);
  color: var(--paper);
}

.contact-links {
  display: grid;
  gap: 24px;
  max-width: 720px;
}

.contact-method {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
}

.contact-url {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.88rem;
  margin-top: 10px;
  overflow-wrap: anywhere;
  text-underline-offset: 4px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 760px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    padding: 20px 24px;
  }

  .nav-toggle {
    align-items: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 40px;
    justify-content: center;
    padding: 8px;
    width: 40px;
  }

  .nav-toggle span {
    background: currentColor;
    border-radius: 2px;
    height: 2px;
    width: 18px;
  }

  .site-nav {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: none;
    flex-direction: column;
    gap: 0;
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0 -24px -20px;
    padding: 8px 24px 16px;
    width: calc(100% + 48px);
  }

  .has-nav-toggle .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 10px 0;
  }

  .has-nav-toggle .site-nav:not(.is-open) {
    display: none;
  }

  .social-links {
    grid-column: 2;
    grid-row: 1;
    gap: 8px;
  }

  .social-label {
    display: none;
  }

  .nav-toggle {
    grid-column: 3;
    grid-row: 1;
  }

  .section {
    padding: 76px 24px;
  }

  .hero {
    padding-bottom: 96px;
    padding-top: 96px;
  }

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

  .experience-card {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 44vw);
    padding: 24px 0;
  }

  .experience-card-meta {
    padding-top: 8px;
  }

  .experience-dialog-body {
    --experience-dialog-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .project-dialog {
    border-radius: 10px;
    height: 94vh;
    max-height: 94vh;
    width: 96vw;
  }

  .project-dialog-header {
    padding-bottom: 16px;
    padding-top: 12px;
  }

  .project-dialog-body {
    padding-bottom: 32px;
    padding-top: 20px;
  }
}

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

  .project-card,
  .project-dialog[open],
  .project-dialog[open]::backdrop {
    animation: none;
    transition: none;
    transform: none;
  }
}

@media (min-width: 761px) {
  .site-header {
    flex-wrap: nowrap;
  }

  .site-header > .site-nav {
    flex: 1;
    justify-content: center;
  }

  .site-header > .social-links {
    flex-shrink: 0;
  }

  .site-header > .nav-toggle {
    display: none;
  }
}
