:root {
  --ink:    #000000;
  --paper:  #f4f1eb;
  --accent: #c8965a;
  --accent2:#4a7fa5;
  --muted:  #000000;
  --border: rgba(10,14,23,0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

/* ── Canvas ─────────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* ── Navbar ─────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 3rem;
  background: rgba(244,241,235,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: padding .3s;
}
.site-nav .brand {
  font-size: 0.85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
}
.site-nav nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.site-nav nav a {
  font-family: 'DM Mono', monospace;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.6rem;
  white-space: nowrap;
  transition: color .2s;
}
.site-nav nav a:hover { color: var(--accent); }
.site-nav nav a.active {
  color: #fff;
  background: var(--accent2);
  padding: 0.2em 0.55em;
  border-radius: 3px;
}

/* ── Hero ───────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 3rem 5rem;
}
.hero-inner { max-width: 1000px; width: 100%; }
.hero-label {
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: fadeUp .8s .2s forwards;
}
.hero h1 {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.01em;
  opacity: 0;
  animation: fadeUp .9s .4s forwards;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent2);
}
.hero-desc {
  margin-top: 2rem;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.75;
  color: #000000;
  opacity: 0;
  animation: fadeUp .9s .6s forwards;
}
.hero-cta {
  margin-top: 2.8rem;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp .9s .8s forwards;
}
.btn-outline-ink {
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .7rem 1.8rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  transition: background .25s, color .25s;
}
.btn-outline-ink:hover { background: var(--ink); color: var(--paper); }
.btn-blue { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn-blue:hover { background: var(--accent2); color: #fff; }
.btn-solid-accent {
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .7rem 1.8rem;
  border: 1px solid var(--accent);
  color: var(--paper);
  background: var(--accent);
  text-decoration: none;
  transition: opacity .25s;
}
.btn-solid-accent:hover { opacity: .82; color: var(--paper); }

/* ── Section chrome ─────────────────────────────── */
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .7rem;
}
section { position: relative; z-index: 1; }

/* ── Research Areas ─────────────────────────────── */
.research-section {
  padding: 7rem 3rem;
  min-height: 100vh;
}
.research-section h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  margin-bottom: 3.5rem;
  max-width: 520px;
  line-height: 1.2;
}
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5px;
  background: var(--border);
  counter-reset: pillar;
}
.research-card {
  background: var(--paper);
  padding: 3rem 2.6rem;
  transition: background .3s;
  cursor: default;
  position: relative;
  counter-increment: pillar;
}
.research-card::before {
  content: "0" counter(pillar);
  position: absolute;
  top: 1.4rem;
  right: 1.6rem;
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  color: var(--accent);
  opacity: .55;
}
.research-card:hover { background: #f0f0f0; }
.research-card .icon {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.6rem;
}
.research-card .icon svg {
  width: 100%; height: 100%;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1);
}
.research-card:hover .icon svg { transform: rotate(8deg) scale(1.05); }
.research-card h3 {
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: .9rem;
  letter-spacing: -.005em;
}
.research-card .strand {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .4rem;
  display: block;
}
.research-card p {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: #000000;
}
.research-card em {
  font-style: italic;
}

.research-card.research-card--orange .icon,
.research-card.research-card--orange em { color: var(--accent); }

.research-card.research-card--blue .icon,
.research-card.research-card--blue em,
.research-card.research-card--blue .strand,
.research-card.research-card--blue::before { color: var(--accent2); }

/* ── Stats strip ─────────────────────────────────── */
.stats-strip {
  background: var(--ink);
  color: var(--paper);
  padding: 4rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
.stat-num {
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  font-weight: 300;
  color: var(--accent);
  letter-spacing: -.02em;
}
.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-top: .4rem;
}

