:root {
  --black: #121813;
  --black-soft: #e9ece8;
  --white: #f8fbf9;
  --paper: #f1f4f2;
  --muted: #4f5a51;
  --line: rgba(18, 24, 19, 0.22);
  --dark-line: rgba(18, 24, 19, 0.22);
  --red: #6f8f7a;
  --red-soft: rgba(111, 143, 122, 0.14);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--black);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 68% 14%, rgba(111, 143, 122, 0.16), transparent 27rem),
    linear-gradient(90deg, rgba(25, 33, 28, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 84px 84px, auto;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(25, 33, 28, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 33, 28, 0.025) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 78%);
}

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

.cursor-orb,
.site-noise {
  display: none;
}

.logic-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.logic-field span {
  position: absolute;
  color: rgba(25, 33, 28, 0.055);
  font-family: var(--mono);
  font-size: clamp(2.2rem, 6vw, 8rem);
  letter-spacing: -0.1em;
}

.logic-field span:nth-child(1) {
  top: 10%;
  right: 10%;
}

.logic-field span:nth-child(2) {
  top: 42%;
  left: 4%;
}

.logic-field span:nth-child(3) {
  right: 9%;
  bottom: 14%;
}

.logic-field span:nth-child(4) {
  left: 42%;
  bottom: 6%;
}

.logic-field span:nth-child(n + 5) {
  display: none;
}

.intro-sequence {
  display: none;
}

.js .intro-sequence {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  color: var(--black);
  background: var(--paper);
}

.intro-robot {
  width: min(60vw, 430px);
  text-align: center;
}

.intro-robot .robot-svg {
  width: 100%;
}

.intro-robot p {
  margin: 16px 0 0;
  color: rgba(8, 8, 6, 0.62);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1280px, calc(100% - 44px));
  margin: 0 auto;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(241, 244, 242, 0.86);
  backdrop-filter: blur(18px);
}

main {
  padding-top: 104px;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0;
  font-family: inherit;
  font-size: 0;
  letter-spacing: 0;
  text-transform: none;
}

.brand-sign {
  width: auto;
  height: 75px;
  opacity: 0.82;
  filter: brightness(0) saturate(100%) contrast(132%);
  transform: translateY(1px);
  pointer-events: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--black);
  border-radius: 50%;
  color: var(--red);
  font-size: 0.75rem;
}

.nav-links {
  gap: clamp(14px, 3vw, 34px);
  color: var(--muted);
  font-size: 0.88rem;
}

.nav-links a {
  transition: color 180ms ease;
}

.nav-links a:hover {
  color: var(--black);
}

.section-shell {
  width: min(1280px, calc(100% - 44px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.34fr);
  gap: clamp(36px, 7vw, 100px);
  min-height: auto;
  align-items: start;
  padding: 34px 0 62px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-title,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.055em;
}

.hero-title {
  max-width: 1060px;
  font-size: clamp(3.8rem, 9.2vw, 9.8rem);
  line-height: 0.86;
}

h2 {
  max-width: 900px;
  font-size: clamp(2rem, 4.5vw, 5.2rem);
  line-height: 0.94;
}

h3 {
  margin: 0;
  font-size: clamp(1.08rem, 1.45vw, 1.45rem);
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 690px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.16vw, 1.08rem);
  line-height: 1.78;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-facts {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin-top: 36px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(248, 251, 249, 0.34);
}

.hero-facts p {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 14px;
  align-items: start;
  color: var(--black);
  font-size: 0.95rem;
  line-height: 1.62;
}

.hero-facts span {
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: var(--white);
  background: var(--black);
  border-color: var(--black);
}

.button.secondary {
  color: var(--black);
  background: transparent;
}

.portrait-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(100%, 360px);
  justify-self: end;
  margin: 0 0 10px;
}

.portrait-card::before {
  position: absolute;
  inset: 18px -18px -18px 18px;
  z-index: -1;
  border: 1px solid rgba(111, 143, 122, 0.45);
  content: "";
}

.portrait-frame {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 5;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(25, 33, 28, 0.08), transparent 48%),
    var(--black-soft);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(18, 24, 19, 0.12);
}

.profile-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.08);
}

.portrait-fallback {
  color: rgba(25, 33, 28, 0.18);
  font-family: var(--serif);
  font-size: clamp(5rem, 13vw, 8rem);
  letter-spacing: -0.1em;
}

