/* ---- fonts ---- */

/* Newsreader (SIL OFL), self-hosted latin subset, preloaded from the HTML. */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/newsreader-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Georgia scaled to Newsreader's widths, so a late font swap does not resize text. */
@font-face {
  font-family: "Newsreader Fallback";
  font-style: normal;
  font-weight: 400 500;
  src: local("Georgia");
  size-adjust: 91%;
}

@font-face {
  font-family: "Newsreader Fallback";
  font-style: normal;
  font-weight: 600 700;
  src: local("Georgia Bold"), local("Georgia-Bold");
  size-adjust: 82%;
}

/* The uppercase hero logotype has a different width ratio than mixed-case text. */
@font-face {
  font-family: "Newsreader Caps Fallback";
  font-style: normal;
  font-weight: 600 700;
  src: local("Georgia Bold"), local("Georgia-Bold");
  size-adjust: 95.5%;
}

@font-face {
  font-family: "Newsreader Fallback";
  font-style: italic;
  font-weight: 400 500;
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 91%;
}

:root {
  --color-ground: oklch(93% 0.004 95);
  --color-ink: oklch(21% 0.004 95);
  --color-dim: oklch(33% 0.006 95);
  --color-plate: oklch(99% 0 0);
  --color-faint: oklch(70% 0.006 95);
  --color-line: oklch(84% 0.005 95);

  --color-tag-bg: oklch(92% 0.025 160);
  --color-tag-line: oklch(78% 0.04 160);
  --color-tag-ink: oklch(38% 0.06 160);
  --color-accent: oklch(46% 0.1 165);

  --holo: linear-gradient(
    100deg,
    #8fd3e8,
    #a99fe0 28%,
    #d9a0cf 52%,
    #9fb8e6 76%,
    #8fd8c9
  );

  --font-display: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-base: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --text-logotype: clamp(2.4rem, 1.4rem + 4.4vw, 4.75rem);
  --text-entry: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  --text-mono: 0.875rem;

  --space-section: clamp(5rem, 3rem + 8vw, 11rem);
  --space-gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 40rem;

  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- ground ---- */

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-ground);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--color-ink);
  color: var(--color-ground);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- grain overlay ---- */

.grain {
  position: fixed;
  inset: -100%;
  z-index: 10;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}

@keyframes grain-shift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(-3%, 2%, 0);
  }
  50% {
    transform: translate3d(2%, -3%, 0);
  }
  75% {
    transform: translate3d(-2%, -2%, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .grain,
  .mobius {
    animation: none;
  }
}

/* ---- registration marks (film frame corners) ---- */

.reg-marks {
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
}

.reg-marks span {
  position: absolute;
  width: 14px;
  height: 14px;
  opacity: 0.45;
}

.reg-marks span::before,
.reg-marks span::after {
  content: "";
  position: absolute;
  background: var(--color-ink);
}

.reg-marks span::before {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.reg-marks span::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.reg-marks span:nth-child(1) {
  top: 10px;
  left: 10px;
}

.reg-marks span:nth-child(2) {
  top: 10px;
  right: 10px;
}

.reg-marks span:nth-child(3) {
  bottom: 10px;
  left: 10px;
}

.reg-marks span:nth-child(4) {
  bottom: 10px;
  right: 10px;
}

/* ---- type helpers ---- */

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.06em;
  color: var(--color-dim);
}

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

p a,
.about-text a {
  border-bottom: 1px solid var(--color-faint);
  transition: border-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

p a:hover,
p a:focus-visible {
  color: var(--color-ink);
  border-color: var(--color-ink);
}

:focus-visible {
  outline: 1px solid var(--color-ink);
  outline-offset: 3px;
}

/* ---- header ---- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem var(--space-gutter);
  background: color-mix(in oklch, var(--color-ground) 88%, transparent);
  backdrop-filter: blur(6px);
}

@media (max-width: 640px) {
  .site-header {
    position: absolute;
    background: none;
    backdrop-filter: none;
  }
}

.wordmark {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: color var(--duration-fast) ease;
}

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

.site-header nav {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 2rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-header nav a {
  padding: 0.3em 1em;
  border: 1px solid var(--color-ink);
  border-radius: 999px;
  color: var(--color-ink);
  font-size: 1.05rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.site-header nav a[aria-current="page"] {
  background: var(--color-ink);
  color: var(--color-ground);
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-plate);
}

/* ---- hero (centered, album-cover composition) ---- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem var(--space-gutter) 7rem;
}

.mobius {
  width: min(400px, 80vw, 42svh);
  height: auto;
  aspect-ratio: 1 / 1;
  margin-bottom: clamp(0.5rem, 2vh, 1.5rem);
  touch-action: pan-y;
  animation: holo-cycle 26s linear infinite;
}

@keyframes holo-cycle {
  to {
    filter: hue-rotate(360deg);
  }
}

.mobius-fallback {
  width: min(640px, 92vw);
  height: auto;
  margin-bottom: clamp(2rem, 5vh, 4rem);
}

.logotype {
  border-top: 3px solid var(--color-ink);
  border-bottom: 1px solid var(--color-ink);
  padding: 0.3em 0.8em 0.35em;
}

.logotype h1 {
  font-family: "Newsreader", "Newsreader Caps Fallback", Georgia, serif;
  font-size: var(--text-logotype);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-role {
  margin-top: 1rem;
  font-weight: 500;
  font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1.05rem);
}

/* ---- sections ---- */

section {
  padding: var(--space-section) var(--space-gutter) 0;
  max-width: 72rem;
  margin-inline: auto;
}

.credits-label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-dim);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.credits-label::after {
  content: "";
  flex: 1;
  border-bottom: 1px dotted var(--color-faint);
  transform: translateY(-0.3em);
}

/* ---- about ---- */

.about-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 300px);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.about-text {
  max-width: var(--measure);
}

