/* ───────────────────────── Fonts ───────────────────────── */
@font-face { font-family: "Inter Tight"; src: url("/fonts/inter-tight-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --bg: #ecefef;
  --bg-2: #e1e6e6;
  --ink: #0c0d12;
  --muted: #676b7a;
  --line: rgba(12, 13, 18, 0.12);
  --accent: #0b8278;
  --accent-ink: #ffffff;
  --dark: #0c0d12;
  --dark-2: #15171f;
  --dark-ink: #ecefef;
  --dark-muted: #8d91a1;
  --dark-line: rgba(236, 238, 244, 0.14);

  --radius: 22px;
  --radius-lg: 32px;
  --pad: clamp(1.1rem, 3vw, 2.5rem);
  --maxw: 1600px;

  --f-display: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Plex Mono", ui-monospace, Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ───────────────────────── Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 1rem; z-index: 100; }
.skip:focus { left: 1rem; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 999px; }

.label {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.dark .label { color: var(--dark-muted); }

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

/* ───────────────────────── Pills ───────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: .65rem;
  height: 46px; padding: 0 1.25rem;
  border-radius: 999px;
  font-family: var(--f-display); font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  transition: transform .4s var(--ease), background-color .3s, color .3s;
  white-space: nowrap;
}
.pill:hover { transform: translateY(-2px); }
.pill--dark { background: var(--ink); color: var(--bg); }
.pill--light { background: rgba(255, 255, 255, 0.72); color: var(--ink); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pill--outline { border: 1px solid var(--line); }
.pill--outline:hover { background: var(--ink); color: var(--bg); }
.pill--accent { background: var(--accent); color: var(--accent-ink); }
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; transition: transform .4s var(--ease); }
.pill:hover .pill__dot { transform: scale(1.6); }
.pill__dots { display: inline-flex; gap: 4px; }
.pill__dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; transition: transform .4s var(--ease); }
[aria-expanded="true"] .pill__dots i:first-child { transform: translateX(4.5px); }
[aria-expanded="true"] .pill__dots i:last-child { transform: translateX(-4.5px); }

/* ───────────────────────── Header ───────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--pad);
  pointer-events: none;
  transition: transform .6s var(--ease);
}
.nav > * { pointer-events: auto; }
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo { display: inline-flex; align-items: center; gap: .7rem; font-family: var(--f-display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); transition: color .4s; }
.nav__mark { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 9px 0 0 -2px currentColor; margin-right: 8px; transition: box-shadow .4s; }
.nav--on-dark .nav__logo { color: var(--dark-ink); }
.nav__actions { display: flex; gap: .5rem; }
.menu-open .nav__logo { color: var(--dark-ink); }

/* ───────────────────────── Menu overlay ───────────────────────── */
.menu {
  position: fixed; inset: 0; z-index: 40;
  background: var(--dark); color: var(--dark-ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--pad) + 70px) var(--pad) var(--pad);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .8s var(--ease);
  visibility: hidden;
}
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; }
.menu__links { display: flex; flex-direction: column; }
.menu__links a {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 7.5rem); line-height: 1.02; letter-spacing: -0.045em;
  display: flex; align-items: baseline; gap: 1.2rem;
  border-bottom: 1px solid var(--dark-line);
  padding: .15em 0;
  transform: translateY(40px); opacity: 0;
  transition: transform .9s var(--ease), opacity .9s var(--ease), color .3s, padding .4s var(--ease);
}
.menu__links a span { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; color: var(--dark-muted); }
.menu__links a:hover { color: var(--accent); padding-left: .6rem; }
.menu.is-open .menu__links a { transform: none; opacity: 1; }
.menu.is-open .menu__links a:nth-child(2) { transition-delay: .05s; }
.menu.is-open .menu__links a:nth-child(3) { transition-delay: .1s; }
.menu.is-open .menu__links a:nth-child(4) { transition-delay: .15s; }
.menu.is-open .menu__links a:nth-child(5) { transition-delay: .2s; }
.menu__foot { display: flex; justify-content: space-between; }