.portrait-frame.is-missing .portrait-fallback {
  color: rgba(25, 33, 28, 0.3);
}

.portrait-card figcaption {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portrait-card strong {
  color: var(--black);
  font-size: 0.92rem;
  font-weight: 600;
}

.split-section,
.section-heading {
  display: grid;
  grid-template-columns: 0.44fr 0.56fr;
  gap: clamp(32px, 7vw, 100px);
  align-items: start;
}

.split-section {
  padding: 120px 0;
  border-top: 1px solid var(--line);
}

.body-copy {
  max-width: 720px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.82;
}

.body-copy p {
  margin: 0 0 22px;
}

#experience,
#publications {
  padding: 120px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 48px;
}

.card-index,
.paper-meta {
  display: inline-block;
  margin-bottom: 78px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.paper-card p,
.experience-item p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.experience-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.experience-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 0.25fr) 1fr;
  gap: clamp(20px, 4vw, 64px);
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.experience-item::before {
  position: absolute;
  top: 16px;
  right: 0;
  z-index: 0;
  color: rgba(25, 33, 28, 0.07);
  content: attr(data-short);
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.experience-year {
  position: relative;
  z-index: 1;
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

.experience-item p {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
}

.experience-item h3 {
  position: relative;
  z-index: 1;
}

.paper-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.paper-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 0.26fr) 1fr;
  gap: clamp(24px, 5vw, 80px);
  padding: clamp(30px, 4.6vw, 56px) 0;
  border-bottom: 1px solid var(--line);
}

.paper-card::before {
  position: absolute;
  top: 20px;
  right: 0;
  z-index: 0;
  color: rgba(25, 33, 28, 0.075);
  content: attr(data-type);
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5.4vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.paper-meta {
  margin: 0;
}

.paper-content {
  position: relative;
  z-index: 1;
}

.paper-card h3 {
  max-width: 800px;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.55vw, 2.35rem);
  line-height: 1.08;
}

.paper-card a {
  display: inline-flex;
  margin-top: 22px;
  margin-right: 20px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.84rem;
}

.robot-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}

.svg-orbit,
.svg-wire,
.robot-head,
.robot-jaw,
.robot-mouth,
.logic-arc {
  fill: none;
  stroke: var(--black);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-orbit {
  opacity: 0.22;
  stroke-width: 1;
  stroke-dasharray: 4 14;
}

.svg-orbit-offset {
  opacity: 0.14;
  stroke-dasharray: 2 12;
}

.svg-wire {
  opacity: 0.5;
  stroke-width: 1.4;
}

.robot-head {
  fill: rgba(8, 8, 6, 0.04);
  stroke-width: 1.8;
}

.robot-jaw {
  fill: rgba(111, 143, 122, 0.1);
  stroke-width: 1.4;
}

.robot-eye,
.node {
  fill: var(--red);
}

.robot-mouth {
  stroke-width: 1.8;
}

.logic-arc {
  opacity: 0.28;
  stroke-width: 1.1;
}

.logic-text {
  fill: rgba(8, 8, 6, 0.42);
  font-family: var(--mono);
  font-size: 32px;
}

.js .reveal,
.js .reveal-card {
  opacity: 0;
}

@media (max-width: 960px) {
  .site-header {
    align-items: flex-start;
    gap: 16px;
  }

  .nav-links {
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .hero,
  .split-section,
  .section-heading,
  .paper-card,
  .experience-item {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    align-items: start;
    padding-top: 34px;
  }

  .portrait-card {
    justify-self: start;
    width: min(100%, 320px);
  }

  .hero-facts p {
    grid-template-columns: 1fr;
    gap: 6px;
  }

}

@media (max-width: 620px) {
  body {
    background-size: auto, 64px 64px, auto;
  }

  .site-header,
  .section-shell {
    width: min(100% - 28px, 1280px);
  }

  .brand-sign {
    height: 57px;
    width: auto;
  }

  main {
    padding-top: 90px;
  }

  .nav-links {
    font-size: 0.78rem;
  }

  .hero-title {
    font-size: clamp(3rem, 16vw, 4.6rem);
  }

  #experience,
  #publications,
  .split-section {
    padding: 82px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
