/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Inter Tight";
  src: url("fonts/inter-tight-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #09090b;
  --bg-2: #111114;
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #8b8b94;
  --line: rgba(244, 244, 245, 0.09);
  --accent: #8b5cf6;
  --accent-soft: #a78bfa;

  --font-sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 76rem;
  --header-h: 4rem;
  --section-y: clamp(5rem, 11vw, 9rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
.sprite { position: absolute; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }

::selection { background: rgba(139, 92, 246, 0.4); color: var(--text); }

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.875rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  font-weight: 500;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.88);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header { background: rgba(9, 9, 11, 0.78); backdrop-filter: saturate(140%) blur(10px); }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem; height: 2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0;
  transition: border-color 0.25s var(--ease);
}
.brand__mark span { color: var(--accent); }
.brand:hover .brand__mark { border-color: rgba(139, 92, 246, 0.6); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  font-size: 0.9375rem;
}
.nav a {
  position: relative;
  color: var(--text-2);
  transition: color 0.2s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:not(.nav__icon)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.3rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav a:not(.nav__icon):hover::after { transform: scaleX(1); }
.nav__icon {
  display: inline-grid;
  place-items: center;
  width: 2.25rem; height: 2.25rem;
  margin-right: -0.5rem;
}
.nav__icon:hover { color: var(--accent-soft) !important; }

@media (max-width: 479px) {
  .brand__name { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 7rem) clamp(4rem, 9vw, 7rem);
  overflow: clip;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -20% auto auto;
  width: min(70rem, 120vw);
  aspect-ratio: 1.4;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.14), transparent);
  z-index: -1;
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
}

.eyebrow,
.section__label,
.role__period,
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--accent-soft);
}
.eyebrow::before {
  content: "";
  width: 1.5rem; height: 1px;
  background: currentColor;
}

.hero__name {
  margin-top: 2rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
}
.hero__role {
  display: block;
  color: var(--text-2);
  font-weight: 400;
}

.headline {
  margin-top: 1.5rem;
  font-size: clamp(2.375rem, 1.1rem + 4.6vw, 4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.headline span { display: block; }
.headline__muted { color: var(--text-3); }

.lede {
  margin-top: 2rem;
  max-width: 36rem;
  color: var(--text-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: 2.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3rem;
  padding: 0 1.375rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 550;
  font-size: 0.9375rem;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.button:hover { background: var(--accent); color: #fff; }
.button:active { transform: translateY(1px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  transition: color 0.2s var(--ease);
}
.text-link span { transition: transform 0.3s var(--ease); }
.text-link:hover { color: var(--text); }
.text-link:hover span { transform: translateY(3px); }

/* Portrait */
.portrait {
  position: relative;
  width: 100%;
  max-width: 28rem;
}
.portrait picture {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-2);
  aspect-ratio: 4 / 3;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}
.portrait::after {
  /* Hairline frame and a quiet violet edge. */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
  background: linear-gradient(to top, rgba(9, 9, 11, 0.35), transparent 35%);
  pointer-events: none;
}
.portrait::before {
  content: "";
  position: absolute;
  left: -1px; bottom: -1px;
  width: 3rem; height: 3rem;
  border-left: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  border-bottom-left-radius: 9px;
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 479px) {
  .eyebrow { font-size: 0.6875rem; letter-spacing: 0.08em; }
  .eyebrow::before { display: none; }
}

@media (min-width: 600px) {
  .portrait picture { aspect-ratio: 3 / 4; }
}

@media (min-width: 600px) and (max-width: 959px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) 14rem;
    gap: 2.5rem;
  }
  .portrait { align-self: start; margin-top: 4.5rem; }
}

@media (min-width: 960px) {
  .hero {
    min-height: calc(100svh - var(--header-h));
    display: flex;
    align-items: center;
  }
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
    align-items: center;
    gap: clamp(3rem, 6vw, 6rem);
  }
  .portrait {
    max-width: 25rem;
    justify-self: end;
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--line);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section__label { color: var(--accent-soft); }
.section__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* About */
.about {
  display: grid;
  gap: 2rem;
}
.about__statement {
  max-width: 22ch;
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3rem);
  font-weight: 550;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.about__body {
  display: grid;
  gap: 1.25rem;
  max-width: 38rem;
  color: var(--text-2);
}

@media (min-width: 960px) {
  .about {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(3rem, 6vw, 6rem);
  }
  .about__body { padding-top: 0.5rem; }
}

/* Stats */
.stats {
  display: grid;
  margin-top: clamp(4rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--line);
}
.stat__value {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-size: clamp(3rem, 2rem + 4vw, 5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat__value span {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-3);
}
.stat__label { color: var(--text-2); line-height: 1.5; }

@media (min-width: 720px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
  }
  .stat {
    padding: 2.25rem 2rem 2.25rem 0;
    border-bottom: 0;
  }
  .stat + .stat {
    padding-left: 2rem;
    border-left: 1px solid var(--line);
  }
}

/* Experience */
.timeline { display: grid; }
.role {
  display: grid;
  gap: 0.75rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
}
.role:last-child { border-bottom: 1px solid var(--line); }
.role__period { color: var(--text-3); padding-top: 0.25rem; }
.role--current .role__period { color: var(--accent-soft); }
.role__company {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.role:not(.role--current) { padding-block: 1.5rem; }
.role:not(.role--current) .role__company {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  letter-spacing: -0.02em;
}
.role:not(.role--current) .role__points { margin-top: 0.75rem; }
.role__title {
  margin-top: 0.25rem;
  color: var(--text-2);
}
.role__points {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
  max-width: 40rem;
  color: var(--text-2);
}
.role__points li {
  position: relative;
  padding-left: 1.25rem;
}
.role__points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.8em;
  width: 0.5rem; height: 1px;
  background: var(--accent);
}

@media (min-width: 720px) {
  .role {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 2rem;
    padding-block: 2.5rem;
  }
  .role:not(.role--current) { padding-block: 1.75rem; }
}

/* Closing CTA */
.cta {
  padding-block: var(--section-y);
  border-top: 1px solid var(--line);
}
.cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.cta__title {
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.75rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.875rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem;
}
.site-footer a { transition: color 0.2s var(--ease); }
.site-footer a:hover { color: var(--accent-soft); }

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.reveal { animation: rise 0.9s var(--ease) both; }
.hero__text .reveal:nth-child(2) { animation-delay: 0.06s; }
.hero__text .reveal:nth-child(3) { animation-delay: 0.12s; }
.hero__text .reveal:nth-child(4) { animation-delay: 0.2s; }
.hero__text .reveal:nth-child(5) { animation-delay: 0.28s; }
.portrait.reveal { animation-delay: 0.18s; animation-duration: 1.1s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
