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

.hidden { display: none !important; }

:root {
  --bg: #0a0a0a;
  --surface: #111;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #fff;
  --nav-height: 64px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --landing-hero-bg: url('../images/photo/20241119-PiersonLipschultz3674020241119-PiersonLipschultz36740-1-.jpg');
  --contact-page-bg: url('../images/vfx/Windows.png');
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

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

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

/* ── Nav ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-logo {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-social a {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-social a:hover { color: var(--accent); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s;
}

.mobile-menu {
  display: flex;
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu a {
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.mobile-menu a:hover { color: var(--accent); }

/* ── Page shell ── */
.page-content {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ── Hero ── */
.hero {
  position: relative;
  height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--landing-hero-bg);
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
  transform: scale(1.05);
  transition: transform 8s ease-out;
}

.hero:hover .hero-bg { transform: scale(1.0); }

/* Soft blur-and-fade strip at bottom of hero image */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0) 0%, var(--bg) 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 85%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 85%);
}

body.scrolled .hero::after {
  opacity: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-tagline {
  font-size: clamp(0.8rem, 2vw, 1rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-cv-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5rem 1.6rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 2px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}

.hero-cv-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

.hero-scroll::after {
  content: '';
  width: 1px;
  height: 40px;
  background: var(--muted);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ── Section headers ── */
.section-header {
  text-align: center;
  padding: 4rem 2rem 2rem;
}

.section-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.section-subtitle {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.section-divider {
  width: 40px;
  height: 1px;
  background: var(--muted);
  margin: 1rem auto 0;
}

/* ── Page hero (inner pages) ── */
.page-hero {
  padding: 4rem 2rem 2rem;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.page-hero p {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* Contact — VFX Windows bg; fixed attachment so hero + body layers share
   one viewport crop (avoids cover mismatch between short hero and tall main). */
.page-content--contact {
  position: relative;
  overflow-x: hidden;
}

.page-content--contact > .page-content-bg--landing {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--contact-page-bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  filter: brightness(0.4);
}

.page-content--contact > :not(.page-content-bg--landing) {
  position: relative;
  z-index: 1;
}

.page-hero--contact h1,
.page-hero--contact p {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 28px rgba(0, 0, 0, 0.45);
}

.page-hero--contact h1 {
  color: rgba(248, 248, 248, 0.98);
}

.page-hero--contact p {
  color: rgba(200, 200, 200, 0.92);
}

/* Academic landing hero — photo background dimmed like main site hero */
.page-hero.page-hero--academic {
  position: relative;
  overflow: hidden;
  padding: 4rem 2rem 2.75rem;
  text-align: center;
}

.page-hero-bg--academic {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../images/academic/harper-binary-facts-talk.png');
  background-size: cover;
  background-position: center 35%;
  filter: brightness(0.31);
  transform: scale(1.06);
  transition: transform 8s ease-out, filter 0.25s ease;
}

.page-hero--academic:hover .page-hero-bg--academic {
  transform: scale(1.02);
}

/* Soft blur-and-fade strip at the bottom of the hero so the photo
   transitions smoothly into the dark scroll content below. Sits
   above the background image but below the hero text. */
.page-hero--academic::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  z-index: 1;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0) 0%, var(--bg) 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 85%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 85%);
}

.page-hero--academic .page-hero-inner {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 28px rgba(0, 0, 0, 0.45);
}

.page-hero--academic .page-hero-inner > h1 {
  color: rgba(248, 248, 248, 0.98);
}

.page-hero--academic .academic-interests-label {
  color: rgba(210, 210, 210, 0.95);
}

.page-hero--academic .academic-interests {
  color: rgba(226, 226, 226, 0.96);
}

.page-hero--academic .academic-hero-blurb > p:first-of-type {
  color: rgba(230, 230, 230, 0.96);
}

.page-hero .academic-hero-blurb {
  margin: 1.25rem auto 0;
  max-width: 34rem;
  text-align: left;
}
.page-hero .academic-hero-blurb > p:first-of-type {
  margin-top: 0;
  letter-spacing: 0.03em;
  line-height: 1.55;
}
.page-hero .academic-hero-blurb a {
  color: rgba(245, 245, 245, 0.96);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.page-hero .academic-hero-blurb a:hover {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}
.page-hero .academic-interests-label {
  margin: 1rem 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(136, 136, 136, 0.95);
}
.page-hero .academic-interests {
  margin: 0;
  padding-left: 1.15rem;
  color: rgba(200, 200, 200, 0.9);
  font-size: 0.88rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.page-hero .academic-interests li {
  margin: 0.4rem 0;
}

/* ── Masonry / photo grid ── */
.gallery-grid {
  display: flex;
  gap: 24px;
  padding: 1.5rem 1.5rem 4.5rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: flex-start;
}

.gallery-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gallery-grid .gallery-item {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-grid .gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-grid .gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-grid .gallery-item:hover img {
  transform: scale(1.03);
  filter: brightness(0.85);
}

[data-gallery="photo"] .gallery-item:hover img,
[data-gallery="buick"] .gallery-item:hover img,
#gig-grid .gallery-item:hover img {
  filter: none;
}

[data-gallery="photo"] .gallery-item-overlay,
[data-gallery="buick"] .gallery-item-overlay,
#gig-grid .gallery-item-overlay {
  display: none;
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  transition: background 0.3s;
}

.gallery-item:hover .gallery-item-overlay {
  background: rgba(0,0,0,0.3);
}

.gallery-item-caption {
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s;
}

.gallery-item:hover .gallery-item-caption {
  opacity: 1;
  transform: translateY(0);
}

/* ── Category sections ── */
.category-section {
  margin-bottom: 3rem;
}

.category-label {
  padding: 2rem 2rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 1400px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 1rem;
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.95);
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text);
  font-size: 2.5rem;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

/* ── About strip (home) ── */
.about-strip {
  max-width: 700px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
}

.about-strip p {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.8;
  font-weight: 300;
}

.about-strip .highlight {
  color: var(--text);
}

/* ── Contact ── */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.contact-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 2rem 6rem;
}

.contact-wrap p {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  border-radius: 2px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(255,255,255,0.3);
}

.contact-form button[type="submit"] {
  align-self: flex-start;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--text);
  padding: 0.75rem 2rem;
  font-family: var(--font);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.contact-form button[type="submit"]:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.5);
}

