:root {
  color-scheme: dark;
  --canvas: #000;
  --graphite: #0e0e0e;
  --carbon: #1d1d1f;
  --line: #333336;
  --outline: #6e6e73;
  --text: #f5f5f7;
  --muted: #a1a1a8;
  --blue: #0071e3;
  --blue-hover: #0065c9;
  --link: #58adff;
  --focus: #68b5ff;
  --radius: 28px;
  --page-width: 1184px;
  --gutter: clamp(16px, 4vw, 48px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

html { scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
}

p, h1, h2, h3, h4, figure, dl, dd { margin: 0; }

[hidden] { display: none !important; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover { text-decoration: underline; }

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

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

.wrap {
  width: min(var(--page-width), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 5;
  top: 12px;
  left: var(--gutter);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--carbon);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 3;
  top: 0;
  padding-block: 10px;
  background: rgb(0 0 0 / 88%);
  backdrop-filter: blur(16px);
}

.site-nav {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-inline: 19px;
  border: 1px solid #282828;
  border-radius: 20px;
  background: var(--graphite);
}

.wordmark, .site-nav nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-decoration: none;
}

.wordmark {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.site-nav nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 clamp(14px, 2.4vw, 34px);
}

.site-nav nav a {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.site-nav a:hover { color: var(--text); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(480px, auto) auto;
  align-items: center;
}

.hero-copy {
  z-index: 1;
  max-width: 530px;
  padding-block: 52px;
}

.hero-art {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -8px;
  display: block;
  width: min(76%, 854px);
  height: auto;
  transform: translateY(calc(-50% - 42px));
  mix-blend-mode: screen;
  pointer-events: none;
}

h1, h2, h3, h4 {
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3.25rem, 7vw, 6rem);
  line-height: 1.03;
  letter-spacing: -0.063em;
}

h2 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.09;
  letter-spacing: -0.045em;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

h4 {
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.hero-role {
  max-width: 42ch;
  margin-top: 18px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.hero-intro {
  max-width: 39ch;
  margin-top: 13px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
}

.hero-actions, .project-actions, .handoff-actions, .contact-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions { margin-top: 29px; }

.button, .hero-contact, .outline-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button {
  background: var(--blue);
  color: #fff;
}

.button:hover {
  background: var(--blue-hover);
  text-decoration: none;
}

.hero-contact, .outline-button {
  border-color: var(--outline);
  background: transparent;
  color: var(--text);
}

.hero-contact:hover, .outline-button:hover {
  border-color: var(--muted);
  background: var(--carbon);
  text-decoration: none;
}

.at-a-glance {
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.8fr 1fr;
  gap: 18px 24px;
  padding-block: 21px 25px;
  border-top: 1px solid var(--line);
}

.at-a-glance dt {
  color: var(--muted);
  font-size: 0.79rem;
}

.at-a-glance dd {
  margin-top: 3px;
  font-weight: 500;
}

.section { padding-block: clamp(60px, 7.5vw, 106px); }

.work { background: linear-gradient(var(--carbon), var(--canvas) 288px); }

.work > .wrap > h2 { margin-bottom: clamp(24px, 4vw, 42px); }

.project-entry {
  padding: clamp(18px, 3.1vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--graphite);
}

.project-entry + .project-entry { margin-top: 24px; }

.project-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 13px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 0.81rem;
  font-weight: 500;
}

.project-kicker span + span::before {
  margin-right: 13px;
  color: var(--muted);
  content: "·";
}

.project-layout, .skills-layout, .background-layout, .contact-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4.7vw, 64px);
}

.project-layout { align-items: start; }

.project-copy h3 {
  margin-bottom: 15px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.047em;
}

.project-copy p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

.project-copy .lead {
  margin-top: 0;
  color: var(--text);
  font-size: 1.13rem;
  font-weight: 500;
  line-height: 1.45;
}

.project-copy strong { color: var(--text); }

.project-actions { margin-top: 23px; }

.button svg, .outline-button svg { flex: none; }

.handoff {
  min-width: 0;
  padding: clamp(12px, 2vw, 21px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
}

.handoff figcaption {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 600;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.lang-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--graphite);
}

.lang-toggle {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.15;
  cursor: pointer;
}

.lang-toggle:hover { color: var(--text); }

.lang-toggle[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--carbon);
  color: var(--text);
}

.handoff-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.handoff-track li, .handoff-track button {
  display: grid;
  min-height: 54px;
  align-content: center;
  gap: 3px;
  padding: 6px 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--graphite);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.handoff-track button { cursor: pointer; }

.handoff-track button:hover { color: var(--text); }

.handoff-track li[aria-current="step"], .handoff-track button[aria-selected="true"] {
  border-color: var(--link);
  background: #0c1c2b;
  color: var(--text);
}

.handoff-track span { font-size: 0.65rem; }

.handoff-track [data-state="complete"] span { color: #89d6a5; }

.handoff-track li[data-state="blocked"] {
  border-color: #ff9e9b;
  background: #291619;
}

.handoff-track [data-state="blocked"] span,
.handoff-output[data-state="blocked"] .handoff-output-label { color: #ffaaa7; }

.handoff-demo {
  display: grid;
  gap: 11px;
  margin-top: 17px;
}

.handoff-demo h4 { text-wrap: pretty; }

.handoff-guide {
  color: var(--muted);
  font-size: 0.86rem;
}

.handoff-field, .contact-field { min-width: 0; }

.handoff-field label, .contact-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
}

.handoff-field input, .handoff-field select, .contact-field input, .contact-field textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: var(--graphite);
  color: var(--text);
  font-size: 1rem;
}

