:root {
  --background: #f8f9ff;
  --text: #050505;
  --muted: #5d5f5b;
  --line: rgba(100, 105, 116, 0.2);
  --line-strong: rgba(100, 105, 116, 0.36);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 4.45vw, 4rem);
  --content-width: 72rem;
  --header-height: 5.125rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  scrollbar-gutter: stable;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--background);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.site-header {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 2.125rem 3rem;
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 249, 255, 0.96);
}

.alphabet-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.045em;
  line-height: 1;
  text-decoration: none;
}

.alphabet-logo > span { white-space: nowrap; }
.alphabet-logo__name { color: #ff0000; }

.site-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: min(calc(100% - 2 * var(--gutter)), var(--content-width));
  height: 3rem;
  margin-inline: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.6vw, 2rem);
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: block;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-decoration: none;
}
.site-nav__link:hover,
.site-nav__link[aria-current="page"] { border-bottom-color: var(--text); color: var(--text); }

.home-main {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: var(--header-height) var(--gutter) 0;
}

.visual-stage {
  position: relative;
  flex: 1;
  width: min(100%, var(--content-width));
  min-height: 0;
  margin-inline: auto;
  overflow: hidden;
}

.visual-stage__frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
}

.visual-stage__image {
  width: min(var(--exhibit-width, 88%), 88%, 62rem);
  height: min(var(--exhibit-height, 62vh), 62vh, 34rem);
  object-fit: contain;
  opacity: 1;
  transition: opacity 240ms ease;
}
.visual-stage__image--changing { opacity: 0; }

.visual-stage__control {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 4.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 300 1.5rem/1 var(--sans);
  transform: translateY(-50%);
}
.visual-stage__control:hover { color: var(--text); }
.visual-stage__control--previous { left: 0; }
.visual-stage__control--next { right: 0; }
.visual-stage:not(.visual-stage--enhanced) .visual-stage__control,
.visual-stage:not(.visual-stage--enhanced) .visual-stage__playback { visibility: hidden; }

.visual-stage__playback {
  position: absolute;
  z-index: 2;
  bottom: 0.75rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.045em;
  transform: translateX(-50%);
}
.visual-stage__pause {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}
.visual-stage__pause:hover { color: var(--text); }
.visual-stage__counter::before { margin-right: 0.8rem; color: var(--line-strong); content: "|"; }

.editorial-main {
  flex: 1;
  padding: calc(var(--header-height) + 1.5rem) var(--gutter) 0;
}

.editorial-page { width: min(100%, 64rem); margin-inline: auto; }
.editorial-header { max-width: 43rem; }
.editorial-header h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 0.98;
}
.editorial-header p {
  max-width: 38rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.25vw, 1.0625rem);
  line-height: 1.55;
}

.content-groups { margin-top: clamp(1.5rem, 2.5vw, 2.25rem); }
.content-group {
  display: grid;
  grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  padding: clamp(1.25rem, 2vw, 1.75rem) 0;
  border-top: 1px solid var(--line-strong);
}
.content-group h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.content-group__label p { margin: 1rem 0 0; color: var(--muted); font-size: 0.9rem; }
.entry-list { margin: 0; padding: 0; list-style: none; }
.entry { padding: 0 0 0.875rem; }
.entry + .entry { padding-top: 0.875rem; border-top: 1px solid var(--line); }
.entry + .entry--secondary-start {
  padding-top: 1.125rem;
  border-top: 3px double var(--line-strong);
}
.entry:last-child { padding-bottom: 0; }
.entry h3 { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.4; }
.entry p { margin: 0.55rem 0 0; color: var(--muted); font-family: var(--serif); line-height: 1.6; }
.entry a { text-decoration-thickness: 1px; }
.external::after { margin-left: 0.3em; content: "↗"; font-size: 0.75em; }

.cv-list { list-style: none; }
.cv-entry {
  display: grid;
  grid-template-columns: minmax(6.5rem, 8rem) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
}
.cv-entry__date {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}
.cv-entry__institution {
  color: var(--text) !important;
  font-family: var(--sans) !important;
  font-size: 0.9rem;
}

.teaching-quote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.25vw, 2rem);
  letter-spacing: -0.025em;
  line-height: 1.38;
}
.teaching-quote p { margin: 0; }
.teaching-quote footer { margin-top: 1.75rem; color: var(--muted); font: 0.82rem/1.5 var(--sans); letter-spacing: 0.04em; }

.about-figure { margin: 0; text-align: center; }
.about-figure img {
  width: auto;
  max-width: 100%;
  max-height: min(80vh, calc(100svh - var(--header-height) - 16rem));
  height: auto;
  margin-inline: auto;
}
.about-figure figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.04em; }

.notice { padding-left: 1rem; border-left: 2px solid var(--text); }

.legal-copy > :first-child { margin-top: 0; }
.legal-copy > :last-child { margin-bottom: 0; }
.legal-copy p,
.legal-copy ul,
.legal-copy address {
  font-family: var(--serif);
  line-height: 1.65;
}
.legal-copy p { margin: 1rem 0 0; }
.legal-copy address { margin: 1rem 0 0; font-style: normal; }
.legal-copy ul { margin: 1rem 0 0; padding-left: 1.25rem; }
.legal-copy li + li { margin-top: 0.35rem; }
.legal-copy a { text-decoration-thickness: 1px; }

.site-footer {
  width: min(calc(100% - 2 * var(--gutter)), var(--content-width));
  margin: clamp(1.5rem, 2.5vw, 2.25rem) auto 0;
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--line-strong);
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem 1.5rem; text-align: center; }
.site-footer a { color: var(--muted); font-size: 0.78rem; text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

.not-found {
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: center;
  padding: calc(var(--header-height) + var(--gutter)) var(--gutter) var(--gutter);
}
.not-found section { max-width: 34rem; }
.not-found h1 { margin: 0; font: 650 clamp(3.5rem, 10vw, 6rem)/0.9 var(--serif); }
.not-found p { margin: 2rem 0 0; color: var(--muted); font-family: var(--serif); font-size: 1.2rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 48rem) {
  :root { --header-height: 4.875rem; }
  .site-header { grid-template-rows: 2.125rem 2.75rem; }
  .site-nav {
    justify-content: safe center;
    width: 100%;
    height: 2.75rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav ul {
    position: static;
    flex: 0 0 auto;
    justify-content: center;
    width: max-content;
    min-width: 100%;
    gap: clamp(0.75rem, 3.5vw, 1rem);
    padding-inline: 0.75rem;
    transform: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav__link { white-space: nowrap; }
  .visual-stage { min-height: 26rem; }
  .visual-stage__image {
    width: min(var(--exhibit-width, 100%), 100%);
    height: min(var(--exhibit-height, 56vh), 56vh, 30rem);
  }
  .visual-stage__control { width: 2.5rem; }
  .content-group { grid-template-columns: 1fr; gap: 2rem; }
  .cv-entry { grid-template-columns: 1fr; gap: 0.35rem; }
}

@media (max-height: 36rem) {
  .about-figure img {
    max-height: min(80vh, calc(100svh - var(--header-height) - 9rem));
  }
}

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