/* ==========================================================================
   Modern theme for harrischan.com
   Self-contained: does not depend on the legacy Jekyll Academic stylesheets.
   ========================================================================== */

/* ---- Fonts (self-hosted, variable) ---- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-var-latin.woff2') format('woff2');
}

/* ---- Tokens ---- */
:root {
  --bg: #faf9f7;
  --bg-elevated: #ffffff;
  --text: #1c1b20;
  --text-muted: #605d6b;
  --text-faint: #8b8894;
  --border: rgba(28, 27, 32, 0.1);
  --border-strong: rgba(28, 27, 32, 0.18);
  --accent: #b73427;
  --accent-strong: #93291e;
  --accent-soft: rgba(183, 52, 39, 0.08);
  --chip-bg: rgba(28, 27, 32, 0.05);
  --shadow: 0 1px 2px rgba(20, 18, 26, 0.04), 0 8px 24px -12px rgba(20, 18, 26, 0.12);
  --shadow-lift: 0 2px 4px rgba(20, 18, 26, 0.05), 0 16px 32px -16px rgba(20, 18, 26, 0.2);
  --nav-bg: rgba(250, 249, 247, 0.82);
  --grid-dot: rgba(28, 27, 32, 0.16);
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #101014;
  --bg-elevated: #18181e;
  --text: #ededf2;
  --text-muted: #a3a0ae;
  --text-faint: #767381;
  --border: rgba(237, 237, 242, 0.1);
  --border-strong: rgba(237, 237, 242, 0.2);
  --accent: #ff7259;
  --accent-strong: #ff9078;
  --accent-soft: rgba(255, 114, 89, 0.1);
  --chip-bg: rgba(237, 237, 242, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 32px -16px rgba(0, 0, 0, 0.6);
  --nav-bg: rgba(16, 16, 20, 0.8);
  --grid-dot: rgba(237, 237, 242, 0.14);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.modern {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.modern img { max-width: 100%; height: auto; }

.modern a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
.modern a:hover { color: var(--accent-strong); }

.modern ::selection { background: var(--accent); color: #fff; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap {
  width: min(1080px, 100% - 3rem);
  margin-inline: auto;
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 2.5rem); }
}

/* ---- Navigation ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.site-nav.is-scrolled { border-bottom-color: var(--border); }

.site-nav .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  white-space: nowrap;
}
.brand .brand-mark {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  background: var(--accent);
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-mark { transform: rotate(135deg) scale(1.15); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-links a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--chip-bg); }
.nav-links a.is-active { color: var(--text); background: var(--chip-bg); }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); transform: rotate(15deg); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  /* Pull up behind the sticky nav so the grid runs under it */
  margin-top: -4rem;
  padding-top: 4rem;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero::after {
  /* soft fade from the grid into the page background */
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 7rem;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: clamp(4.5rem, 12vh, 8.5rem) 0 clamp(4rem, 10vh, 7rem);
}
.hero-text { flex: 1 1 auto; max-width: 40rem; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}
.hero-eyebrow::before {
  content: '';
  width: 1.5rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 1.5rem;
}

.hero-lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 34em;
}
.hero-lede strong, .hero-lede a { font-weight: 550; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.hero-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.hero-links svg { width: 1rem; height: 1rem; opacity: 0.75; }

.hero-portrait { flex: 0 0 auto; }
.hero-portrait img {
  width: clamp(150px, 18vw, 220px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 28% 72% 65% 35% / 30% 35% 65% 70%;
  border: 3px solid var(--bg-elevated);
  box-shadow: var(--shadow-lift);
  transition: border-radius 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-portrait img:hover { border-radius: 50%; }

@media (max-width: 760px) {
  .hero .wrap { flex-direction: column-reverse; align-items: flex-start; gap: 2rem; }
  .hero-portrait img { width: 120px; }
}

/* ---- Sections ---- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-head .section-link {
  font-size: 0.92rem;
  font-weight: 550;
  white-space: nowrap;
}
.section-head .section-link::after {
  content: ' →';
  transition: margin-left 0.15s ease;
}
.section-head .section-link:hover::after { margin-left: 0.2em; }

/* ---- News list ---- */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.news-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  transition: background 0.15s ease;
}
.news-list li:hover { background: var(--chip-bg); }
.news-list time {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--text-faint);
  padding-top: 0.15rem;
  white-space: nowrap;
}
.news-list p { margin: 0; color: var(--text-muted); }
.news-list p a { font-weight: 550; }
@media (max-width: 600px) {
  .news-list li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---- Research cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}
.card .card-glyph {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.card .card-glyph svg { width: 1.25rem; height: 1.25rem; }
.card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
.card p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* ---- Projects (featured work) ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  color: var(--text) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}
.project-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-card:hover .project-thumb img { transform: scale(1.04); }
.project-info { padding: 1.5rem 1.6rem 1.7rem; }
.project-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}
.project-info h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}
.project-info p { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.98rem; }
.project-link {
  font-weight: 550;
  font-size: 0.92rem;
  color: var(--accent);
}
.project-link::after { content: ' →'; transition: margin-left 0.15s ease; }
.project-card:hover .project-link::after { margin-left: 0.25em; }

