:root {
  --ink: #0c0b0a;
  --ink-2: #131210;
  --ink-3: #1a1815;
  --paper: #f3ede4;
  --paper-dim: #d6cec2;
  --muted: #a39b8f;
  --faint: #736c62;
  --ember: #e36b3d;
  --ember-soft: rgba(227, 107, 61, 0.12);
  --line: rgba(243, 237, 228, 0.13);
  --line-strong: rgba(243, 237, 228, 0.28);
  --font-sans: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --nav-h: 68px;
  --r-card: 16px;
  --r-field: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(90rem 50rem at 92% -12%, rgba(227, 107, 61, 0.1), transparent 55%),
    var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

img {
  max-width: 100%;
  display: block;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 120;
  background: var(--paper);
  color: var(--ink);
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-weight: 500;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.15rem, 4vw, 2.25rem);
}

/* Navigation */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(12, 11, 10, 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.15rem, 4vw, 2.25rem);
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--paper);
  padding: 0.35rem 0;
}

.wordmark::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--ember);
  vertical-align: 0.12em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.6vw, 1.6rem);
}

.nav-link {
  position: relative;
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.01em;
  padding: 0.35rem 0;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--paper);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-cv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.25s ease, transform 0.25s var(--ease);
}

.nav-cv:hover {
  background: var(--ember);
}

.nav-cv:active {
  transform: translateY(1px);
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--paper);
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Hero */
.hero {
  padding-top: calc(var(--nav-h) + clamp(1.25rem, 4vh, 2.5rem));
  padding-bottom: clamp(2rem, 4vh, 3.25rem);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: min(760px, calc(100dvh - var(--nav-h)));
}

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

.hero-sub {
  overflow-wrap: break-word;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(1.1rem, 2.4vh, 1.6rem);
}

.status-dot,
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 0 rgba(227, 107, 61, 0.45);
  animation: pulse 2.4s ease-out infinite;
  flex: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(227, 107, 61, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(227, 107, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(227, 107, 61, 0); }
}

.hero h1 {
  font-size: clamp(2.7rem, 5.7vw, 4.85rem);
  line-height: 0.99;
  letter-spacing: -0.048em;
  font-weight: 500;
  max-width: 12ch;
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--ember);
}

.hero h1 .scramble {
  display: inline-block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.hero-sub {
  margin-top: clamp(1.15rem, 2.5vh, 1.6rem);
  max-width: 47ch;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  line-height: 1.68;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: clamp(1.6rem, 3.5vh, 2.25rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ember);
  color: #160f0b;
}

.btn-primary:hover {
  background: #f07a4a;
}

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

.btn-ghost:hover {
  border-color: var(--paper);
  background: rgba(243, 237, 228, 0.04);
}

.hero-media {
  width: 100%;
  max-width: 460px;
  justify-self: end;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 50% 50% var(--r-card) var(--r-card) / 42% 42% var(--r-card) var(--r-card);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--ink-3);
  box-shadow:
    0 36px 70px -38px rgba(227, 107, 61, 0.32),
    0 24px 50px -35px rgba(0, 0, 0, 0.9);
  animation: levitate 7s ease-in-out infinite;
  will-change: transform;
}

@keyframes levitate {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(243, 237, 228, 0.28);
  border-radius: inherit;
  pointer-events: none;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;
  filter: saturate(0.94) contrast(1.02);
}

.portrait-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Marquee */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0;
  background: rgba(243, 237, 228, 0.015);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: max-content;
  animation: marquee 48s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.marquee-track span:nth-child(even) {
  color: var(--ember);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Sections */
.section {
  padding: clamp(4.25rem, 8.5vw, 7.5rem) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head h2 {
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  line-height: 1.03;
  letter-spacing: -0.042em;
  font-weight: 500;
  text-wrap: balance;
}

.section-head p {
  margin-top: 1.05rem;
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.1vw, 1.04rem);
  line-height: 1.7;
}

.section-head a {
  color: var(--paper);
  border-bottom: 1px solid var(--ember);
}

.section-head a:hover {
  color: var(--ember);
}

/* About */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: clamp(1.15rem, 2.2vw, 1.65rem) clamp(0.9rem, 1.8vw, 1.35rem);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat:last-child {
  border-right: 0;
}

.stat-value {
  font-size: clamp(2rem, 3.5vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.45;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

.about-copy p {
  color: var(--paper-dim);
  font-size: clamp(0.96rem, 1.1vw, 1.04rem);
  line-height: 1.75;
  max-width: 64ch;
}

.about-copy p + p {
  margin-top: 1rem;
}

.about-copy a {
  color: var(--ember);
  border-bottom: 1px solid rgba(227, 107, 61, 0.4);
}

.about-personal {
  margin-top: 1.4rem !important;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.66rem !important;
  line-height: 1.7 !important;
  letter-spacing: 0.01em;
  color: var(--faint) !important;
}

.now-card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--ink-2);
  padding: clamp(1.2rem, 2.4vw, 1.65rem);
  align-self: start;
}

.now-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.now-handle {
  margin-left: auto;
  color: var(--paper-dim);
}

.now-list {
  margin-top: 0.25rem;
}

.now-list div {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.now-list div:last-child {
  border-bottom: 0;
}

.now-list dt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.now-list dd {
  margin-top: 0.2rem;
  font-size: 0.92rem;
  color: var(--paper-dim);
}

.text-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember);
}

