/* =========================================================
   Gia Huy — personal portfolio
   Palette: Mastra green #46F488, near-black, off-white
   Type: Bricolage Grotesque / Instrument Sans / JetBrains Mono
   ========================================================= */

:root {
  --bg: #070908;
  --surface: #0c0f0d;
  --surface-2: #111512;
  --line: #222a23;
  --line-soft: #1a1f1b;
  --line-strong: #303a31;
  --text: #f1f3ee;
  --text-soft: #c9cec7;
  --muted: #98a098;
  --muted-2: #737b73;
  --green: #46f488;
  --green-bright: #6dffa6;
  --green-ink: #06120a;
  --green-soft: rgba(70, 244, 136, 0.1);
  --green-line: rgba(70, 244, 136, 0.28);
  --paper: #edeee7;
  --paper-ink: #0a0c09;
  --paper-muted: #5a6158;
  --paper-line: #c9cdc2;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shell: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(900px 600px at 82% -8%, rgba(70, 244, 136, 0.06), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
dt,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

::selection {
  background: var(--green);
  color: var(--green-ink);
}

[hidden] {
  display: none !important;
}

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

.shell {
  width: 100%;
  max-width: calc(var(--shell) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--green);
  color: var(--green-ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

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

.page-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(241, 243, 238, 0.065) 1px, transparent 0);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.45) 40%, transparent 64%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.45) 40%, transparent 64%);
}

.site-header,
main {
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 9, 8, 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  transition: transform 220ms ease;
}

.brand:hover .brand-mark {
  transform: rotate(-6deg);
}

.primary-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.primary-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 180ms ease;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--green);
  transition: right 220ms ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="location"] {
  color: var(--text);
}

.primary-nav a:hover::after,
.primary-nav a[aria-current="location"]::after {
  right: 0;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.header-cta:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease,
    transform 180ms ease, box-shadow 180ms ease;
}

.button-primary {
  background: var(--green);
  color: var(--green-ink);
}

.button-primary:hover {
  background: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(70, 244, 136, 0.08);
  transform: translateY(-1px);
}

.button-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.button-ghost:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.button:disabled {
  cursor: default;
  transform: none;
  box-shadow: none;
}

.text-button {
  padding: 12px 0 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

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

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: clamp(36px, 5vw, 76px);
  align-items: start;
  padding-block: clamp(64px, 9vw, 128px) clamp(64px, 8vw, 112px);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.hero h1 {
  max-width: 15ch;
  margin-bottom: 28px;
  font-family: var(--display);
  font-size: clamp(3rem, 6.2vw, 5.9rem);
  font-weight: 500;
  letter-spacing: -0.052em;
  line-height: 0.94;
  text-wrap: balance;
}

.hero h1 .accent {
  color: var(--green);
}

.hero-lede {
  max-width: 54ch;
  margin-bottom: 34px;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.35vw, 1.22rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-footnote {
  max-width: 55ch;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- Hero greeting & photo ---------- */

.hero-greeting {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text);
}

.hero-greeting .wave {
  display: inline-block;
  animation: wave 2.5s infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

.hero-photo {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.photo-frame {
  width: 280px;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  position: relative;
}

.photo-frame::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100%;
  height: 100%;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  z-index: -1;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Project images ---------- */

.project-image {
  width: 100%;
  height: 200px;
  margin-bottom: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.project-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
}

.image-placeholder svg {
  width: 64px;
  height: 64px;
  opacity: 0.4;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 5, 0.88);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  animation: lb-fade-in 200ms ease both;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 180ms ease, color 180ms ease;
  z-index: 1;
}

.lightbox-close:hover {
  border-color: var(--green);
  color: var(--green);
}

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.5);
  cursor: default;
}

@keyframes lb-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.project-image {
  cursor: zoom-in;
  transition: box-shadow 200ms ease;
}

.project-image:hover {
  box-shadow: 0 0 0 1px var(--green-line);
}

/* ---------- Run trace ---------- */

.trace-panel {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(18, 22, 19, 0.96), rgba(9, 12, 10, 0.97)),
    var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  transition: border-color 240ms ease, box-shadow 240ms ease;
}

