:root {
  --bg: #111216;
  --fg: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --border: rgba(255, 255, 255, 0.12);
}

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

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

#world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at 65% 50%, transparent 20%, rgba(3, 4, 8, 0.72) 100%);
}

/* Custom Magnetic Cursor & Subtle Flowing Light */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 520px; height: 520px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: 0.14;
  filter: blur(28px);
  mix-blend-mode: screen;
}
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fg);
}
.cursor-ring {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}
.cursor-ring.active {
  width: 54px; height: 54px;
  border-color: var(--accent);
}

/* Top Editorial Bar */
.hud-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  padding: 26px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.brand-sep, .brand-sub { color: var(--muted); }

.hud-actions { display: flex; gap: 10px; }

.ghost-btn {
  position: relative;
  overflow: hidden;
  padding: 9px 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.09em;
  cursor: none;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 28%, transparent);
}
.ghost-btn.accent {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  font-weight: 600;
}
.ghost-btn.accent:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #05050a;
}

/* Open Editorial Stage (No Box) */
.editorial-stage {
  position: fixed;
  left: 38px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: min(560px, calc(100vw - 90px));
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s ease;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .sep { color: var(--muted); }

.hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.8rem, 5.6vw, 5.2rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.hero-summary {
  font-size: 15px;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 20px;
  max-width: 480px;
}

.hero-highlights {
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 16px;
}

.hl-item {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.hl-item strong { color: var(--fg); font-weight: 500; }

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  pointer-events: auto;
}
.hero-ctas a, .hero-ctas button { text-decoration: none; }

/* Right Vertical Progress Rail */
.progress-rail {
  position: fixed;
  right: 38px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  cursor: none;
  transition: transform 0.2s ease, background 0.2s ease;
}
.rail-dot.active {
  background: var(--accent);
  transform: scale(1.65);
  box-shadow: 0 0 12px var(--accent);
}

/* Bottom Bar */
.hud-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  padding: 24px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scroll-cue {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.nav-arrows {
  display: flex;
  align-items: center;
  gap: 14px;
}

.arrow-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font-size: 15px;
  cursor: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.arrow-btn:hover { border-color: var(--fg); transform: scale(1.08); }

.step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* Floating Talking Ph.D. Avatar Narrator */
.avatar-narrator {
  position: fixed;
  right: 38px;
  bottom: 76px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: rgba(12, 10, 24, 0.65);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.avatar-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  overflow: hidden;
  flex-shrink: 0;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.avatar-narrator.speaking .avatar-ring {
  box-shadow: 0 0 22px var(--accent);
  animation: avNod 1.8s ease-in-out infinite;
}
.avatar-svg { width: 100%; height: 100%; display: block; }
@keyframes avNod {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(1.5deg); }
}
.avatar-controls { display: flex; flex-direction: column; gap: 4px; }
.avatar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.narrate-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: none;
  transition: all 0.2s ease;
}
.narrate-btn:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.16); }
.avatar-narrator.speaking .narrate-btn {
  background: var(--accent);
  color: #05050a;
  border-color: var(--accent);
  font-weight: 600;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 4, 8, 0.84);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: auto;
}
.modal-backdrop.hidden { display: none; }

.modal-card {
  width: min(940px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px;
  background: #080b14;
  border: 1px solid var(--border);
  padding: 28px;
}
.modal-card.compact { width: min(540px, 100%); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  letter-spacing: 0.08em;
}
.close-modal {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.overview-card {
  position: relative;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--card-accent, var(--accent));
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.overview-card:hover {
  border-color: var(--card-accent, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.overview-card.is-current {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 24px color-mix(in srgb, var(--card-accent, var(--accent)) 22%, transparent);
}
.ov-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ov-tag { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--card-accent, var(--accent)); }
.ov-loc { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); }
.overview-card h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22px; font-weight: 600; margin: 6px 0; }
.overview-card p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.works-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.works-quick-links a { text-decoration: none; cursor: pointer; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.work-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 148px;
  text-decoration: none;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0d101b;
  color: var(--fg);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.work-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.24;
  filter: saturate(0.75) contrast(1.1);
  transition: opacity 0.35s ease, transform 0.45s ease;
}
.work-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 11, 20, 0.25) 0%, rgba(8, 11, 20, 0.92) 95%);
}
.work-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}
.work-card:hover .work-bg {
  opacity: 0.5;
  transform: scale(1.06);
}
.work-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.work-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.work-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
}
.work-name {
  position: relative;
  z-index: 2;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}

.contact-lead { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.contact-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.c-link {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}
.c-link:hover { border-color: var(--accent); }
.c-row { display: flex; gap: 8px; align-items: center; }
.c-row .ghost-btn { cursor: pointer; white-space: nowrap; padding: 12px 14px; }

/* Cinematic Opening Slate Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #07050f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}
.preloader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.pre-crest-img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 36px rgba(190, 18, 60, 0.45);
}
.pre-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--fg);
}
.pre-bar {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}
.pre-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #facc15, #d946ef);
  transition: width 0.08s linear;
}
.pre-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}

.langs { font-size: 12px; color: var(--muted); line-height: 1.5; padding-top: 14px; border-top: 1px solid var(--border); }

@media (max-width: 1024px) {
  .hud-top, .hud-bottom { padding: 18px 24px; }
  .editorial-stage {
    left: 24px;
    width: min(460px, calc(100vw - 72px));
  }
  .progress-rail { right: 18px; }
}

@media (max-width: 768px) {
  html, body { cursor: auto; }
  .cursor-dot, .cursor-ring, .scroll-cue { display: none; }
  .hud-top { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  .brand-sep, .brand-sub { display: none; }
  .hud-actions { gap: 6px; flex-wrap: wrap; }
  .ghost-btn { padding: 6px 11px; font-size: 10px; cursor: pointer; }

  .editorial-stage {
    left: 16px;
    right: 34px;
    width: auto;
    top: auto;
    bottom: 68px;
    transform: none;
    max-height: 58vh;
    overflow-y: auto;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(12, 10, 24, 0.52);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
  }
  .hero-title { font-size: clamp(1.85rem, 7.5vw, 2.6rem); margin-bottom: 10px; }
  .hero-summary { font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
  .hl-item { font-size: 12px; }
  .hero-ctas { margin-top: 14px; gap: 8px; }

  .progress-rail { right: 10px; gap: 10px; }
  .avatar-narrator { right: auto; left: 16px; top: 64px; bottom: auto; padding: 5px 11px 5px 5px; }
  .avatar-ring { width: 42px; height: 42px; }
  .narrate-btn { cursor: pointer; font-size: 10px; padding: 4px 10px; }
  .hud-bottom { padding: 14px 16px; justify-content: flex-end; }
  .arrow-btn { width: 34px; height: 34px; cursor: pointer; }
  .modal-card { padding: 18px; }
}

@media (max-height: 740px) and (min-width: 769px) {
  .hero-title { font-size: clamp(2.1rem, 4vw, 3.4rem); margin-bottom: 12px; }
  .hero-summary { font-size: 13.5px; margin-bottom: 14px; }
  .hero-highlights { gap: 6px; }
  .hero-ctas { margin-top: 14px; }
}
