:root {
  color-scheme: light dark;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #141414;
  --text-muted: #525252;
  --border: #e5e5e5;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-fg: #f0fdfa;
  --focus: #0369a1;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 44rem;
  --nav-h: clamp(3rem, 8vw, 3.35rem);

  --pad-x: clamp(0.5rem, 2.5vw + 0.25rem, 1.75rem);
  --pad-y-section: clamp(1.75rem, 4vw, 3.25rem);
  --touch-min: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1c1c1c;
    --text: #f5f5f5;
    --text-muted: #a3a3a3;
    --border: #333333;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-fg: #042f2e;
    --focus: #38bdf8;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  }
}

@media (min-width: 1600px) {
  :root {
    --max: 54rem;
  }

  html {
    font-size: 104%;
  }
}

@media (min-width: 1920px) {
  :root {
    --max: 62rem;
    --pad-x: clamp(0.9rem, 1.5vw, 1.45rem);
  }

  html {
    font-size: 110%;
  }
}

@media (min-width: 2560px) {
  :root {
    --max: min(96rem, calc(100vw - 2rem));
    --pad-x: clamp(0.65rem, 1vw, 1.15rem);
    --nav-h: clamp(3.15rem, 4.5vw, 3.85rem);
  }

  html {
    font-size: 128%;
  }
}

@media (min-width: 3840px) {
  :root {
    --max: min(122rem, calc(100vw - 2.5rem));
    --pad-x: clamp(0.75rem, 1.1vw, 1.5rem);
  }

  html {
    font-size: 142%;
  }
}

@media (max-width: 20rem) {
  :root {
    --pad-x: max(0.4rem, env(safe-area-inset-left, 0px));
    --nav-h: 3rem;
  }

  html {
    font-size: 93.75%;
  }
}

@media (max-width: 15rem) {
  html {
    font-size: 87.5%;
  }
}

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

html {
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(0.9375rem, 0.25vw + 0.88rem, 1.0625rem);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 2560px) {
  body {
    font-size: clamp(1.06rem, 0.1vw + 1rem, 1.3rem);
    line-height: 1.58;
  }

  h1 {
    font-size: clamp(1.75rem, 2.4vw + 1rem, 3.1rem);
  }

  h2 {
    font-size: clamp(1.32rem, 1.1vw + 1.05rem, 1.78rem);
  }
}

@media (min-width: 3840px) {
  body {
    font-size: clamp(1.1rem, 0.08vw + 1.05rem, 1.38rem);
  }

  h1 {
    font-size: clamp(2rem, 1.75vw + 1.25rem, 3.45rem);
  }

  h2 {
    font-size: clamp(1.42rem, 0.85vw + 1.2rem, 2rem);
  }
}

.skip {
  position: absolute;
  left: -9999px;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip:focus {
  left: max(0.5rem, env(safe-area-inset-left, 0px));
  top: max(0.5rem, env(safe-area-inset-top, 0px));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

@supports not (backdrop-filter: blur(12px)) {
  .site-header {
    background: var(--bg);
  }
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 max(var(--pad-x), env(safe-area-inset-right, 0px)) 0
    max(var(--pad-x), env(safe-area-inset-left, 0px));
  padding-top: max(0px, env(safe-area-inset-top, 0px));
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}

@media (max-width: 30rem) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.35rem;
  }

  .brand {
    text-align: center;
  }
}

.brand {
  font-weight: 700;
  font-size: clamp(0.88rem, 1.5vw, 0.98rem);
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

.brand:hover {
  color: var(--accent);
}

.nav-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent, #000 0.75rem, #000 calc(100% - 0.75rem), transparent);
}

@supports not (mask-image: linear-gradient(to right, transparent, #000)) {
  .nav-scroll {
    mask-image: none;
  }
}

@media (max-width: 30rem) {
  .nav-scroll {
    margin-inline: calc(-1 * min(var(--pad-x), 0.75rem));
    padding-inline: min(var(--pad-x), 0.75rem);
  }
}

.nav-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  width: max-content;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0.35rem 0.6rem;
  font-size: clamp(0.68rem, 2.2vw, 0.8rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem) max(var(--pad-x), env(safe-area-inset-left, 0px))
    clamp(2.5rem, 5vw, 4rem) max(var(--pad-x), env(safe-area-inset-right, 0px));
  padding-bottom: max(clamp(2.5rem, 5vw, 4rem), env(safe-area-inset-bottom, 0px));
}