/* ── Publications ───────────────────────────────── */
.pubs-section {
  padding: 7rem 3rem;
  min-height: 100vh;
}
.pubs-section h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  margin-bottom: 3rem;
}
.pub-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.8rem 0;
  border-top: 1px solid var(--border);
}
.pub-year {
  font-family: 'DM Mono', monospace;
  font-size: .72rem;
  color: var(--accent);
  padding-top: .2rem;
}
.pub-title {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: .35rem;
}
.pub-authors {
  font-size: .88rem;
  font-weight: 400;
  color: var(--muted);
  font-style: italic;
}
.pub-journal {
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--accent2);
  margin-top: .35rem;
}
.pub-doi {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  color: var(--accent);
  text-decoration: none;
  margin-left: .6rem;
  transition: opacity .2s;
}
.pub-doi:hover { opacity: .65; text-decoration: underline; }
.pub-status {
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}
.pub-status.error { color: #b94a4a; }
.pub-status code {
  background: rgba(10,14,23,0.06);
  padding: .15rem .45rem;
  border-radius: 2px;
  font-size: .85em;
}

/* ── Team ───────────────────────────────────────── */
.team-section {
  padding: 7rem 3rem;
  min-height: 100vh;
}
.team-section h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  margin-bottom: 3rem;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2.5rem;
}
.team-card { text-align: center; }
.team-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
  margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: var(--paper);
  font-weight: 300;
  overflow: hidden;
  position: relative;
}
.team-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team-card h4 { font-size: 1.05rem; font-weight: 400; margin-bottom: .25rem; }
.team-card p {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Contact ─────────────────────────────────────── */
.contact-section {
  padding: 7rem 3rem;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  position: relative;
  z-index: 1;
}
.contact-section h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  margin-bottom: .8rem;
}
.contact-section p {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink);
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.contact-item { border-top: 1px solid var(--border); padding-top: 1rem; }
.contact-item .label {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}
.contact-item .value {
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
}

/* ── Footer ─────────────────────────────────────── */
footer {
  position: relative; z-index: 1;
  background: #060810;
  color: rgba(255,255,255,.3);
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 1.6rem 3rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ── Gallery / Turnstile ─────────────────────────── */
.gallery-section {
  padding: 7rem 3rem 5rem;
  min-height: 100vh;
}
.gallery-section h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  margin-bottom: 3rem;
}
.gallery-status {
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 2rem 0;
  display: none;
}

.turnstile-scene {
  margin-left: -3rem;
  margin-right: -3rem;
  padding: 0 0 1.5rem;
}

.turnstile-track {
  position: relative;
  width: 100%;
  height: 75vh;
}

.ts-slide {
  position: absolute;
  inset: 0;
  transition: transform .55s cubic-bezier(.25,1,.5,1),
              opacity .55s ease,
              filter .55s ease;
  cursor: pointer;
  transform: scale(.3) rotateY(90deg);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.ts-slide img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

.ts-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 4rem 2rem 1.5rem;
  background: linear-gradient(transparent, rgba(10,14,23,0.65));
  font-family: 'DM Mono', monospace;
  font-size: .72rem;
  letter-spacing: .14em;
  color: rgba(255,255,255,.82);
  pointer-events: none;
}

.ts-slide[data-pos="0"] {
  transform: scale(1);
  opacity: 1;
  filter: none;
  pointer-events: auto;
  cursor: zoom-in;
  z-index: 10;
}

.ts-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 1rem 0 2.5rem;
}

.ts-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 1.1rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.ts-btn:hover { background: var(--ink); color: var(--paper); }

.ts-counter {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  min-width: 64px;
  text-align: center;
}

