:root {
  --black: #000;
  --white: #fff;
  --grey: #6b6b6b;
  --grey-light: #e5e5e5;
  --grey-dark: #8a8a8a;
  --line: #000;
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: 16px;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--mono); }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
::selection { background: var(--black); color: var(--white); }
.section--dark ::selection { background: var(--white); color: var(--black); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--black); color: var(--white); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.nav__logo { font-family: var(--mono); font-weight: 700; text-decoration: none; letter-spacing: .04em; }
.cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav__links { display: flex; gap: 22px; font-family: var(--mono); font-size: 14px; }
.nav__links a { text-decoration: none; padding: 2px 0; border-bottom: 1px solid transparent; }
.nav__links a:hover, .nav__links a.is-current { border-bottom-color: currentColor; }
@media (max-width: 720px) {
  .nav__links { gap: 14px; font-size: 12px; overflow-x: auto; }
  .nav__links li:nth-child(4) { display: none; }
}
@media (max-width: 420px) { .nav__links li:nth-child(3) { display: none; } }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: end;
  padding-top: 72px; padding-bottom: 64px;
}
.label { font-family: var(--mono); font-size: 14px; color: var(--grey); margin-bottom: 18px; }
.hero__name {
  font-size: clamp(42px, 8vw, 104px);
  letter-spacing: -.035em; line-height: .95;
  overflow-wrap: anywhere;
}
.hero__role { margin-top: 28px; font-size: clamp(17px, 2vw, 21px); max-width: 720px; }
.sep { color: var(--grey); padding: 0 .5em; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; font-size: 13px; color: var(--grey); }
.status { color: var(--black); display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--black); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  font-family: var(--mono); font-size: 14px; font-weight: 500; text-decoration: none;
  padding: 13px 22px; border: 1.5px solid var(--black);
  transition: background .2s, color .2s;
}
.btn:hover, .btn--solid { background: var(--black); color: var(--white); }
.btn--solid:hover { background: var(--white); color: var(--black); }

.hero__photo { margin: 0; width: 257px; }
.hero__photo img {
  width: 100%; height: auto;
  filter: grayscale(1) contrast(1.08);
  border: 1.5px solid var(--black);
  box-shadow: 10px 10px 0 var(--black);
  transition: filter .5s;
}
.hero__photo:hover img { filter: grayscale(0); }
.hero__photo figcaption { font-size: 12px; color: var(--grey); margin-top: 18px; text-align: right; }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
  .hero__photo { order: -1; width: 180px; }
  .hero__photo figcaption { text-align: left; }
}