.trace-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  width: 64px;
  height: 2px;
  background: var(--green);
}

.trace-panel.is-committed {
  border-color: rgba(70, 244, 136, 0.45);
  box-shadow: 0 0 0 1px rgba(70, 244, 136, 0.12), 0 24px 80px rgba(0, 0, 0, 0.35);
}

.trace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.mono-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.11em;
  line-height: 1.4;
  text-transform: uppercase;
}

.trace-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--green-line);
  border-radius: 3px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.trace-state[data-state="committed"] {
  border-color: var(--green);
  background: var(--green);
  color: var(--green-ink);
}

.trace-context {
  padding: 18px 0 12px;
}

.trace-kicker {
  margin-bottom: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.trace-sub {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.trace-steps {
  padding-bottom: 4px;
}

.trace-step {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 9px 0;
}

.trace-step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: -9px;
  left: 8.5px;
  width: 1px;
  background: var(--line-strong);
}

.trace-step.is-done:not(:last-child)::before {
  background: rgba(70, 244, 136, 0.24);
}

.step-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
}

.step-mark::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted-2);
}

.trace-step.is-done .step-mark {
  border-color: rgba(70, 244, 136, 0.4);
  background: var(--green-soft);
}

.trace-step.is-done .step-mark::after {
  content: "✓";
  width: auto;
  height: auto;
  background: none;
  color: var(--green);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1;
}

.trace-step.is-active .step-mark {
  border-color: var(--green);
  background: var(--green-soft);
  animation: pulse-ring 2.4s ease-out infinite;
}

.trace-step.is-active .step-mark::after {
  width: 6px;
  height: 6px;
  background: var(--green);
}

.trace-step.is-queued {
  opacity: 0.55;
}

.step-copy {
  min-width: 0;
}

.step-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.trace-step.is-active .step-title {
  color: var(--green);
}

.trace-step.is-done .step-title {
  color: var(--text-soft);
}

.step-index {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.step-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.45;
}

.trace-step.is-active .step-meta {
  color: var(--green);
}

.trace-action {
  padding-top: 8px;
}

.button-approve {
  width: 100%;
  background: var(--green);
  color: var(--green-ink);
}

.button-approve:hover {
  background: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(70, 244, 136, 0.08);
}

.button-approve:disabled {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
  opacity: 1;
}

.receipt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.receipt-label {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid var(--green-line);
  border-radius: 2px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.receipt p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.6;
}

.trace-note {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(70, 244, 136, 0.26);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(70, 244, 136, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(70, 244, 136, 0);
  }
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy > *,
.trace-panel {
  animation: fade-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-copy > *:nth-child(1) {
  animation-delay: 40ms;
}

.hero-copy > *:nth-child(2) {
  animation-delay: 100ms;
}

.hero-copy > *:nth-child(3) {
  animation-delay: 160ms;
}

.hero-copy > *:nth-child(4) {
  animation-delay: 220ms;
}

.hero-copy > *:nth-child(5) {
  animation-delay: 280ms;
}

.trace-panel {
  animation-delay: 180ms;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 9vw, 124px);
  border-top: 1px solid var(--line-soft);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.section-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--green);
}

.section h2 {
  max-width: 16ch;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.4vw, 4.1rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}

.section-intro {
  justify-self: end;
  max-width: 45ch;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}

/* ---------- Work ---------- */

.project {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(32px, 4vw, 52px);
  border-top: 1px solid var(--line);
}

.project-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.project-meta {
  min-width: 0;
}

.project-index {
  display: block;
  margin-bottom: 14px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: color 180ms ease;
}