/* ── Lightbox ─────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10,14,23,0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}
#lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  user-select: none;
}
.lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--paper);
  font-size: 1.3rem;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s;
  z-index: 210;
}
.lb-arrow:hover { background: rgba(255,255,255,0.18); }
#lb-prev { left: 1.5rem; }
#lb-next { right: 1.5rem; }
.lb-close {
  position: fixed;
  top: 1.2rem; right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 210;
  transition: color .2s;
  line-height: 1;
  padding: 0;
}
.lb-close:hover { color: var(--paper); }
.lb-meta {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 210;
  pointer-events: none;
}
.lb-counter {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
}
.lb-filename {
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  color: rgba(255,255,255,.25);
  margin-top: .25rem;
  letter-spacing: .05em;
}

/* ── Values ─────────────────────────────────────── */
.values-section {
  padding: 7rem 3rem;
  min-height: 100vh;
}
.values-section h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  margin-bottom: 3.5rem;
  line-height: 1.2;
}
.values-quote {
  max-width: 700px;
  margin-bottom: 5rem;
  padding-left: 1.8rem;
  border-left: 2px solid var(--accent);
}
.values-quote blockquote {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: .8rem;
}
.values-quote cite {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-style: normal;
}
.values-list {
  max-width: 680px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.values-list li {
  padding: 2rem 0 2rem 1.6rem;
  border-top: 1px solid var(--border);
  position: relative;
}
.values-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2.7rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.value-name {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -.005em;
  margin: 0 0 .5rem;
}
.value-name em {
  font-style: italic;
  color: var(--accent2);
}
.value-body {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: #000000;
  margin: 0;
}

/* ── Animations ─────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hamburger button ────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  z-index: 101;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform .28s ease, opacity .28s ease;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Desktop justify ─────────────────────────────── */
@media (min-width: 1024px) {
  .hero-desc { text-align: justify; }
}

/* ── Tablet + Phone nav collapse (≤ 1023px) ─────── */
@media (max-width: 1023px) {
  .nav-toggle { display: flex; }

  .site-nav nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(244,241,235,0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.25rem 2rem 1.25rem;
    box-shadow: 0 8px 24px rgba(10,14,23,0.08);
  }
  .site-nav nav.open { display: flex; }
  .site-nav nav a {
    margin-left: 0;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .75rem;
    white-space: normal;
  }
  .site-nav nav a:last-child { border-bottom: none; }
  .site-nav nav a.active {
    background: none;
    padding: 0.9rem 0;
    color: var(--accent2);
    border-radius: 0;
  }
}

/* ── Tablet (640px – 1023px) ─────────────────────── */
@media (min-width: 640px) and (max-width: 1023px) {
  .site-nav { padding: 1rem 2rem; }
  .site-nav nav { padding: 0.25rem 2rem 1.25rem; }

  .hero,
  .research-section,
  .pubs-section,
  .team-section,
  .contact-section,
  .gallery-section,
  .values-section { padding-left: 2rem; padding-right: 2rem; }

  .turnstile-scene { margin-left: -2rem; margin-right: -2rem; }
  .turnstile-track { height: 60vw; }
  .stats-strip { padding: 3.5rem 2rem; }
  footer { padding: 1.4rem 2rem; }
}

/* ── Phone (≤ 639px) ─────────────────────────────── */
@media (max-width: 639px) {
  .site-nav { padding: 1rem 1.25rem; }
  .site-nav nav { padding: 0.25rem 1.25rem 1.25rem; }

  .hero,
  .research-section,
  .pubs-section,
  .team-section,
  .contact-section,
  .gallery-section,
  .values-section { padding-left: 1.25rem; padding-right: 1.25rem; }

  .hero { padding-top: 5rem; padding-bottom: 3rem; }
  .research-section, .pubs-section, .team-section,
  .contact-section, .gallery-section,
  .values-section { padding-top: 4rem; padding-bottom: 4rem; }

  .hero-desc { font-size: 1rem; }

  .hero-cta { flex-direction: column; gap: 0.75rem; }
  .btn-outline-ink, .btn-solid-accent { text-align: center; display: block; }

  .pub-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .pub-year { padding-top: 0; }

  .values-quote { padding-left: 1rem; margin-bottom: 3rem; }

  .turnstile-scene { margin-left: -1.25rem; margin-right: -1.25rem; }
  .turnstile-track { height: 56vw; }
  .ts-nav { gap: 1.5rem; }

  .stats-strip { padding: 3rem 1.25rem; }
  footer { padding: 1.4rem 1.25rem; }

  .research-card { padding: 2rem 1.5rem; }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1.75rem; }
}