/* ---- Publications ---- */
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.pub-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  padding: 1rem 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pub-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
/* Stretched link: the title's anchor covers the whole card so a click
   anywhere follows the publication link. */
.pub-body h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.pub-thumb {
  position: relative;
  z-index: 2;               /* sits above the stretched link for its own click */
  flex: 0 0 auto;
  width: 132px;
  aspect-ratio: 16 / 10;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  cursor: zoom-in;
}
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.pub-thumb:hover img { transform: scale(1.05); }
.pub-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pub-body { flex: 1 1 auto; min-width: 0; }
.pub-body > *:last-child { margin-bottom: 0; }
@media (max-width: 620px) {
  .pub-item { flex-direction: column; align-items: stretch; }
  .pub-thumb { width: 100%; aspect-ratio: 16 / 9; }
}
.pub-item h3 {
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.005em;
  margin: 0 0 0.3rem;
}
.pub-item h3 a { color: var(--text); }
.pub-item h3 a:hover { color: var(--accent); }
.pub-authors {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.pub-authors strong { color: var(--text); font-weight: 550; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.chip.chip-accent { background: var(--accent-soft); color: var(--accent); }

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 3rem;
}
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 2rem; } }
.about-grid .prose p:first-child { margin-top: 0; }

.fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.fact-list li { position: relative; padding: 0 0 1.15rem 1.4rem; }
.fact-list li:last-child { padding-bottom: 0; }
.fact-list li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.fact-list .fact-title { display: block; font-weight: 600; font-size: 0.97rem; }
.fact-list .fact-detail { display: block; font-size: 0.88rem; color: var(--text-muted); }
.fact-heading {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 1.25rem;
}

/* ---- Two-column compact lists (teaching / talks) ---- */
.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}
.split-grid h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
}
.compact-list { list-style: none; margin: 0; padding: 0; }
.compact-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.compact-list li:last-child { border-bottom: none; }
.compact-list .item-note { color: var(--text-faint); font-size: 0.85rem; }

/* ---- Prose (markdown pages, posts) ---- */
.page-header { padding: clamp(3rem, 8vw, 5rem) 0 0; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 0.75rem;
}
.page-header .page-lede { color: var(--text-muted); font-size: 1.1rem; margin: 0; max-width: 44em; }
.page-header .post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-faint);
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

.page-body { padding: 2.25rem 0 clamp(3.5rem, 8vw, 5.5rem); }

.prose { max-width: 46rem; }
.prose.prose-wide { max-width: none; }
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 2.5em 0 0.75em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2em 0 0.6em;
}
.prose a { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.85em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 1.5em 0;
  padding: 0.25em 0 0.25em 1.25em;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}
.prose code {
  font-size: 0.88em;
  background: var(--chip-bg);
  border-radius: 6px;
  padding: 0.15em 0.4em;
}
.prose pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose iframe {
  width: 100% !important;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }
.pdf-embed {
  width: 100%;
  height: min(85vh, 1000px);
  min-height: 520px;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; }

/* ---- Index (blog / presentations) cards ---- */
.year-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 2.25rem 0 1rem;
}
.year-label:first-child { margin-top: 0; }
.index-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.index-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  padding: 1.2rem 1.35rem;
  color: var(--text) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.index-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.index-card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 0 0 0.25rem;
}
.index-card:hover h3 { color: var(--accent); }
.index-card p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }
.index-card time { display: block; font-size: 0.82rem; color: var(--text-faint); margin-top: 0.5rem; }

.back-link { display: inline-block; margin-top: 2.5rem; font-weight: 550; font-size: 0.95rem; }
.back-link::before { content: '← '; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
  margin-top: clamp(3rem, 8vw, 5rem);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer p { margin: 0; font-size: 0.9rem; color: var(--text-faint); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { font-size: 0.9rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(12, 11, 15, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  cursor: zoom-out;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.lightbox.is-open img { transform: scale(1); }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.15rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }
html.no-js .reveal, html.reduced-motion .reveal { opacity: 1; transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .modern *, .modern *::before, .modern *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---- Print ---- */
@media print {
  .site-nav, .theme-toggle, .hero-canvas, .site-footer { display: none; }
  body.modern { background: #fff; color: #000; }
}