.about-name {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 1.2rem;
}

.about-text .about-name + p {
  margin-top: 0;
}

.about-text p + p {
  margin-top: 1.4em;
}

.about-text strong {
  font-weight: 600;
  color: var(--color-ink);
}

.about-contact a {
  border-bottom: 1px solid var(--color-faint);
}

.portrait img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--color-ink);
}

.portrait figcaption {
  margin-top: 0.7rem;
  color: var(--color-dim);
  font-size: 0.95rem;
  font-style: italic;
}

.about-contact-label {
  color: var(--color-dim);
  font-style: italic;
}

@media (max-width: 640px) {
  .about-body {
    grid-template-columns: 1fr;
  }
  .portrait {
    order: -1;
    max-width: 240px;
  }
}

/* ---- subpages ---- */

.page-main {
  padding-top: clamp(5rem, 4rem + 4vw, 8rem);
}

.page-title {
  font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--color-line);
}

/* ---- publications ---- */

.pub-year {
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  text-align: right;
  font-size: clamp(2.5rem, 2rem + 2.5vw, 3.75rem);
  font-weight: 400;
  line-height: 1;
  color: var(--color-faint);
  font-variant-numeric: lining-nums;
}

.pub {
  display: grid;
  grid-template-columns: minmax(0, 23rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.pub-venue-tag {
  margin-bottom: 0.9rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--color-tag-line);
  border-radius: 6px;
  background: var(--color-tag-bg);
  color: var(--color-tag-ink);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}

.pub-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.pub-thumb-hint {
  margin-top: 0.45rem;
  color: var(--color-faint);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0;
  text-align: center;
  transition: color var(--duration-fast) ease;
}

.pub-aside:hover .pub-thumb-hint {
  color: var(--color-dim);
}

.pub-thumb img,
.pub-thumb-video {
  display: block;
  width: 100%;
  height: auto;
}

.pub-thumb img,
.pub-thumb video {
  padding: 0.5rem;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-plate);
  transition:
    transform var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) ease;
}

.pub-thumb:hover img,
.pub-thumb:focus-visible img,
.pub-thumb:hover video,
.pub-thumb:focus-visible video {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -14px oklch(21% 0.004 95 / 0.45);
}

.pub-title {
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.pub-title a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition:
    color var(--duration-fast) ease,
    background-size var(--duration-normal) var(--ease-out-expo);
}

.pub-title a:hover,
.pub-title a:focus-visible {
  color: var(--color-accent);
  background-size: 100% 1.5px;
}

.pub-authors {
  margin-top: 0.6rem;
  color: var(--color-dim);
}

.pub-authors strong {
  color: var(--color-ink);
  font-weight: 650;
}

.pub-authors sup,
.pub-footnote sup {
  font-size: 0.7em;
  line-height: 0;
}

.pub-venue {
  margin-top: 0.35rem;
  font-style: italic;
  color: var(--color-dim);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border: 1.5px solid var(--color-faint);
  border-radius: 10px;
  color: var(--color-ink);
  font-size: 1.05rem;
  font-weight: 500;
  transition:
    border-color var(--duration-fast) ease,
    background-color var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-out-expo);
}

.pub-links svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

.pub-links a:hover,
.pub-links a:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-plate);
  transform: translateY(-1px);
}

.pub-links a:active {
  transform: translateY(0);
}