/* ───────────────────────── Hero ───────────────────────── */
.hero {
  position: relative; height: 100svh; min-height: 620px; padding: 0;
  overflow: hidden;
  background:
    radial-gradient(60% 60% at 70% 45%, #f7f9f9 0%, rgba(247, 249, 249, 0) 70%),
    var(--bg);
}
.hero.no-webgl::after {
  content: ""; position: absolute; width: 46vmin; aspect-ratio: 1; right: 12%; top: 26%;
  border-radius: 48% 52% 46% 54%;
  background: radial-gradient(circle at 35% 30%, #8eeadf, var(--accent) 45%, #04403b 100%);
  animation: blob 9s ease-in-out infinite;
}
@keyframes blob { 50% { border-radius: 56% 44% 58% 42%; transform: scale(1.04) rotate(8deg); } }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__canvas { touch-action: pan-y; }
.hero__arena { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__lines { fill: none; stroke: rgba(12, 13, 18, 0.42); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.hero.no-webgl .hero__arena { display: none; }
.hero__content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--pad);
  pointer-events: none;
}
.hero__kicker { margin-bottom: 1.6rem; }
.hero__title {
  margin: 0;
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(3.2rem, 10.5vw, 11rem);
  line-height: .9; letter-spacing: -0.055em;
}
.hero__bar {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: var(--pad);
}
.hero__sync b { font-weight: 400; color: var(--ink); display: inline-block; min-width: 3.2em; }
.hero__scroll span { display: inline-block; animation: nudge 2s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* line-by-line reveal for big titles */
.line { display: block; overflow: hidden; padding-bottom: .04em; }
.line > span { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--ease); }
.is-in .line > span { transform: none; }
.is-in .line:nth-child(2) > span { transition-delay: .08s; }
.is-in .line:nth-child(3) > span { transition-delay: .16s; }

/* generic reveal */
[data-reveal]:not(.hero__title):not(.cta__title) { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
[data-reveal].is-in:not(.hero__title):not(.cta__title) { opacity: 1; transform: none; }

/* ───────────────────────── Sections ───────────────────────── */
section, .cta { padding: clamp(5rem, 12vw, 10rem) var(--pad); }
.dark { background: var(--dark); color: var(--dark-ink); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: clamp(2rem, 5vw, 4rem); }
.section-title { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: clamp(2.2rem, 6vw, 5.5rem); letter-spacing: -0.045em; line-height: 1; }
.section-count { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

/* intro */
.intro { max-width: var(--maxw); }
.intro__text {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.8rem, 4.4vw, 4.4rem); line-height: 1.05; letter-spacing: -0.04em;
  max-width: 22ch; margin: 1.5rem 0 2.5rem;
}
.intro__actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* work grid */
.work__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.2vw, 2rem); }
.card { display: flex; flex-direction: column; gap: 1.1rem; }
.card:nth-child(even) { margin-top: clamp(0rem, 8vw, 8rem); }
.card__media {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden;
  background:
    radial-gradient(50% 60% at var(--mx, 30%) var(--my, 35%), hsl(var(--hue) 100% 72% / .95), transparent 70%),
    radial-gradient(60% 70% at 75% 75%, hsl(calc(var(--hue) + 12) 90% 45% / .9), transparent 70%),
    linear-gradient(135deg, hsl(var(--hue) 60% 14%), hsl(calc(var(--hue) + 20) 70% 8%));
  transition: transform .9s var(--ease), border-radius .9s var(--ease);
}
.card__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card:hover .card__media { transform: scale(.985); border-radius: calc(var(--radius-lg) + 14px); }
.card__index { position: absolute; left: 1.2rem; top: 1rem; font-family: var(--f-mono); font-size: 12px; color: rgba(255,255,255,.8); z-index: 1; }
.card__body h3 { margin: 0 0 .35rem; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.5rem, 2.4vw, 2.2rem); letter-spacing: -0.035em; line-height: 1.05; }
.card__body p { margin: 0; color: var(--muted); max-width: 46ch; }
.card__body .tags { margin-top: .7rem; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }

/* marquee */
.marquee { padding: 1.5rem 0 !important; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.marquee__track { display: flex; width: max-content; gap: 1.6rem; align-items: center; animation: marquee 38s linear infinite; }
.marquee__track span { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.2rem, 2.2vw, 2rem); letter-spacing: -0.03em; white-space: nowrap; }
.marquee__track i { font-style: normal; color: var(--accent); font-size: 1rem; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* about */
.about__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 6vw, 6rem); margin-bottom: clamp(3rem, 8vw, 7rem); }
.about__title { margin: 1.4rem 0 0; font-family: var(--f-display); font-weight: 500; font-size: clamp(2.4rem, 5.6vw, 5.6rem); letter-spacing: -0.05em; line-height: .98; }
.about__text p { color: #c9ccd8; font-size: clamp(1.05rem, 1.4vw, 1.25rem); margin: 0 0 1.2rem; max-width: 52ch; }
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--dark-line); }
.timeline li { display: grid; grid-template-columns: 12rem 1fr auto; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--dark-line); align-items: baseline; }
.timeline__year { font-family: var(--f-mono); font-size: 13px; color: var(--dark-muted); }
.timeline__what { font-family: var(--f-display); font-size: clamp(1.2rem, 2vw, 1.7rem); letter-spacing: -0.03em; }
.timeline__where { color: var(--dark-muted); }

