:root {
  --bg: #0e1116;
  --surface: #161b22;
  --rule: #262e38;
  --text: #e6e9ec;
  --text-dim: #8d97a3;
  --accent: #5fbcd3;
  --accent-warm: #e2a03f;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --max-width: 1200px;
  --max-width-wide: 70vw;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(20px, 5vw, 64px);
  background: rgba(14, 17, 22, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 13px;
}

.topbar__mark {
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.topbar__mark:hover {
  text-decoration: none;
  color: var(--accent);
}

.topbar__links {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
}

.topbar__links a {
  color: var(--text-dim);
}

.topbar__links a:hover,
.topbar__links a:focus-visible {
  color: var(--accent);
}

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

.hero {
  position: relative;
  overflow: hidden;
  min-height: 780px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--rule);
}

.hero__wallpaper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 80%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(14, 17, 22, 0.15) 0%,
    rgba(14, 17, 22, 0.5) 60%,
    rgba(14, 17, 22, 0.75) 100%
  );
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  width: 100%;
  padding: clamp(48px, 8vw, 80px) clamp(20px, 5vw, 64px) clamp(40px, 6vw, 64px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 18px;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.hero__statement {
  max-width: 75ch;
  color: rgba(230, 233, 236, 0.85);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 28px;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.hero__links a {
  color: var(--accent-warm);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}

.hero__links a:hover,
.hero__links a:focus-visible {
  color: var(--accent-warm);
  border-color: var(--accent-warm);
  text-decoration: none;
}

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

.hero__quote {
  position: absolute;
  bottom: clamp(40px, 6vw, 64px);
  right: clamp(20px, 5vw, 64px);
  z-index: 2;
  text-align: right;
  max-width: 50ch;
}

.hero__quote blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  font-style: italic;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.hero__quote cite {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  color: var(--accent-warm);
  letter-spacing: 0.04em;
}

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

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 76px) clamp(20px, 5vw, 24px);
  border-bottom: 1px solid var(--rule);
}

#bio.section {
  max-width: var(--max-width-wide);
  text-align: left;
  margin: 0 0 0 clamp(20px, 5vw, 64px);
}

.section__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 28px;
}

.section__body p {
  color: var(--text-dim);
}

#bio .section__body p {
  max-width: 100%;
}

.section__body p a {
  color: var(--accent);
}

.placeholder {
  color: var(--accent-warm);
  font-style: italic;
}

/* ---------- Publications ---------- */

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pub {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.pub:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 8px;
  line-height: 1.4;
}

.pub__meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 0 0 10px;
}

.pub__meta em {
  font-style: normal;
  color: var(--accent);
}

.pub__links {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ---------- Projects ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.project {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.project__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--accent-warm);
  margin: 0 0 12px;
}

.project__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 10px;
}

.project__desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  flex-grow: 1;
  margin: 0 0 16px;
}

.project__links {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ---------- CFD Results Carousel ---------- */

.section__intro {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: -16px 0 28px;
}

.carousel {
  position: relative;
  overflow: hidden;
}

.carousel__track {
  display: flex;
  transition: transform 0.4s ease;
}

.carousel__slide {
  min-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.carousel__slide img,
.carousel__slide video {
  width: 100%;
  max-width: 100%;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  display: block;
}

.carousel__slide img {
  height: 700px;
}

.carousel__slide figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 10px;
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  background: rgba(14, 17, 22, 0.75);
  border: 1px solid var(--rule);
  color: var(--text);
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.carousel__btn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.carousel__btn--prev { left: 8px; }
.carousel__btn--next { right: 8px; }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--rule);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.carousel__dot--active {
  background: var(--accent);
}

/* ---------- Footer ---------- */

.footer {
  padding: 32px clamp(20px, 5vw, 64px) 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}