.project:hover .project-index {
  color: var(--green-bright);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.chip-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.meta-list {
  display: grid;
  gap: 13px;
}

.meta-list div {
  display: grid;
  gap: 2px;
}

.meta-list dt {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.meta-list dd {
  color: #b8c0b7;
  font-size: 12.5px;
  line-height: 1.5;
}

.project-body {
  min-width: 0;
}

.project-body h3 {
  margin-bottom: 12px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 2.9vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.project-subtitle {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.project-thesis {
  max-width: 54ch;
  margin-bottom: 22px;
  color: #d5dbd3;
  font-size: clamp(1.02rem, 1.35vw, 1.16rem);
  line-height: 1.55;
}

.project-points {
  display: grid;
  gap: 10px;
  max-width: 64ch;
  margin-bottom: 20px;
}

.project-points li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.58;
}

.project-points li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 1px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--green);
  transform: rotate(45deg);
}

.project-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-width: 64ch;
  margin-bottom: 20px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.015);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.project-flow .node {
  color: #c4cbc2;
}

.project-flow .arrow {
  color: var(--green);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.inline-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease;
}

.inline-link:hover {
  border-color: var(--green);
  color: var(--green);
}

.all-repos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

/* ---------- Approach ---------- */

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

.approach-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: start;
}

.approach-head {
  position: sticky;
  top: 104px;
}

.approach-head .section-intro {
  justify-self: start;
  margin-top: 20px;
}