.contact-links {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 0.2s;
}

.contact-links a:hover { color: var(--text); }

/* ── VFX embed / placeholder ── */
.vfx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 1.5rem 1.5rem 4.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.vfx-grid .gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}

.vfx-grid .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.vfx-grid .gallery-item:hover img { transform: scale(1.04); }

/* ── Footer ── */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .gallery-grid { gap: 18px; }
  .gallery-col { gap: 18px; }
  .vfx-grid { gap: 18px; }
}

@media (max-width: 600px) {
  .nav-links, .nav-social { display: none; }
  .hamburger { display: flex; }
  .gallery-grid { gap: 14px; }
  .gallery-col { gap: 14px; }
  .vfx-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* ── Gigs listing ── */
.gigs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 1rem 2rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gig-card {
  display: block;
  text-decoration: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gig-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.gig-card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
}

.gig-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gig-card:hover .gig-card-img img {
  transform: scale(1.04);
}

.gig-card-title {
  padding: 0.65rem 0 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.gig-card:hover .gig-card-title {
  color: var(--text);
}

.gigs-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Gig detail page ── */
.gig-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.gig-back:hover { color: var(--text); }

.gig-download-wrap {
  text-align: center;
  padding: 3rem 2rem 4rem;
}

.gig-download-btn {
  display: inline-block;
  padding: 0.5rem 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.gig-download-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Unlock modal ── */
.gig-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.gig-modal {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem;
  width: 340px;
  max-width: 90vw;
}

.gig-modal h3 {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.gig-modal p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.gig-modal input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}

.gig-modal input[type="password"]:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.gig-modal-error {
  color: #e05555;
  font-size: 0.8rem;
  min-height: 1.2em;
  margin-bottom: 0.75rem;
}

.gig-modal-btns {
  display: flex;
  gap: 0.75rem;
}

.gig-modal-btns button {
  flex: 1;
  padding: 0.6rem;
  font-family: var(--font);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: none;
  color: var(--muted);
}

.gig-modal-btns button:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text);
}

.gig-modal-btns button.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.gig-modal-btns button.btn-primary:hover {
  opacity: 0.85;
}

.gig-modal-btns button.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gig-unlock-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.65rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.gig-unlock-link:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 600px) {
  .gigs-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 1rem 1rem 4rem; }
}

/* ── Academic hub & demos ── */
.academic-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}