.text-link:hover {
  color: var(--paper);
}

/* Expertise */
.expertise-list {
  list-style: none;
  border-top: 1px solid var(--line);
}

.expertise-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(240px, 0.72fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
  padding: clamp(1.5rem, 3vw, 2.2rem) 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}

.expertise-item:hover {
  background: rgba(243, 237, 228, 0.02);
}

.exp-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ember);
  letter-spacing: 0.08em;
  padding-top: 0.4rem;
}

.exp-main h3 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.exp-main p {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
  max-width: 56ch;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  align-content: flex-start;
}

.exp-tags span,
.project-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: 1.16fr 0.84fr;
  grid-auto-rows: minmax(0, auto);
  gap: 1.1rem;
}

.project {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--ink-2);
  padding: clamp(1.25rem, 2.4vw, 1.85rem);
  transition: border-color 0.3s ease, transform 0.4s var(--ease), background 0.3s ease;
}

.project:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.project-featured {
  grid-row: span 2;
  padding: clamp(1.5rem, 3vw, 2.35rem);
  background:
    radial-gradient(38rem 22rem at 100% 0%, rgba(227, 107, 61, 0.09), transparent 70%),
    var(--ink-2);
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-kicker {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-arrow {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ember);
  transition: transform 0.3s var(--ease), color 0.25s ease;
}

.project-arrow:hover {
  color: var(--paper);
  transform: translate(2px, -2px);
}

.project h3 {
  margin-top: clamp(1rem, 2vw, 1.4rem);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 500;
}

.project-featured h3 {
  font-size: clamp(1.85rem, 3.3vw, 2.6rem);
}

.project p {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.project-lead {
  max-width: 55ch;
}

.cve-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: clamp(1.2rem, 2.5vw, 1.8rem) 0;
  border-top: 1px solid var(--line);
}

.cve-list li {
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.cve-list li:nth-child(odd) {
  padding-right: 1rem;
}

.cve-list li span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ember);
  letter-spacing: 0.04em;
}

.project-foot {
  margin-top: auto;
  padding-top: clamp(1rem, 2vw, 1.5rem);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.repo-stats {
  display: flex;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.repo-stats span:empty {
  display: none;
}

/* Certificates */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.cert-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--ink-2);
  transition: border-color 0.3s ease, transform 0.4s var(--ease);
}

.cert-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.cert-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--ink-3);
}

.cert-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  transition: transform 0.6s var(--ease);
}

.cert-card:hover .cert-thumb img {
  transform: scale(1.035);
}

.cert-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.05rem 1.15rem;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.cert-body h3 {
  margin: 0.4rem 0 0.9rem;
  font-size: 0.98rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 500;
}

.cert-link {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ember);
}

.cert-card-text {
  justify-content: space-between;
  background: var(--ember);
  color: #17100c;
  border-color: var(--ember);
  padding: 1.15rem;
  min-height: 100%;
}

.cert-card-text .cert-issuer {
  color: rgba(23, 16, 12, 0.62);
}

.cert-card-text .cert-link-static {
  color: #17100c;
}

.cert-mark {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.08em;
  font-weight: 500;
}

.cert-card-text .cert-body {
  padding: 0;
}

/* Experience */
.experience-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.timeline {
  border-left: 1px solid var(--line);
  margin-left: 0.35rem;
}

.tl-item {
  position: relative;
  padding: 0 0 clamp(1.75rem, 3.5vw, 2.5rem) clamp(1.4rem, 3vw, 2rem);
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.42rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 4px var(--ink);
}

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.tl-body h3 {
  margin-top: 0.35rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.org {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--ember);
}