.pull-quote {
  max-width: 17ch;
  margin-top: 42px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.pull-quote span {
  color: var(--green);
}

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

.principle {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.principle-label {
  padding-top: 5px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  line-height: 1.5;
  text-transform: uppercase;
}

.principle h3 {
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 1.38rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.principle p {
  max-width: 52ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ---------- Experience ---------- */

.resume-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.column-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.role {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.role-link {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: opacity 180ms ease;
}

.role-link:hover {
  opacity: 0.85;
}

.role-logo {
  flex: 0 0 auto;
  width: 80px;
  height: 40px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: opacity 180ms ease;
}

.role-link:hover .role-logo {
  opacity: 1;
}

.role-content {
  flex: 1;
  min-width: 0;
}

.role-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  align-items: baseline;
  justify-content: space-between;
}

.role h4 {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.role-date {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  line-height: 1.5;
  white-space: nowrap;
}

.role-sub {
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.role-points {
  display: grid;
  gap: 10px;
}

.role-points li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.role-points li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--green);
}

.edu-list {
  display: grid;
  gap: 18px;
  margin-bottom: 36px;
}

.edu-item h4 {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.edu-item p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.edu-item .mono {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.award-list {
  display: grid;
  gap: 12px;
}

.award-item {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.award-item strong {
  color: var(--text);
  font-weight: 500;
}

.skills {
  margin-top: clamp(44px, 6vw, 72px);
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.skill-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px 40px;
  align-items: baseline;
}

.skill-grid dt {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  line-height: 1.6;
  text-transform: uppercase;
}

.skill-grid dd {
  color: #bec5bc;
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---------- Contact ---------- */

.contact {
  position: relative;
  border-top: 2px solid var(--green);
  background: var(--paper);
  color: var(--paper-ink);
  padding-block: clamp(72px, 9vw, 120px) 28px;
}

.contact .section-kicker {
  color: var(--paper-muted);
}

.contact .section-kicker::before {
  background: var(--paper-ink);
}

.contact .section-kicker::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 80px;
  background: var(--paper-line);
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 24px;
  padding: 6px 9px;
  border: 1px solid var(--paper-line);
  border-radius: 3px;
  color: var(--paper-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  line-height: 1.5;
  text-transform: uppercase;
}

.availability-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0b8a45;
}

.contact h2 {
  max-width: 14ch;
  margin-bottom: 24px;
  font-family: var(--display);
  font-size: clamp(2.7rem, 6.4vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.94;
  text-wrap: balance;
}

.contact-note {
  max-width: 52ch;
  margin-bottom: 40px;
  color: var(--paper-muted);
  font-size: 16px;
  line-height: 1.6;
}

.contact-email {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  max-width: 100%;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--paper-ink);
  color: var(--paper-ink);
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: color 200ms ease, border-color 200ms ease;
}

.contact-email:hover {
  border-color: #0b6b34;
  color: #0b6b34;
}

.email-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  color: var(--paper-ink);
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}

.contact-email:hover .email-arrow {
  background: var(--paper-ink);
  color: var(--green);
  transform: translate(3px, -3px);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
  margin-top: 32px;
  color: var(--paper-muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.contact-links a {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--paper-line);
  color: var(--paper-ink);
  text-decoration: none;
  transition: border-color 180ms ease;
}

.contact-links a:hover {
  border-color: var(--paper-ink);
}

.contact-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(64px, 10vw, 120px);
  padding-top: 18px;
  border-top: 1px solid var(--paper-line);
  color: var(--paper-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.contact :focus-visible {
  outline-color: #0b6b34;
}

/* ---------- Reveal ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 650ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
    gap: 40px;
  }

  .hero h1 {
    font-size: clamp(2.9rem, 6vw, 5.2rem);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero h1 {
    max-width: 16ch;
    font-size: clamp(3.1rem, 8.4vw, 6rem);
  }

  .hero-photo {
    justify-content: flex-start;
  }

  .photo-frame {
    width: 240px;
    height: 280px;
  }

  .trace-panel {
    width: 100%;
    max-width: 640px;
  }

  .section-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
  }

  .section-intro {
    justify-self: start;
  }

  .approach-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .approach-head {
    position: static;
  }

  .pull-quote {
    max-width: 22ch;
    margin-top: 28px;
  }

  .resume-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px 18px;
    padding-block: 12px;
  }

  .brand {
    margin-right: auto;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    gap: 22px;
    margin-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
  }

  .header-cta {
    margin-left: 0;
  }
}

@media (max-width: 800px) {
  .project {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .project-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
    align-items: start;
  }

  .project-index {
    grid-column: 1 / -1;
    margin-bottom: -4px;
  }

  .status-chip {
    grid-column: 1 / -1;
    justify-self: start;
    margin-bottom: 2px;
  }

  .meta-list {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
  }

  .meta-list div:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .eyebrow {
    align-items: flex-start;
    margin-bottom: 24px;
  }

  .status-dot {
    margin-top: 0.42em;
  }

  .hero {
    padding-block: 48px 72px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 12vw, 4.2rem);
  }

  .hero-greeting {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }

  .hero-photo {
    justify-content: center;
  }

  .photo-frame {
    width: 200px;
    height: 240px;
  }

  .project-image {
    height: 140px;
  }

  .hero-actions .button {
    flex: 1 1 auto;
  }

  .trace-panel {
    padding: 18px;
  }

  .trace-panel::before {
    left: 18px;
  }

  .trace-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .principle {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 22px 0;
  }

  .principle-label {
    padding-top: 0;
  }

  .skill-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .skill-grid dt {
    margin-top: 14px;
  }

  .skill-grid dt:first-of-type {
    margin-top: 0;
  }

  .column-title {
    margin-bottom: 16px;
  }

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

@media (max-width: 520px) {
  .primary-nav {
    gap: 16px;
  }

  .primary-nav a {
    font-size: 9.5px;
  }

  .header-cta {
    padding: 8px 10px;
    font-size: 9px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .project-flow {
    font-size: 9px;
    gap: 6px;
    padding: 9px 10px;
  }

  .contact-email {
    font-size: clamp(1.1rem, 5.6vw, 1.5rem);
    gap: 10px;
  }

  .email-arrow {
    width: 34px;
    height: 34px;
  }

  .contact h2 {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
  }
}

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

  .hero-copy > *,
  .trace-panel {
    animation: none;
  }

  .trace-step.is-active .step-mark {
    animation: none;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