.academic-category {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.academic-category summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.1rem;
  cursor: pointer;
  user-select: none;
}
.academic-category summary::-webkit-details-marker { display: none; }
.academic-cat-title {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}
.academic-cat-hint {
  margin-left: auto;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: none;
  padding-right: 0.25rem;
}
.academic-category summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.academic-category[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.academic-category-inner {
  padding: 0 1.1rem 1.35rem;
}
.academic-category-inner--stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.academic-category-intro {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 0.25rem;
}
.academic-category-intro a {
  color: rgba(200, 200, 200, 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.academic-category-intro a:hover {
  color: var(--text);
}

.academic-item-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 1.15rem 1.2rem 1.25rem;
}
.academic-item-title {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 0 0 0.5rem;
}
.academic-item-desc {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 1rem;
}
.academic-item-box .academic-media-shell {
  margin-top: 0;
}
.academic-item-box .academic-media-caption {
  margin-bottom: 0;
}

.academic-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
.academic-section h2 {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.academic-section-lead {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}
.academic-section-lead code {
  font-size: 0.82em;
  color: rgba(200, 200, 200, 0.85);
}

.academic-media-shell {
  background: #080808;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.academic-media-shell iframe {
  width: 100%;
  border: 0;
  display: block;
}
.academic-media-shell--video {
  aspect-ratio: 16 / 9;
}
.academic-media-shell--video iframe {
  height: 100%;
}
/* PDF embed: native viewers draw chrome inside the iframe — clip top band + hint URL flags where supported */
.academic-media-shell--pdf {
  position: relative;
  height: min(78vh, 920px);
  min-height: 420px;
  overflow: hidden;
}
.academic-pdf-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.academic-media-shell--pdf iframe {
  position: absolute;
  left: 0;
  width: 100%;
  border: 0;
  --pdf-chrome: 52px;
  top: calc(-1 * var(--pdf-chrome));
  height: calc(100% + var(--pdf-chrome));
}
.academic-media-shell--app {
  height: min(96vh, 1700px);
  min-height: 920px;
  overflow: hidden;
}
.academic-media-shell--app iframe {
  height: 100%;
  min-height: 920px;
}

/* Hide heavy interactive embed on small screens */
.academic-hr-mobile-note {
  display: none;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  color: rgba(226, 226, 226, 0.96);
}
.academic-hr-mobile-note p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  letter-spacing: 0.02em;
}
.academic-hr-open-btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(245, 245, 245, 0.96);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.academic-hr-open-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .academic-hr-embed { display: none; }
  .academic-hr-mobile-note { display: block; }
  .academic-media-shell--app {
    height: min(88vh, 1400px);
    min-height: 560px;
  }
  .academic-media-shell--app iframe {
    min-height: 520px;
  }
}
.academic-media-caption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}
.academic-media-caption a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.academic-media-caption a:hover {
  color: var(--text);
}

/* Clickable raster preview for PDFs (avoids embedded viewer chrome / cropping) */
a.academic-pdf-thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #080808;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
a.academic-pdf-thumb:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
a.academic-pdf-thumb:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}
a.academic-pdf-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 600px) {
  .academic-cat-hint {
    width: 100%;
    margin-left: 0;
    order: 3;
    padding-right: 0;
  }
  .academic-category summary::after {
    margin-left: auto;
  }
}

.academic-cards {
  display: grid;
  gap: 1rem;
}
.academic-cards-demos {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.academic-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.2s;
}
.academic-card-link {
  display: block;
  cursor: pointer;
}
.academic-card-link:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.academic-card h3 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.academic-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.academic-meta {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: none;
}
.academic-meta a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.academic-meta a:hover {
  color: var(--text);
}

.academic-video-shell {
  aspect-ratio: 16 / 9;
  background: #080808;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.academic-video-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.academic-video-placeholder {
  font-size: 0.8rem;
  color: #555;
  text-align: center;
  padding: 1rem;
  line-height: 1.45;
}
.academic-video-placeholder code {
  font-size: 0.75em;
  color: #666;
}

.academic-post-list {
  list-style: none;
}
.academic-post-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.65rem 0;
}
.academic-post-list a {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.academic-post-list a:hover {
  color: var(--accent);
}

.academic-resource-links {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.academic-resource-links a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 2px;
}
.academic-resource-links a:hover {
  color: var(--accent);
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.academic-post {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.academic-post-header h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  margin: 0.5rem 0 0.75rem;
}
.academic-post-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(232, 232, 232, 0.92);
}
.academic-post-body p + p {
  margin-top: 1rem;
}

.demo-chart-shell {
  max-width: 940px;
  margin: 0 auto 4rem;
  padding: 0 1rem;
}
.demo-chart-shell canvas {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