.pub-footnote {
  color: var(--color-dim);
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .pub {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .pub-aside {
    max-width: 28rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pub-thumb img,
  .pub-thumb video,
  .pub-links a {
    transition: none;
  }
  .pub-thumb:hover video,
  .pub-thumb:hover img,
  .pub-links a:hover {
    transform: none;
  }
}

/* ---- news ---- */

.news-list {
  list-style: none;
  padding: 0;
  max-width: 52rem;
}

.news-list li {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-line);
}

.news-list li:first-child {
  padding-top: 0;
}

.news-date {
  color: var(--color-dim);
}

.news-list p {
  color: var(--color-ink);
  max-width: var(--measure);
}

.news-list p a {
  color: var(--color-ink);
}

@media (max-width: 480px) {
  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

/* ---- footer ---- */

.site-footer {
  position: relative;
  margin-top: var(--space-section);
  padding: 3rem var(--space-gutter) 2.5rem;
  border-top: 1px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
}

.stairs {
  position: absolute;
  right: var(--space-gutter);
  bottom: calc(100% + 0.5rem);
  width: clamp(120px, 16vw, 180px);
  height: auto;
  aspect-ratio: 280 / 270;
  color: var(--color-dim);
}

.footer-links {
  display: flex;
  gap: 1.6rem;
}

.footer-links a {
  color: var(--color-dim);
  transition: color var(--duration-fast) ease;
}

.footer-links a::before {
  content: "[ ";
  color: var(--color-faint);
}

.footer-links a::after {
  content: " ]";
  color: var(--color-faint);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--color-ink);
}

.colophon {
  color: var(--color-faint);
}

/* ---- hero links ---- */

.hero-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: clamp(1.25rem, 3vh, 2rem);
}

.hero-links a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--color-faint);
  border-radius: 50%;
  color: var(--color-dim);
  transition:
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-out-expo);
}

.hero-links svg {
  width: 1.15rem;
  height: 1.15rem;
}

.hero-links a:hover,
.hero-links a:focus-visible {
  border-color: var(--color-ink);
  color: var(--color-ink);
  transform: translateY(-2px);
}

.hero-links a:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}

.hero-links a:active {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-links a,
  .hero-links a:hover,
  .hero-links a:focus-visible {
    transform: none;
  }
}

/* ---- scroll hint ---- */

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-dim);
  text-decoration: none;
  translate: -50% 0;
  animation: scroll-hint-in 900ms var(--ease-out-expo) 1.2s both;
  transition:
    opacity var(--duration-normal) ease,
    color var(--duration-fast) ease;
}

.scroll-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-hint-mouse {
  position: relative;
  width: 1.4rem;
  height: 2.2rem;
  border: 1.5px solid currentColor;
  border-radius: 0.7rem;
}

.scroll-hint-dot {
  position: absolute;
  top: 0.4rem;
  left: 50%;
  width: 3px;
  height: 0.45rem;
  margin-left: -1.5px;
  border-radius: 2px;
  background: currentColor;
  animation: scroll-hint-dot 1.8s var(--ease-out-expo) infinite;
}

.scroll-hint-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-faint);
  transition: color var(--duration-fast) ease;
}

.scroll-hint:hover,
.scroll-hint:focus-visible,
.scroll-hint:hover .scroll-hint-label,
.scroll-hint:focus-visible .scroll-hint-label {
  color: var(--color-ink);
}

.scroll-hint:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 6px;
}

@keyframes scroll-hint-dot {
  0% {
    opacity: 0;
    transform: translateY(-2px);
  }
  20% {
    opacity: 1;
  }
  70% {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  100% {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

@keyframes scroll-hint-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint,
  .scroll-hint-dot {
    animation: none;
  }
}

@media (max-width: 480px) {
  .wordmark {
    font-size: 1.05rem;
  }
  .site-header nav a {
    font-size: 0.95rem;
    padding: 0.25em 0.85em;
  }
}

/* ---- figure lightbox ---- */

.lightbox {
  margin: auto;
  overflow: auto;
  max-width: min(94vw, 1400px);
  max-height: 92vh;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  border: 0;
  border-radius: 12px;
  background: var(--color-plate);
  color: var(--color-ink);
  box-shadow: 0 30px 80px -30px oklch(21% 0.004 95 / 0.6);
}

.lightbox::backdrop {
  background: oklch(21% 0.004 95 / 0.55);
  backdrop-filter: blur(4px);
}

.lightbox[open] {
  animation: lightbox-in var(--duration-normal) var(--ease-out-expo);
}

.lightbox-img,
.lightbox-video {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 9rem);
  width: auto;
  margin-inline: auto;
}

.lightbox-caption {
  max-width: 60rem;
  margin: 0.9rem auto 0;
  color: var(--color-dim);
  font-size: 1rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-dim);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: var(--color-ground);
  color: var(--color-ink);
}

@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox[open] {
    animation: none;
  }
}

.lightbox-img[hidden],
.lightbox-video[hidden] {
  display: none;
}