/* publications */
.pubs__list, .talks__list { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 6rem 1fr 13rem; gap: 1.5rem; padding: 1.6rem 0; border-bottom: 1px solid var(--line); align-items: baseline; transition: padding .5s var(--ease), background-color .4s; }
.pub:hover { padding-left: .8rem; padding-right: .8rem; background: rgba(255,255,255,.55); border-radius: 14px; }
.pub__year { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.pub__main a, .pub__title { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.15rem, 1.9vw, 1.6rem); letter-spacing: -0.03em; line-height: 1.15; display: block; }
.pub__main a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.pub__main a:hover { background-size: 100% 1px; }
.pub__main a::after { content: " ↗"; color: var(--accent); }
.pub__main p { margin: .45rem 0 0; color: var(--muted); font-size: 15px; }
.pub__main b { color: var(--ink); font-weight: 600; }
.pub__venue { justify-self: end; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; white-space: nowrap; }

/* talks */
.talks__list li { display: grid; grid-template-columns: 6rem 1.2fr 1.5fr 10rem; gap: 1.5rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.talks__list li > span:first-child { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.talks__list b { font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; letter-spacing: -0.02em; }
.talks__list li > span:nth-child(3) { color: var(--muted); }
.talks__list li > span:last-child { justify-self: end; color: var(--muted); }

/* contact / footer */
.cta { border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin-top: -1px; }
.cta__title { margin: 1.5rem 0 3rem; font-family: var(--f-display); font-weight: 500; font-size: clamp(3rem, 10vw, 10.5rem); line-height: .9; letter-spacing: -0.055em; }
.cta__mail { height: 58px; padding: 0 1.8rem; font-size: 17px; }
.cta__foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: clamp(4rem, 10vw, 8rem); padding-top: 1.5rem; border-top: 1px solid var(--dark-line); }

/* ───────────────────────── Cursor ───────────────────────── */
.cursor { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity .3s; }
.cursor.is-active { opacity: 1; }
.cursor span {
  display: grid; place-items: center;
  width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff; color: #000;
  font-family: var(--f-mono); font-size: 0; text-transform: uppercase; letter-spacing: .04em;
  transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease), font-size .2s;
}
.cursor.is-link span { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.cursor.is-view { mix-blend-mode: normal; }
.cursor.is-view span { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--accent); color: #fff; font-size: 12px; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 860px) {
  .work__grid { grid-template-columns: 1fr; }
  .card:nth-child(even) { margin-top: 0; }
  .about__grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: .2rem; }
  .pub { grid-template-columns: 1fr; gap: .4rem; }
  .pub__venue { justify-self: start; }
  .talks__list li { grid-template-columns: 4rem 1fr; }
  .talks__list li > span:nth-child(3), .talks__list li > span:last-child { grid-column: 2; justify-self: start; }
  .hero__sync { display: none; }
  .hero__content { justify-content: flex-start; padding-top: 20svh; }
  .nav__logo span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-reveal], .line > span { opacity: 1 !important; transform: none !important; }
}

/* ───────────────────────── Project pages ───────────────────────── */
.project-hero { padding-top: calc(var(--pad) + 120px); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.project-title { margin: 1.2rem 0 1.6rem; font-family: var(--f-display); font-weight: 500; font-size: clamp(3rem, 9.5vw, 10rem); line-height: .9; letter-spacing: -0.055em; }
.project-lede { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.3rem, 2.4vw, 2.2rem); line-height: 1.12; letter-spacing: -0.03em; max-width: 30ch; margin: 0 0 3rem; }
.project-meta { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 1.5rem; margin: 0; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.project-meta dd { margin: .4rem 0 0; font-size: 16px; }
.project-meta b { font-weight: 600; }
.project-film { margin: 0; padding: 0 var(--pad); }
.project-film video { width: 100%; height: auto; border-radius: var(--radius-lg); background: #000; object-fit: cover; }
.project-film figcaption { margin-top: .8rem; }
.project-abstract { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(2rem, 6vw, 6rem); }
.project-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.project-paper { margin: 0 0 1.4rem; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.4rem, 2.4vw, 2.1rem); letter-spacing: -0.03em; line-height: 1.1; }
.project-abstract p:not(.label) { font-size: clamp(1.05rem, 1.35vw, 1.22rem); line-height: 1.6; color: #3a3d48; max-width: 62ch; margin: 0; }
.project-next { display: block; padding: clamp(4rem, 9vw, 8rem) var(--pad); border-top: 1px solid var(--line); }
.project-next__title { display: block; margin-top: .8rem; font-family: var(--f-display); font-weight: 500; font-size: clamp(2.6rem, 8vw, 8rem); letter-spacing: -0.055em; line-height: .92; transition: transform .6s var(--ease); }
.project-next:hover .project-next__title { transform: translateX(1.2rem); }
.cta--small { padding-top: 2rem; padding-bottom: 2rem; }
.cta--small .cta__foot { margin-top: 0; border-top: 0; padding-top: 0; }
a.card { color: inherit; }
@media (max-width: 860px) {
  .project-meta { grid-template-columns: 1fr 1fr; }
  .project-meta__wide { grid-column: 1 / -1; }
  .project-abstract { grid-template-columns: 1fr; }
}
