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

:root {
  --bg: #FDF9F0;
  --bg-warm: #F3EDE3;
  --bg-card: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #555;
  --text-muted: #999;
  --text-light: #C0B9AD;
  --accent: #C1272D;

  --color-film: #8A7BAE;
  --color-tv: #5B8FA8;
  --color-franchise: #AE6A4D;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.04);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overscroll-behavior: none;
  position: relative;
  width: 100%;
}

/* === NOISE === */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}


/* ============================================================
   INTRO
   ============================================================ */

.intro {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 28px;
  position: relative;
}

.intro::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(193, 39, 45, 0.03) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.intro-eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.2s forwards;
}

/* ER stills strip */
.intro-stills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.3s forwards;
}

.intro-still {
  width: 120px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--bg-card);
}

.intro-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.intro-still-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.06);
  z-index: 2;
}

.intro-still-photo img {
  object-position: center 15%;
}

.intro-still-placeholder {
  background: var(--bg-warm);
  border-color: var(--bg-warm);
}

/* Episode chips */
.intro-episodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.55s forwards;
}

.intro-ep {
  background: var(--bg-warm);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.intro-ep span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}

.intro-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 14vw, 100px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -3px;
  color: var(--text);
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.4s forwards;
}

.intro-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.6s forwards;
}

.intro-line {
  width: 40px;
  height: 1px;
  background: var(--text-light);
  margin: 0 auto 20px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.7s forwards;
}

.intro-bio {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.8s forwards;
}

.intro-cta {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 1.2s forwards;
}

.intro-cta svg {
  animation: gentleBounce 2.5s ease-in-out infinite;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}


/* ============================================================
   UNIVERSE — POSITIONED NODE CANVAS
   ============================================================ */

.universe {
  position: relative;
  width: 100%;
  overflow: visible;
}

.connections {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.connections line {
  stroke: var(--text-light);
  stroke-width: 1;
  opacity: 0.3;
  transition: opacity 0.3s var(--ease), stroke 0.3s var(--ease);
}

.connections line.highlight {
  opacity: 0.7;
  stroke-width: 1.5;
}

.connections line[data-cat="film"] { stroke: var(--color-film); }
.connections line[data-cat="tv"] { stroke: var(--color-tv); }
.connections line[data-cat="franchise"] { stroke: var(--color-franchise); }
.connections line[data-cat="connection"] { stroke: var(--accent); }
.connections line[data-cat="commentary"] { stroke: var(--accent); stroke-dasharray: 4 4; }
.connections line[data-cat="info"] { stroke: var(--text-light); stroke-dasharray: 3 3; }

.nodes {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}


/* === CENTER NODE (Person) === */

.node-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
  transform: translate(-50%, -50%);
}

.node-center-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.06);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.node-center-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.node-center:hover .node-center-photo {
  transform: scale(1.08);
  box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent);
}

.node-center-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

.node-center-sub {
  font-size: 11px;
  color: #1A1A1A;
  font-weight: 400;
}



/* === PROJECT NODES === */

.node {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.25s var(--ease), z-index 0s;
  -webkit-tap-highlight-color: transparent;
  z-index: 3;
}

.node:hover {
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 20;
}

.node:active {
  transform: translate(-50%, -50%) scale(1.04);
}

.node-poster {
  width: 72px;
  height: 108px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-warm);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--bg-card);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.node:hover .node-poster {
  box-shadow: var(--shadow-lg);
}

.node[data-cat="film"]:hover .node-poster { border-color: var(--color-film); }
.node[data-cat="tv"]:hover .node-poster { border-color: var(--color-tv); }
.node[data-cat="franchise"]:hover .node-poster { border-color: var(--color-franchise); }

.node-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.node-poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
}