.contact-field textarea {
  min-height: 108px;
  border-radius: 17px;
  resize: vertical;
}

.handoff-output {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--graphite);
}

.handoff-output-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.handoff-output pre {
  margin: 0;
  color: var(--text);
  font: 0.74rem/1.6 ui-monospace, "Cascadia Code", Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.handoff-output code { font: inherit; }

.handoff-actions .button, .handoff-actions .outline-button { font-size: 0.82rem; }

.handoff-reset, .preview-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--link);
  font-size: 0.83rem;
  font-weight: 600;
}

.handoff-reset {
  padding: 0 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.handoff-reset:hover { text-decoration: underline; }

.profile-band {
  --text: #1d1d1f;
  --muted: #525258;
  --line: #d6d6dc;
  --link: #0066cc;
  --focus: #0066cc;
  color-scheme: light;
  background: #f5f5f7;
  color: var(--text);
}

.skills-layout { margin-top: 28px; }

.skill-list > div {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 6px 18px;
  padding-block: 13px;
  border-bottom: 1px solid var(--line);
}

.skill-list > div:first-child { border-top: 1px solid var(--line); }

.skill-list dt { font-weight: 600; }

.skill-list dd, .credentials span, details ul, .timeline-entry p:not(.entry-date) {
  color: var(--muted);
  font-size: 0.88rem;
}

.skill-level {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 600;
}

.credential-panel, .timeline-entry {
  padding: clamp(19px, 3vw, 31px);
  border-radius: var(--radius);
  background: #fff;
}

.credentials {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.credentials li {
  display: grid;
  gap: 4px;
  padding-block: 10px;
  border-top: 1px solid var(--line);
}

.credentials strong {
  font-size: 0.9rem;
  font-weight: 600;
}

details { border-top: 1px solid var(--line); }

details summary {
  padding-block: 12px 2px;
  color: var(--link);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

details ul {
  margin: 9px 0 0;
  padding-left: 19px;
}

details li + li { margin-top: 5px; }

.background-layout {
  padding-top: 0;
  align-items: start;
}

.timeline { display: grid; gap: 12px; }

.entry-date {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.timeline-entry p:not(.entry-date) { margin-top: 6px; }

.contact-intro p, .contact-form-actions p, .contact-field label span { color: var(--muted); }

.contact-intro p { margin-top: 9px; }

.contact-shell {
  margin-top: 24px;
  padding: clamp(20px, 4.2vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--graphite);
}

.contact-directory {
  display: grid;
  align-content: start;
  gap: 24px;
}

.contact-method h3 {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: normal;
}

.contact-address {
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-block: 17px;
}

.contact-field-wide { grid-column: 1 / -1; }

.contact-form-actions p, .draft-status, .draft-link { font-size: 0.82rem; }

.draft-status:not(:empty) { margin-top: 11px; }

.draft-link { display: inline-block; margin-top: 4px; }

.contact-links, .site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.contact-links { margin-top: 21px; }

.contact-links a, .site-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-size: 0.89rem;
  font-weight: 500;
}

.site-footer {
  align-items: center;
  justify-content: space-between;
  padding-block: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.87rem;
}

@media (max-width: 920px) {
  .hero { grid-template-rows: minmax(420px, auto) auto; }

  .project-layout { gap: 25px; }

  .skills-layout, .background-layout, .contact-shell { gap: 26px; }
}

@media (max-width: 740px) {
  .hero {
    grid-template-rows: auto auto auto;
    text-align: center;
  }

  .hero-copy {
    margin-inline: auto;
    padding-block: clamp(24px, 6vw, 44px) 0;
  }

  .hero-role, .hero-intro { margin-inline: auto; }

  .hero-actions {
    justify-content: center;
    margin-top: 22px;
  }

  .hero-art {
    position: static;
    width: min(100%, 490px);
    height: clamp(240px, 65vw, 400px);
    margin-inline: auto;
    transform: translateX(-10%);
    object-fit: cover;
    object-position: right center;
  }

  .at-a-glance { text-align: left; }

  .project-layout, .skills-layout, .background-layout, .contact-shell { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 460px) {
  html { scroll-padding-top: 104px; }

  .site-nav {
    flex-wrap: wrap;
    gap: 0;
    padding-inline: 14px;
  }

  .site-nav .wordmark { min-height: 34px; }

  .site-nav nav {
    width: 100%;
    justify-content: space-between;
    gap: 0 8px;
  }

  .site-nav nav a { min-height: 37px; }

  .hero h1 {
    font-size: clamp(2.82rem, 11vw, 3.5rem);
    letter-spacing: -0.055em;
  }

  .at-a-glance {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 0.86rem;
  }

  .at-a-glance > div:last-child { grid-column: 1 / -1; }

  .handoff-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .skill-list > div { grid-template-columns: minmax(0, 1fr); }

  .contact-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