.section-label {
  display: block;
  font-size: clamp(0.65rem, 1.8vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.45rem, 5vw + 0.5rem, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.hero-title {
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.hero-meta {
  font-size: clamp(0.9rem, 2vw, 0.98rem);
  color: var(--text);
  margin: 0 0 1rem;
}

.permit {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: clamp(0.85rem, 2vw, 0.92rem);
  font-weight: 600;
  color: var(--accent);
  max-width: 100%;
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  font-size: clamp(0.88rem, 2vw, 0.95rem);
}

.contact-list li {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
}

.contact-list li:not(:last-child)::after {
  content: "·";
  margin-left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

@media (max-width: 22rem) {
  .contact-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .contact-list li:not(:last-child)::after {
    display: none;
  }
}

.contact-list a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  word-break: break-word;
}

.contact-list a:hover {
  text-decoration-thickness: 0.12em;
}

.lede {
  margin: 0;
  color: var(--text);
  hyphens: auto;
}

.lede--spaced-top {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
}

.lede strong {
  font-weight: 700;
}

section {
  margin-top: var(--pad-y-section);
  padding-top: 0.25rem;
  scroll-margin-top: calc(var(--nav-h) + max(12px, env(safe-area-inset-top, 0px)) + 0.5rem);
}

h2 {
  font-size: clamp(1.2rem, 2.5vw + 0.35rem, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.impact-list {
  margin: 0;
  padding-left: 1.15rem;
}

.impact-list li {
  margin-bottom: 0.55rem;
  padding-left: 0.25rem;
}

.impact-list li::marker {
  color: var(--accent);
}

.job {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.15rem) clamp(1rem, 2.5vw, 1.25rem) clamp(1.05rem, 2.5vw, 1.2rem);
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.job-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.job-title {
  font-size: clamp(1rem, 2.2vw, 1.08rem);
  font-weight: 700;
  margin: 0;
}

.job-meta {
  font-size: clamp(0.82rem, 2vw, 0.88rem);
  font-weight: 600;
  color: var(--text-muted);
}

.job-company {
  font-size: clamp(0.88rem, 2vw, 0.92rem);
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.job ul {
  margin: 0;
  padding-left: 1.1rem;
}

.job li {
  margin-bottom: 0.45rem;
}

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

.stack-groups {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.stack-group h3 {
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: clamp(0.76rem, 2vw, 0.82rem);
  font-weight: 600;
  color: var(--text);
  min-height: 2.5rem;
}

.tech-item i {
  font-size: 1.15rem;
  line-height: 1;
}

.stack-more {
  margin: 0.85rem 0 0;
  font-size: clamp(0.88rem, 2vw, 0.92rem);
  color: var(--text-muted);
}

.stack-more--tight-top {
  margin-top: 1rem;
}

.stack-more a {
  color: var(--accent);
  font-weight: 600;
}

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.work-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(0.9rem, 2.5vw, 1rem) clamp(1rem, 2.5vw, 1.15rem);
  box-shadow: var(--shadow);
}

.work-item strong {
  display: block;
  font-size: clamp(0.94rem, 2vw, 0.98rem);
  margin-bottom: 0.35rem;
}

.work-item p {
  margin: 0;
  font-size: clamp(0.88rem, 2vw, 0.94rem);
  color: var(--text-muted);
}

.work-item a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.15em;
  word-break: break-word;
}

.work-item a:hover {
  text-decoration-thickness: 0.1em;
}

code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 8%, var(--surface));
  word-break: break-all;
}

.blockquote-wrap {
  margin: 0;
  padding: clamp(1rem, 2.5vw, 1.15rem) clamp(1rem, 2.5vw, 1.25rem);
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
}

blockquote {
  margin: 0;
  font-size: clamp(0.92rem, 2vw, 0.98rem);
  font-style: italic;
  color: var(--text);
}

.blockquote .cite-name {
  display: block;
  margin-top: 0.85rem;
  font-size: clamp(0.84rem, 2vw, 0.88rem);
  font-style: normal;
  font-weight: 600;
  color: var(--text-muted);
}

.lang-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.lang-list li {
  margin-bottom: 0.35rem;
}

.edu-list {
  margin: 0;
  padding-left: 1.1rem;
}

.edu-list li {
  margin-bottom: 0.55rem;
}

.site-footer {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.5rem, 3vw, 2rem) max(var(--pad-x), env(safe-area-inset-left, 0px))
    max(2rem, env(safe-area-inset-bottom, 0px)) max(var(--pad-x), env(safe-area-inset-right, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}

.footer-lead {
  margin-bottom: 1rem !important;
}

.footer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch-min);
  padding: 0.65rem 1.15rem;
  font-family: inherit;
  font-size: clamp(0.9rem, 2vw, 0.95rem);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.footer-note {
  margin: 0;
  font-size: clamp(0.82rem, 2vw, 0.88rem);
  color: var(--text-muted);
}

.footer-note a {
  color: var(--accent);
  font-weight: 600;
}

:is(
    a:not([class]),
    .footer-note a,
    .stack-more a,
    .contact-list a,
    .work-item a
  ):focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.nav-links a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.brand:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

@media print {
  .site-header,
  .skip {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  main {
    padding-top: 0;
    max-width: 100%;
  }

  section {
    scroll-margin-top: 0;
    break-inside: avoid;
  }

  .job,
  .work-item,
  .blockquote-wrap {
    box-shadow: none;
    border-color: #ccc;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }

  a[href^="mailto"]::after,
  a[href^="tel"]::after,
  .btn[href^="http"]::after {
    content: "";
  }
}

@media (prefers-contrast: more) {
  :root {
    --text-muted: #3d3d3d;
    --border: #949494;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --text-muted: #dedede;
    --border: #767676;
  }
}