.node-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.node-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.node-year {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Significance — bigger nodes for more important projects */
.node.sig-5 .node-poster {
  width: 88px;
  height: 132px;
  border-radius: 10px;
}

.node.sig-4 .node-poster {
  width: 80px;
  height: 120px;
  border-radius: 9px;
}

.node.sig-2 .node-poster {
  width: 60px;
  height: 90px;
  border-radius: 7px;
}

/* === CONNECTION NODES — poster shape with face === */

.node-conn .node-poster {
  border-color: var(--accent);
}

.node-conn:hover .node-poster {
  border-color: var(--accent);
}

.node-conn .node-year {
  color: var(--accent);
  font-weight: 500;
}

/* === TEXT TILE NODES (quote, awards, bio, moment, commentary) === */

.node-poster-text {
  display: flex;
  align-items: center;
  padding: 8px;
  background: var(--bg-card);
}

.node-poster-text[data-type="quote"] {
  background: var(--bg-warm);
}

.node-poster-text[data-type="awards"] {
  background: linear-gradient(135deg, #FFF8E7, #FDF2D0);
}

.node-poster-text[data-type="commentary"] {
  background: linear-gradient(135deg, #F5EFEF, #F0E8E8);
}

.node-poster-text-inner {
  font-size: 8px;
  line-height: 1.4;
  color: #1A1A1A;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
}

/* Node entrance animation */
.node, .node-center {
  opacity: 0;
  transition: opacity 0.5s var(--ease), transform 0.25s var(--ease);
}

.node.visible, .node-center.visible {
  opacity: 1;
}


/* === ACTIVE NODE STATE === */

.node.active {
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 20;
}

.node.active .node-poster {
  box-shadow: var(--shadow-lg);
}

.node[data-cat="film"].active .node-poster { border-color: var(--color-film); }
.node[data-cat="tv"].active .node-poster { border-color: var(--color-tv); }
.node[data-cat="franchise"].active .node-poster { border-color: var(--color-franchise); }


/* ============================================================
   INLINE DETAIL SECTION
   ============================================================ */

.detail-section {
  display: none;
}

.detail-content {
  padding: 0;
}

.detail-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.detail-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.detail-poster {
  width: 90px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.detail-poster img {
  width: 100%;
  display: block;
}

.detail-cat {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
}

.detail-year {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-right {
  flex: 1;
  min-width: 0;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 6px;
}

.detail-role {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.detail-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.detail-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* === NODE POPUP — inline detail at clicked position === */

.node-popup {
  position: absolute;
  z-index: 30;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.node-popup.visible {
  opacity: 1;
  transform: translateY(0);
}

.node-popup-inner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-lg);
}

.node-popup-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.node-popup-role {
  font-size: 12px;
  color: #1A1A1A;
  margin-bottom: 4px;
}

.node-popup-meta {
  font-size: 11px;
  color: #1A1A1A;
  margin-bottom: 4px;
}

.node-popup-desc {
  font-size: 11px;
  line-height: 1.5;
  color: #1A1A1A;
}


/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  text-align: center;
  padding: 40px 28px 80px;
}

.footer-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.footer-accent {
  color: var(--accent);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* === GRID LAYOUT OVERRIDES === */

.universe {
  padding: 20px 0 60px;
}

.node-center-photo {
  width: 80px;
  height: 80px;
  border-width: 3px;
}

.node-center-label {
  font-size: 13px;
}

.connections line {
  opacity: 0.15;
  stroke-width: 0.5;
}

.connections line.highlight {
  opacity: 0.5;
  stroke-width: 1;
}

/* Uniform poster sizes in grid */
.node .node-poster,
.node.sig-5 .node-poster,
.node.sig-4 .node-poster,
.node.sig-2 .node-poster {
  width: 60px;
  height: 90px;
  border-radius: 6px;
}

.node-name {
  font-size: 8px;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-year {
  font-size: 7px;
}

.node-label {
  top: calc(100% + 4px);
}


@media (max-width: 599px) {
  .intro-title {
    font-size: clamp(44px, 14vw, 64px);
    letter-spacing: -2px;
  }

  .intro-bio {
    font-size: 15px;
  }

  .intro-still {
    width: 80px;
    height: 48px;
  }

  .intro-still-photo {
    width: 68px;
    height: 68px;
  }

  .intro-stills {
    gap: 8px;
  }

  .intro-episodes {
    gap: 6px;
  }

  .intro-ep {
    font-size: 10px;
    padding: 5px 10px;
  }

  .detail-section {
    padding: 0 16px;
  }

  .detail-section.active {
    padding: 0 16px 40px;
  }

  .detail-inner {
    padding: 12px;
    gap: 12px;
  }

  .detail-poster {
    width: 76px;
  }

  .detail-title {
    font-size: 18px;
  }

  .detail-desc {
    font-size: 12px;
  }
}

/* Desktop intro — scale up to fill vertical space */
@media (min-width: 768px) {
  .intro-eyebrow {
    font-size: 13px;
    letter-spacing: 5px;
    margin-bottom: 24px;
  }

  .intro-still {
    width: 180px;
    height: 108px;
    border-radius: 10px;
  }

  .intro-still-photo {
    width: 140px;
    height: 140px;
    border: 4px solid var(--bg-card);
  }

  .intro-stills {
    gap: 20px;
    margin-bottom: 28px;
  }

  .intro-title {
    font-size: 120px;
    letter-spacing: -4px;
    margin-bottom: 14px;
  }

  .intro-subtitle {
    font-size: 17px;
    margin-bottom: 28px;
  }

  .intro-episodes {
    gap: 10px;
    margin-bottom: 24px;
  }

  .intro-ep {
    font-size: 14px;
    padding: 8px 18px;
  }

  .intro-line {
    width: 50px;
    margin-bottom: 28px;
  }

  .intro-bio {
    font-size: 17px;
    max-width: 540px;
  }

  .intro-cta {
    margin-top: 36px;
    font-size: 15px;
  }
}