/* ---------- Stats ---------- */
.stats { background: var(--black); color: var(--white); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 34px 20px 34px 0; border-right: 1px solid #333; display: flex; flex-direction: column; gap: 8px; }
.stat + .stat { padding-left: 20px; }
.stat:last-child { border-right: 0; }
.stat__num { font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat__label { font-family: var(--mono); font-size: 12px; color: var(--grey-dark); max-width: 22ch; }
@media (max-width: 820px) {
  .stats__grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 24px 12px 24px 0; border-bottom: 1px solid #333; }
  .stat + .stat { padding-left: 0; }
  .stat:nth-child(even) { padding-left: 14px; border-right: 0; }
  .stat:nth-child(n+3) { border-bottom: 0; }
}

/* ---------- Sections ---------- */
.section { padding-top: 96px; padding-bottom: 96px; }
.section--dark { background: var(--black); color: var(--white); }
.section__title {
  font-size: clamp(32px, 5vw, 56px); letter-spacing: -.03em;
  padding-bottom: 18px; margin-bottom: 48px;
  border-bottom: 1px solid currentColor;
}
.section__title .mono { font-size: .4em; font-weight: 400; color: var(--grey); vertical-align: middle; margin-right: .4em; }
@media (max-width: 720px) { .section { padding-top: 64px; padding-bottom: 64px; } .section__title { margin-bottom: 32px; } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; }
.about__lead { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; letter-spacing: -.02em; font-weight: 500; }
.about__body p + p { margin-top: 1em; }
.about__body { color: #222; }
@media (max-width: 820px) { .about { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.chip {
  font: inherit; font-size: 13px; cursor: pointer;
  background: transparent; color: var(--white);
  border: 1px solid var(--white); padding: 8px 16px;
  transition: background .2s, color .2s;
}
.chip:hover, .chip.is-active { background: var(--white); color: var(--black); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #333; border-left: 1px solid #333; }
.card {
  padding: 28px 24px; border-right: 1px solid #333; border-bottom: 1px solid #333;
  display: flex; flex-direction: column; gap: 14px;
  transition: background .25s, color .25s;
}
.card:hover { background: var(--white); color: var(--black); }
.card:hover .card__meta, .card:hover p:not(.card__impact) { color: var(--grey); }
.card:hover .tags li { border-color: var(--black); }
.card[hidden] { display: none; }
.card__meta { font-size: 12px; color: var(--grey-dark); }
.card h3 { font-size: 22px; letter-spacing: -.015em; }
.card p { font-size: 15px; color: #c8c8c8; }
.card__impact { font-family: var(--mono); font-size: 13px !important; color: inherit !important; font-weight: 500; }
.card__impact::before { content: "→ "; }
.card .tags { margin-top: auto; padding-top: 6px; }
@media (max-width: 980px) { .projects { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .projects { grid-template-columns: 1fr; } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.tags li { border: 1px solid currentColor; padding: 3px 9px; white-space: nowrap; }
.tags li::before { content: "[ "; color: var(--grey); }
.tags li::after { content: " ]"; color: var(--grey); }
.card .tags li { border-color: #444; }

/* ---------- Experience ---------- */
.timeline { border-left: 1.5px solid var(--black); margin-left: 4px; }
.job { position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 0 0 48px 32px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px; background: var(--white); border: 1.5px solid var(--black);
}
.job:first-child::before { background: var(--black); }
.job__date { font-size: 13px; color: var(--grey); padding-top: 4px; }
.job h3 { font-size: 24px; letter-spacing: -.015em; }
.job__org { font-size: 13px; color: var(--grey); margin: 6px 0 14px; }
.job ul li { position: relative; padding-left: 20px; margin-top: 6px; font-size: 16px; }
.job ul li::before { content: "—"; position: absolute; left: 0; color: var(--grey); }
@media (max-width: 720px) { .job { grid-template-columns: 1fr; gap: 6px; padding-left: 22px; } }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; }
.skill h3 { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--grey-dark); margin-bottom: 16px; }
.skill .tags li { border-color: #555; }
@media (max-width: 900px) { .skills { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .skills { grid-template-columns: 1fr; } }

/* ---------- Education ---------- */
.edu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--black); }
.edu__item { padding: 24px 24px 0 0; }
.edu__item + .edu__item { padding-left: 24px; border-left: 1px solid var(--grey-light); }
.edu h3 { font-size: 22px; margin-top: 10px; letter-spacing: -.015em; }
.langs { margin-top: 10px; }
.langs li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grey-light); font-size: 18px; font-weight: 500; }
.langs .mono { font-size: 12px; color: var(--grey); font-weight: 400; align-self: center; }
@media (max-width: 820px) {
  .edu { grid-template-columns: 1fr; }
  .edu__item, .edu__item + .edu__item { padding: 22px 0; border-left: 0; border-bottom: 1px solid var(--grey-light); }
}

/* ---------- Contact ---------- */
.contact__big { font-size: clamp(34px, 6vw, 72px); font-weight: 700; letter-spacing: -.035em; line-height: 1; margin-bottom: 48px; }
.contact__list li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid #333; font-size: 15px; }
.contact__list li > span:first-child { color: var(--grey-dark); }
.contact__list a { text-decoration: none; border-bottom: 1px solid currentColor; overflow-wrap: anywhere; }
.contact__list a:hover { background: var(--white); color: var(--black); }
@media (max-width: 560px) { .contact__list li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Footer ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 28px; font-size: 12px; color: var(--grey); }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--black); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