.tl-body ul {
  margin-top: 0.9rem;
  padding-left: 1.05rem;
}

.tl-body li {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.35rem;
}

.tl-body li::marker {
  color: var(--faint);
}

.edu-card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--ink-2);
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
}

.edu-block + .edu-block {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.edu-kicker {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
}

.edu-block h3 {
  margin-top: 0.45rem;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.edu-block p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.edu-meta {
  font-family: var(--font-mono);
  font-size: 0.66rem !important;
  letter-spacing: 0.03em;
}

.edu-list {
  list-style: none;
  margin-top: 0.6rem;
}

.edu-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0;
  font-size: 0.84rem;
  color: var(--paper-dim);
}

.edu-list li:last-child {
  border-bottom: 0;
}

.edu-list span {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember);
  white-space: nowrap;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.contact-copy h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 500;
  max-width: 14ch;
  text-wrap: balance;
}

.contact-copy > p {
  margin-top: 1.15rem;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.contact-list {
  list-style: none;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
}

.contact-list li {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.contact-list li > span:first-child {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 0.2rem;
}

.contact-list a {
  overflow-wrap: anywhere;
  color: var(--paper-dim);
}

.contact-list a:hover {
  color: var(--ember);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-top: 1.6rem;
}

.social-links a {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.25rem;
  transition: color 0.25s ease, border-color 0.25s ease;
}

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

.contact-form {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--ink-2);
  padding: clamp(1.2rem, 2.6vw, 1.85rem);
}

.field {
  margin-bottom: 1.05rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  background: #0a0908;
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  color: var(--paper);
  font-size: 0.93rem;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field textarea {
  resize: vertical;
  min-height: 128px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(227, 107, 61, 0.14);
}

.contact-form .btn {
  width: 100%;
  margin-top: 0.25rem;
}

.form-note {
  margin-top: 0.8rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--faint);
  text-align: center;
}

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 1.9rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-mark {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ember);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.visitor-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.visitor-count .live-dot {
  width: 5px;
  height: 5px;
}

.visitor-count b {
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--paper-dim);
  font-variant-numeric: tabular-nums;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
}

.footer a {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

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

/* Scroll reveal */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr 0.9fr;
    gap: 2.5rem;
  }

  .expertise-item {
    grid-template-columns: 48px minmax(0, 1fr) minmax(200px, 0.6fr);
    gap: 1.25rem;
  }

  .about-grid,
  .experience-grid {
    gap: 2.5rem;
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    min-height: 0;
  }

  .hero-copy {
    max-width: 640px;
  }

  .hero h1 {
    max-width: 14ch;
  }

  .hero-media {
    justify-self: start;
    max-width: 430px;
    width: 100%;
  }

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

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

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

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

  .project-featured {
    grid-row: auto;
  }

  .cve-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    height: calc(100dvh - var(--nav-h));
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 1.5rem clamp(1.15rem, 5vw, 2rem) 2.5rem;
    background: var(--ink);
    border-top: 1px solid var(--line);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }

  .nav-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-link {
    font-size: 1.35rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    color: var(--paper-dim);
  }

  .nav-link::after {
    display: none;
  }

  .nav-cv {
    margin-top: 1.35rem;
    min-height: 50px;
    font-size: 0.9rem;
  }

  body.menu-open {
    overflow: hidden;
  }

  .expertise-item {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.5rem 1rem;
  }

  .exp-tags {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 0.5rem;
  }

  .cert-grid {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * clamp(1.15rem, 4vw, 2.25rem));
    padding: 0 clamp(1.15rem, 4vw, 2.25rem) 0.85rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }

  .cert-card {
    flex: 0 0 min(78vw, 320px);
    scroll-snap-align: start;
  }

  .certs .section-head::after {
    content: "Swipe to browse";
    display: block;
    margin-top: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
  }
}

@media (max-width: 620px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .hero-media {
    max-width: 100%;
  }

  .portrait-caption {
    font-size: 0.56rem;
  }

  .cve-list {
    grid-template-columns: 1fr;
  }

  .cve-list li:nth-child(odd) {
    padding-right: 0;
  }

  .project-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .tl-body ul {
    padding-left: 0.9rem;
  }

  .contact-list li {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.7rem;
  }

  .footer p {
    order: 3;
  }

  .footer-meta {
    order: 2;
    flex-direction: column;
    gap: 0.55rem;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 2.45rem;
  }

  .stat {
    padding: 1rem 0.7rem;
  }

  .cert-card {
    flex-basis: 84vw;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
  }

  .portrait-frame {
    animation: none;
  }
}
