/* Project modal + lightbox — extracted from work-new.html, scoped to #projectModal */
:root {
  --overlay:      rgba(0,0,0,0.82);
  --glass-bg:     rgba(255,255,255,0.034);
  --glass-border: rgba(255,255,255,0.06);
  --glass-hover:  rgba(255,255,255,0.07);
  --white:        #ffffff;
  --muted:        #a1a1aa;
  --dimmer:       #71717a;
  --accent:       #e8e8e8;
  --radius-card:  20px;
  --radius-sm:    12px;
  --radius-lg:    28px;
  --gap:          14px;
  --font-display: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
  --font-text:    -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
}

/* Typography — match work-new.html (isolate from index homepage * / body rules) */
#projectModal {
  font-family: var(--font-text);
  color: var(--white);
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

#projectModal .hero-content,
#projectModal .hero-eyebrow,
#projectModal .hero-title,
#projectModal .btn-watch,
#projectModal .modal-body,
#projectModal .section-label,
#projectModal .role-chip,
#projectModal .bento-card,
#projectModal .bc-value,
#projectModal .bc-label,
#projectModal .bc-sub {
  font-family: var(--font-display);
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

#projectModal .modal-hud,
#projectModal .modal-hud * {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-synthesis: none;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

/* ─────────────────────────────────────────────
   MODAL BACKDROP
───────────────────────────────────────────── */
#projectModal{
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;

  background: var(--overlay);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
          backdrop-filter: blur(28px) saturate(160%);

  /*
    translateZ(0) recruits a GPU compositing layer for the overlay in Safari.
    Without it, backdrop-filter can fall back to a solid color on WebKit.
    Using will-change instead of an inline transform avoids disrupting
    the opacity transition or breaking position:fixed children.
  */
  -webkit-transform: translateZ(0);
          transform: translateZ(0);
  will-change: opacity;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out);
}

#projectModal.is-open{
  opacity: 1;
  pointer-events: all;
}

/* ─────────────────────────────────────────────
   MODAL CONTAINER
───────────────────────────────────────────── */
#projectModal .modal-container{
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 120px;

  transform: translateY(48px) scale(0.975);
  transition: transform 0.55s var(--ease-spring);
}

#projectModal.is-open .modal-container{
  transform: translateY(0) scale(1);
}

/* ─────────────────────────────────────────────
   CLOSE BUTTON
───────────────────────────────────────────── */
#projectModal .modal-close{
  position: fixed;
  top: 28px; right: 28px;
  z-index: 9100;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--white);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s, transform 0.25s var(--ease-spring), border-color 0.25s;
  opacity: 0;
  pointer-events: none;
}

#projectModal.is-open .modal-close{
  opacity: 1;
  pointer-events: all;
  transition: background 0.25s, transform 0.25s var(--ease-spring), border-color 0.25s, opacity 0.45s 0.2s var(--ease-out);
}

#projectModal .modal-close:hover{
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.14);
  transform: scale(1.1) rotate(90deg);
}

#projectModal .modal-close svg{ pointer-events: none; }

/* ─────────────────────────────────────────────
   MODAL HERO SECTION
───────────────────────────────────────────── */
#projectModal .modal-hero{
  position: relative;
  width: 100%;
  min-height: 56vh;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  --deco-offset: 26px;
}

#projectModal .hero-bg{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: grayscale(100%) contrast(1.15) brightness(0.35);
  transform: scale(1.04);
  transform-origin: center center;
  overflow: visible;
  pointer-events: none;
  z-index: auto;
  /* will-change applied dynamically via JS only while the modal is open */
}

#projectModal.is-open .hero-bg{
  transform: scale(1);
  transition: transform 8s ease;
}

#projectModal .hero-noise{
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.55;
  pointer-events: none;
}

#projectModal .hero-gradient{
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.02) 0%,
    rgba(0,0,0,0.0)  30%,
    rgba(0,0,0,0.65) 70%,
    rgba(0,0,0,0.98) 100%
  );
}

#projectModal .hero-content{
  position: relative;
  z-index: 2;
  width: auto;
  max-width: none;
  padding: 48px 52px 52px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

#projectModal .hero-eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s 0.25s var(--ease-out), transform 0.5s 0.25s var(--ease-out);
  animation: none;
  text-align: left;
}

#projectModal.is-open .hero-eyebrow{ opacity: 1; transform: translateY(0); }

#projectModal .hero-eyebrow-dot{
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

#projectModal .hero-title{
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.0;
  color: var(--white);
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s 0.32s var(--ease-out), transform 0.6s 0.32s var(--ease-out);
  animation: none;
  filter: none;
}

#projectModal.is-open .hero-title{ opacity: 1; transform: translateY(0); }

/* ── Modal hero HUD overlays ── */
#projectModal .modal-hud{
  position: absolute;
  z-index: 3;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  pointer-events: none;
  user-select: none;
  line-height: 1.8;
}

#projectModal .modal-hud-timecode{
  top:          calc(var(--deco-offset) + 16px);
  left:         calc(var(--deco-offset) + 16px);
  writing-mode: vertical-rl;
  transform:    rotate(180deg);
  letter-spacing: 0.12em;
}

#projectModal .modal-hud-rec{
  top:          50%;
  left:         calc(var(--deco-offset) + 16px);
  transform:    translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  display:      flex;
  align-items:  center;
  gap:          6px;
  letter-spacing: 0.16em;
}

#projectModal .modal-hud-rec-dot{
  display:       inline-block;
  width:         5px; height: 5px;
  border-radius: 50%;
  background:    rgba(255,255,255,0.45);
  animation:     rec-blink 1.6s ease-in-out infinite;
}

#projectModal .modal-hud-status{
  top:        calc(var(--deco-offset) + 16px);
  right:      calc(var(--deco-offset) + 16px);
  text-align: right;
  letter-spacing: 0.1em;
}

#projectModal .modal-hud-status .hud-label{ color: rgba(255,255,255,0.4); }
#projectModal .modal-hud-status .hud-value-bright{ color: rgba(255,255,255,0.95); }
#projectModal .modal-hud-status .hud-value-dim{ color: rgba(255,255,255,0.4);  }

#projectModal .modal-hud-tc-bottom{
  bottom:         calc(var(--deco-offset) + 16px);
  right:          calc(var(--deco-offset) + 16px);
  font-size:      10px;
  letter-spacing: 0.12em;
  color:          rgba(255,255,255,0.28);
}

#projectModal .modal-hero-corner{
  position:      absolute;
  z-index:       3;
  width:         28px; height: 28px;
  pointer-events: none;
}

#projectModal .modal-hero-corner-tl{
  top:         var(--deco-offset); left:  var(--deco-offset);
  border-top:  1px solid rgba(255,255,255,0.22);
  border-left: 1px solid rgba(255,255,255,0.22);
}

#projectModal .modal-hero-corner-br{
  bottom:        var(--deco-offset); right:  var(--deco-offset);
  border-bottom: 1px solid rgba(255,255,255,0.22);
  border-right:  1px solid rgba(255,255,255,0.22);
}

/* Watch button — glass HUD (shared with 3D series index) */
#projectModal .btn-watch{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 100px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.94);
  border: 1px solid rgba(255,255,255,0.16);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35) inset;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s 0.42s var(--ease-out), transform 0.55s 0.42s var(--ease-spring), background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.35s;
}

#projectModal.is-open .btn-watch{ opacity: 1; transform: translateY(0); }

#projectModal .btn-watch::before{
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(255,255,255,0.14) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
}

#projectModal .btn-watch:hover,
#projectModal.is-open .btn-watch:hover{
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
  box-shadow: 0 0 32px rgba(255,255,255,0.08), 0 8px 28px rgba(0,0,0,0.35);
  transform: translateY(0);
}

#projectModal .btn-watch:hover::before{ opacity: 1; }
#projectModal .btn-watch svg{
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  color: currentColor;
}

/* MNMLSTG 3D design — series index · JP subtitle (e.g. 091 · ユーフォーボール) */
#projectModal .btn-watch.btn-watch--series-index{
  gap: 0;
}

#projectModal .btn-watch-series-label{
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  line-height: 1.15;
  white-space: nowrap;
}

#projectModal .btn-watch-series-jp{
  font-family: var(--font-display), 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

#projectModal .btn-watch-series-sep{
  margin: 0 0.35em;
  opacity: 0.42;
  font-weight: 400;
}

#projectModal .btn-watch-series-idx{
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

#projectModal .btn-watch-series-label .btn-watch-series-jp{
  opacity: 0.88;
}

/* ─────────────────────────────────────────────
   MODAL BODY
───────────────────────────────────────────── */
#projectModal .modal-body{
  padding: 40px 52px 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

#projectModal .section-label{
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin-bottom: 18px;
}

/* ─────────────────────────────────────────────
   ROLES / CHIPS
───────────────────────────────────────────── */
#projectModal .roles-wrap{ display: flex; flex-wrap: wrap; gap: 8px; }

#projectModal .role-chip{
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 100px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
  transition: background 0.25s, border-color 0.25s, transform 0.3s var(--ease-spring);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#projectModal .role-chip:hover{
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.12);
  transform: scale(1.04);
}

/* ─────────────────────────────────────────────
   BENTO META GRID
───────────────────────────────────────────── */
#projectModal .bento-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: auto;
  gap: var(--gap);
}

#projectModal .bento-card{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.28s, border-color 0.28s, transform 0.35s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

#projectModal .bento-card::before{
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
}

#projectModal .bento-card:hover{
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

#projectModal .bento-card .bc-label{
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin-bottom: 10px;
}

#projectModal .bento-card .bc-value{
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--white);
  line-height: 1.1;
}

#projectModal .bento-card .bc-sub{
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* Author display rules must not override native [hidden] (Safari/Firefox/Chrome) */
#projectModal [hidden]{
  display: none !important;
}

#projectModal .bc-year{ grid-column: span 3; }
#projectModal .bc-category{ grid-column: span 3; }
#projectModal .bc-color{ grid-column: span 3; }
#projectModal .bc-audio{ grid-column: span 3; }
#projectModal .bc-client{ grid-column: span 6; }
#projectModal .bc-duration{ grid-column: span 3; }
#projectModal .bc-format{ grid-column: span 3; }
#projectModal .bc-software{ grid-column: span 12; }

#projectModal .category-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 100px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
}

#projectModal .category-badge-dot{
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  display: block;
}

#projectModal .audio-waves{
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  margin-top: 6px;
}

#projectModal .audio-waves[hidden]{
  display: none !important;
}

#projectModal .audio-waves span{
  display: block;
  width: 3px;
  border-radius: 3px;
  background: var(--muted);
  animation: wave 1.2s ease-in-out infinite;
}

#projectModal .audio-waves span:nth-child(1){ height: 8px;  animation-delay: 0s; }
#projectModal .audio-waves span:nth-child(2){ height: 16px; animation-delay: 0.1s; }
#projectModal .audio-waves span:nth-child(3){ height: 22px; animation-delay: 0.2s; }
#projectModal .audio-waves span:nth-child(4){ height: 14px; animation-delay: 0.3s; }
#projectModal .audio-waves span:nth-child(5){ height: 10px; animation-delay: 0.15s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.4; }
  50%       { transform: scaleY(1);   opacity: 1; }
}

/* ─────────────────────────────────────────────
   CATEGORY BADGE — FLEX CONTAINER + PILL
───────────────────────────────────────────── */
#projectModal #metaCategory{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

#projectModal .meta-client-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 100px;
  background: rgba(255,255,255,0.95);
  color: #0a0a0a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#projectModal #metaCategoryText{
  text-transform: capitalize;
}

#projectModal .badge-text-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 100px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

#projectModal .badge-text-pill.instagram-badge{
  padding: 6px 14px 6px 11px;
  background: #121212;
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.82);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#projectModal .badge-text-pill::before{
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  display: block;
}

#projectModal .badge-text-pill.instagram-badge::before{
  display: none;
}

/* ─────────────────────────────────────────────
   AWARDS & RECOGNITION
───────────────────────────────────────────── */
#projectModal .awards-section{ display: none; }

#projectModal .awards-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--gap);
}

#projectModal .award-item{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 18px 16px;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.28s, border-color 0.28s, transform 0.35s var(--ease-spring);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#projectModal .award-item::before{
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.3), transparent);
}

#projectModal .award-item:hover{
  background: rgba(201,168,76,0.04);
  border-color: rgba(201,168,76,0.18);
  transform: translateY(-3px);
}

#projectModal .laurel-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2px;
}

#projectModal .laurel-icon{
  color: var(--muted);
  opacity: 0.95;
  width: 18px;
  height: 28px;
  line-height: 1;
  user-select: none;
}

#projectModal .laurel-gold{ color: var(--gold); }
#projectModal .laurel-silver{ color: #ffffff; }
#projectModal .laurel-muted{ color: var(--muted); }

#projectModal .award-status{
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.35;
  max-width: 100%;
}
#projectModal .award-status:empty{ display: none; }

#projectModal .award-title{
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--white);
  line-height: 1.35;
  max-width: 100%;
  text-wrap: balance;
}
#projectModal .award-title:empty{ display: none; }

#projectModal .award-event{
  font-size: 12px;
  font-weight: 400;
  color: var(--dimmer);
  line-height: 1.45;
  max-width: 100%;
  text-wrap: balance;
}
#projectModal .award-event:empty{ display: none; }

/* ─────────────────────────────────────────────
   PRESS & COVERAGE
───────────────────────────────────────────── */
#projectModal .press-list{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#projectModal .press-item{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-card);
  background: var(--card);
  border: 1px solid var(--glass-border);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

#projectModal .press-item::before{
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: rgba(255,255,255,0.08);
  transition: background 0.18s ease;
}

#projectModal .press-item:hover{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
}

#projectModal .press-item:hover::before{ background: rgba(255,255,255,0.35); }

#projectModal .press-item-left{
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

#projectModal .press-outlet{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

#projectModal .press-headline{
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

#projectModal .press-date{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dimmer);
  text-transform: uppercase;
}

#projectModal .press-arrow{
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#projectModal .press-item:hover .press-arrow{
  border-color: rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.8);
  transform: translate(2px, -2px);
}

/* ─────────────────────────────────────────────
   SOFTWARE STACK PILLS
───────────────────────────────────────────── */
#projectModal .software-pills{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

#projectModal .software-pill{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--accent);
  transition: background 0.22s, border-color 0.22s, transform 0.28s var(--ease-spring);
}

#projectModal .software-pill::before{
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

#projectModal .software-pill:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────
   VIDEO EMBED
───────────────────────────────────────────── */
#projectModal .video-wrap{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #080808;
  border: 1px solid var(--glass-border);
}

#projectModal .video-wrap.is-vertical{
  aspect-ratio: 9 / 16;
  max-width: 360px;
  margin: 0 auto;
}

/* Design mode — artwork at native aspect ratio, no video box chrome */
#videoSection.is-design-mode .video-wrap,
#projectModal .video-wrap.is-design-mode{
  aspect-ratio: auto;
  padding: 0;
  background: transparent;
  border: none;
  overflow: visible;
  max-width: none;
  margin: 0;
}

#projectModal .modal-container.modal-vertical .video-wrap.is-design-mode{
  aspect-ratio: auto;
  max-width: none;
  margin: 0;
}

#projectModal .video-wrap.is-design-mode .modal-feature-artwork{
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 80vh;
  max-height: min(80vh, 80dvh);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  background: none;
  border-radius: var(--radius-card);
  border: 1px solid var(--glass-border);
}

/* Story single-post — dedicated 9:16 phone frame (not poster-style contain) */
#projectModal .video-wrap.is-socmed-mode.is-stories-feature{
  display: flex;
  justify-content: center;
  align-items: center;
}

#projectModal .modal-socmed-stories-frame{
  position: relative;
  width: 100%;
  max-width: min(100%, 360px);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #0a0a0a;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.35),
    0 24px 64px rgba(0,0,0,0.5);
}

#projectModal .video-wrap.is-socmed-mode .modal-feature-artwork--stories{
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  aspect-ratio: unset;
  object-fit: cover;
  object-position: center;
  border: none;
  border-radius: 0;
  background: #0a0a0a;
}

/* Socmed modal — no placeholder play icon */
#projectModal .video-wrap.is-socmed-mode .video-placeholder{
  display: none !important;
}

/* Modal feature — socmed feed carousel (same engine as gallery cards) */
#projectModal .video-wrap.is-socmed-mode .modal-socmed-carousel{
  position: relative;
  width: 100%;
  max-width: min(100%, 440px);
  margin: 0 auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  background: #0a0a0a;
  aspect-ratio: 4 / 5;
}

#projectModal .video-wrap.is-socmed-mode .modal-socmed-carousel.gallery-card--feed-square{
  aspect-ratio: 1 / 1;
  max-width: min(100%, 520px);
}

#projectModal .video-wrap.is-socmed-mode .modal-socmed-carousel .card-socmed-shade{
  display: none !important;
}

#projectModal .video-wrap.is-socmed-mode .modal-socmed-carousel .card-carousel{
  position: absolute;
  inset: 0;
  overflow: hidden;
  contain: paint;
}

#projectModal .video-wrap.is-socmed-mode .modal-socmed-carousel .card-carousel-slide{
  overflow: hidden;
}

#projectModal .video-wrap.is-socmed-mode .modal-socmed-carousel .card-carousel-btn{
  opacity: 1;
  pointer-events: auto;
}

#projectModal .video-wrap.is-socmed-mode .modal-socmed-carousel .card-carousel-img{
  width: calc(100% + 2px);
  max-width: none;
  margin-left: -1px;
  object-fit: cover;
  object-position: center;
  transform: none;
}

#projectModal .video-wrap.is-socmed-mode .modal-socmed-carousel.gallery-card--feed-square .card-carousel-img{
  object-fit: cover;
}

.video-wrap iframe,
#projectModal .video-wrap video{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
}

/* YT embed: iframe never captures pointer — shield handles play/pause */
#projectModal .video-wrap.has-yt-embed iframe {
  pointer-events: none;
}

#projectModal .modal-yt-shield {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  cursor: none;
  background: transparent;
}

#projectModal .video-wrap video{
  object-fit: contain;
  background: #000;
}

/*
  Transparent hitbox that sits between the <video> Shadow DOM and our own
  click logic. Safari routes pointer events into the video's internal Shadow
  DOM (controls, progress bar, etc.) before they reach author-level listeners,
  so a click directly on <video> is often swallowed. An overlay div bypasses
  the Shadow DOM entirely and gives us a reliable, cross-browser click surface.
*/
#projectModal .video-click-overlay{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
  background: transparent;
}

/* ── Centered play-button overlay (local video only) ── */
#projectModal .modal-play-btn{
  position: absolute;
  top: 50%; left: 50%;
  /* translateZ(0) forces a GPU compositing layer — fixes Safari z-fighting with <video> */
  -webkit-transform: translate(-50%, -50%) scale(1) translateZ(0);
          transform: translate(-50%, -50%) scale(1) translateZ(0);
  z-index: 50;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.22s ease, -webkit-transform 0.22s ease, transform 0.22s ease, background 0.18s ease;
}

/* Explicit SVG size prevents render collapse in Safari */
#projectModal .modal-play-btn svg{
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}

#projectModal .modal-play-btn:hover{
  background: rgba(255, 255, 255, 0.20);
  -webkit-transform: translate(-50%, -50%) scale(1.1) translateZ(0);
          transform: translate(-50%, -50%) scale(1.1) translateZ(0);
}

#projectModal .modal-play-btn.is-hidden{
  opacity: 0;
  pointer-events: none;
  -webkit-transform: translate(-50%, -50%) scale(0.88) translateZ(0);
          transform: translate(-50%, -50%) scale(0.88) translateZ(0);
}

/* Touch — play always visible when paused; pause fades in then out while playing */
#projectModal .video-wrap.has-local-video-touch .modal-play-btn {
  transition:
    opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.14s ease;
}
#projectModal .video-wrap.has-local-video-touch .modal-play-btn.is-transport-hidden {
  opacity: 0;
  pointer-events: none;
  -webkit-transform: translate(-50%, -50%) scale(0.9) translateZ(0);
          transform: translate(-50%, -50%) scale(0.9) translateZ(0);
}
#projectModal .video-wrap.has-local-video-touch .modal-play-btn.is-transport-visible {
  opacity: 1;
  pointer-events: auto;
  -webkit-transform: translate(-50%, -50%) scale(1) translateZ(0);
          transform: translate(-50%, -50%) scale(1) translateZ(0);
}
#projectModal .video-wrap.has-local-video-touch .modal-play-btn.is-transport-visible:active {
  background: rgba(255, 255, 255, 0.20);
  -webkit-transform: translate(-50%, -50%) scale(1.06) translateZ(0);
          transform: translate(-50%, -50%) scale(1.06) translateZ(0);
}

/* Touch local video — hide native center play only; morphglass handles play/pause */
#projectModal .video-wrap.has-local-video-touch video::-webkit-media-controls-start-playback-button,
#projectModal .video-wrap.has-local-video-touch video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ─────────────────────────────────────────────
   MNMLSTG 3D TILT (gallery + modal feature)
───────────────────────────────────────────── */
#projectModal .tilt-surface .tilt-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-perspective: 900px;
  perspective: 900px;
  overflow: hidden;
  -webkit-transform: translate3d(0, 0, 0);
          transform: translate3d(0, 0, 0);
}

#projectModal .tilt-surface .tilt-content {
  position: relative;
  width: 100%;
  height: 100%;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: none;
}

#projectModal .tilt-surface .tilt-content.is-tilt-reset {
  -webkit-transition: -webkit-transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#projectModal .tilt-surface .tilt-content.is-gyro-driven {
  -webkit-transition: -webkit-transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition: transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#projectModal .tilt-surface.is-tilt-active .tilt-content {
  will-change: transform;
}

#projectModal .tilt-surface .tilt-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.12) brightness(0.42);
  -webkit-transform: translate3d(0, 0, 0) scale(1.05);
          transform: translate3d(0, 0, 0) scale(1.05);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: filter 0.55s ease, -webkit-transform 0.55s ease-out, transform 0.55s ease-out;
}

#projectModal .tilt-surface:hover .tilt-image,
#projectModal .tilt-surface .tilt-content:hover .tilt-image {
  filter: grayscale(0%) brightness(100%);
  -webkit-transform: translate3d(0, 0, 0) scale(1);
          transform: translate3d(0, 0, 0) scale(1);
}

#projectModal .tilt-surface .tilt-text {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%) translate3d(0, 0, 50px);
          transform: translate(-50%, -50%) translate3d(0, 0, 50px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  color: white;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 2;
}

#projectModal .tilt-surface .tilt-serial {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

#projectModal .tilt-surface .tilt-title {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.2;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#projectModal .tilt-surface .tilt-title em {
  font-style: italic;
}

#projectModal .tilt-surface .anim-text span {
  display: inline-block;
}

#projectModal .tilt-surface .blinking-active {
  animation: lf-tilt-blink 0.55s ease-in-out 2;
}

@keyframes lf-tilt-blink {
  0%, 100% { opacity: 1; }
  35%, 65% { opacity: 0.15; }
}

#projectModal .video-wrap .modal-tilt-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#projectModal .tilt-surface.is-tilt-active .tilt-image,
#projectModal .tilt-surface.is-gyro-driven .tilt-image {
  filter: grayscale(0%) brightness(100%);
  -webkit-transform: translate3d(0, 0, 0) scale(1);
          transform: translate3d(0, 0, 0) scale(1);
}

#projectModal .video-wrap.has-modal-tilt .video-placeholder {
  display: none !important;
}

#projectModal .tilt-container.in-modal {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#projectModal .tilt-container.in-modal .tilt-image {
  object-fit: contain;
  -webkit-transform: translate3d(0, 0, 0) scale(1);
          transform: translate3d(0, 0, 0) scale(1);
}

#projectModal .tilt-container.in-modal .tilt-content:hover .tilt-image,
#projectModal .tilt-surface:hover .tilt-container.in-modal .tilt-image {
  -webkit-transform: translate3d(0, 0, 0) scale(1);
          transform: translate3d(0, 0, 0) scale(1);
}

#projectModal .video-placeholder{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--dimmer);
}

#projectModal .video-placeholder svg{ opacity: 0.35; }
#projectModal .video-placeholder p{ font-size: 0.82rem; letter-spacing: 0.04em; }

/* ─────────────────────────────────────────────
   STILLS SLIDESHOW
───────────────────────────────────────────── */
#projectModal .slideshow-wrap{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #080808;
  border: 1px solid var(--glass-border);
}
#projectModal .slideshow-wrap.is-vertical{
  aspect-ratio: 9 / 16;
  max-width: 360px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────
   MODAL VERTICAL MODE  (portrait / 9:16 projects)
   Applied by JS via .modal-vertical on #modalContainer.
   The hero header always stays full-width; ONLY the media
   wrappers (video / slideshow) are locked to a 9:16 frame.
───────────────────────────────────────────── */

/* Video embed: portrait frame, centered, full header width untouched */
#projectModal .modal-container.modal-vertical .video-wrap{
  aspect-ratio: 9 / 16;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

/* Slideshow / stills: same portrait frame */
#projectModal .modal-container.modal-vertical .slideshow-wrap{
  aspect-ratio: 9 / 16;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

/* Slide images fill the portrait frame cleanly */
#projectModal .modal-container.modal-vertical .slide-image{
  object-fit: cover;
}

/* Play-button and transparent hitbox: remain precisely centered
   in vertical mode — absolute + translate(-50%,-50%) already handles this. */

#projectModal .slide-image{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 0;
  transition: none;
}

#projectModal .slide-image.slide-active{ opacity: 1; z-index: 1; }

/* Numeric counter — bottom-right of the slideshow frame */
#projectModal .slideshow-hud{
  position: absolute;
  bottom: 13px;
  right: 15px;
  z-index: 3;
  pointer-events: none;
}

#projectModal .slideshow-num{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  line-height: 1;
  display: block;
}

/* Thin progress bar — pinned to the bottom edge of the slideshow frame */
#projectModal .slideshow-progress{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.07);
  z-index: 3;
  pointer-events: none;
}

#projectModal .slideshow-progress-fill{
  height: 100%;
  background: rgba(255,255,255,0.45);
  width: 0%;
  transition: width 0.22s ease;
}

#projectModal .slideshow-nav-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10,10,10,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.55);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  padding: 0;
}

#projectModal .slideshow-wrap:hover .slideshow-nav-btn{ opacity: 1; }

#projectModal .slideshow-nav-btn:hover{
  background: rgba(20,20,20,0.65);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
}

#projectModal .slideshow-prev{ left: 12px; }
#projectModal .slideshow-next{ right: 12px; }

/* ─────────────────────────────────────────────
   TECHNICAL BREAKDOWN
───────────────────────────────────────────── */
#projectModal .technical-breakdown-section{ display: none; }

#projectModal .technical-breakdown-card{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: background 0.28s, border-color 0.28s;
}

#projectModal .technical-breakdown-card::before{
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

#projectModal .technical-breakdown-card::after{
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.18) 20%, rgba(255,255,255,0.18) 80%, transparent 100%);
}

#projectModal .breakdown-hud-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 14px 32px;
  border-bottom: 1px solid var(--glass-border);
}

#projectModal .breakdown-hud-left{ display: flex; align-items: center; gap: 10px; }

#projectModal .breakdown-hud-icon{
  width: 26px; height: 26px;
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

#projectModal .breakdown-hud-icon svg{ opacity: 0.6; }

#projectModal .breakdown-hud-label{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dimmer);
}

#projectModal .breakdown-hud-right{ display: flex; align-items: center; gap: 16px; }

#projectModal .breakdown-hud-stat{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
}

#projectModal .breakdown-hud-stat span{ color: rgba(255,255,255,0.45); }

#projectModal .breakdown-prose{
  padding: 36px 40px 32px 40px;
  max-width: 750px;
  margin: 0 auto;
}

#projectModal .breakdown-prose h3{
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 28px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
  line-height: 1.3;
}

#projectModal .breakdown-prose h3:first-child{ margin-top: 0; }

#projectModal .breakdown-prose p{
  font-size: 0.92rem;
  line-height: 1.78;
  color: var(--muted);
  margin: 0 0 14px;
}

#projectModal .breakdown-prose p:last-child{ margin-bottom: 0; }
#projectModal .breakdown-prose strong{ color: var(--accent); font-weight: 500; }

#projectModal .breakdown-prose code{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  padding: 1px 6px;
}

/* ─────────────────────────────────────────────
   PIPELINE
───────────────────────────────────────────── */
#projectModal .pipeline-container{
  margin: 16px 0 8px;
  padding: 28px 20px 24px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  background: rgba(0,0,0,0.3);
  overflow-x: auto;
  position: relative;
}

#projectModal .pipeline-container::before{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,0.008) 3px, rgba(255,255,255,0.008) 4px);
  pointer-events: none;
}

#projectModal .pipeline-track{
  display: flex;
  align-items: flex-start;
  min-width: max-content;
  gap: 0;
  position: relative;
  z-index: 1;
}

#projectModal .pipeline-step{
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 130px;
  flex-shrink: 0;
}

#projectModal .pipeline-node{
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  position: relative;
  z-index: 2;
  transition: background 0.3s, border-color 0.3s, transform 0.3s var(--ease-spring);
}

.pipeline-step:first-child .pipeline-node,
#projectModal .pipeline-step:last-child .pipeline-node{
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.38);
  color: rgba(255,255,255,0.8);
}

#projectModal .pipeline-step:hover .pipeline-node{
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
  transform: scale(1.08);
}

#projectModal .pipeline-connector{
  flex: 1;
  min-width: 24px;
  height: 1px;
  margin-top: 20px;
  background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.08) 100%);
  position: relative;
  flex-shrink: 0;
}

#projectModal .pipeline-connector::after{
  content: '';
  position: absolute;
  right: -1px; top: -3px;
  width: 7px; height: 7px;
  border-top:   1px solid rgba(255,255,255,0.2);
  border-right: 1px solid rgba(255,255,255,0.2);
  transform: rotate(45deg);
}

#projectModal .pipeline-step-label{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  margin-top: 12px;
  text-align: center;
  line-height: 1.3;
}

#projectModal .pipeline-step-detail{
  font-size: 0.66rem;
  color: rgba(255,255,255,0.28);
  text-align: center;
  margin-top: 6px;
  line-height: 1.5;
  padding: 0 6px;
  max-width: 120px;
}

/* ─────────────────────────────────────────────
   INLINE ATTACHMENT CITATIONS
───────────────────────────────────────────── */
#projectModal .inline-attachment{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.62);
  cursor: pointer;
  border-radius: 5px;
  padding: 1px 6px 1px 5px;
  margin: 0 1px;
  background: rgba(255,255,255,0.042);
  border: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  vertical-align: middle;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s var(--ease-spring);
}

#projectModal .inline-attachment:hover{
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

#projectModal .ia-icon{
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

#projectModal .inline-attachment:hover .ia-icon{ opacity: 0.85; }

/* ─────────────────────────────────────────────
   ATTACHMENT THUMBNAILS
───────────────────────────────────────────── */
#projectModal .breakdown-attachments-section{
  border-top: 1px solid var(--glass-border);
  padding: 20px 40px 28px;
  max-width: 750px;
  margin: 0 auto;
  width: 100%;
}

#projectModal .breakdown-attachments-header{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

#projectModal .breakdown-attachments-label{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
}

#projectModal .breakdown-attachments-count{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 1px 7px;
}

#projectModal .attachments-grid{ display: flex; flex-wrap: wrap; gap: 10px; }

#projectModal .attachment-thumb{
  position: relative;
  width: 108px; height: 108px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color 0.25s, transform 0.3s var(--ease-spring), background 0.25s;
}

#projectModal .attachment-thumb:hover{
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-3px) scale(1.02);
  background: rgba(255,255,255,0.055);
}

#projectModal .attachment-thumb-preview{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(100%) blur(6px) brightness(0.28);
  transform: scale(1.1);
  transition: filter 0.4s;
}

#projectModal .attachment-thumb:hover .attachment-thumb-preview{
  filter: grayscale(100%) blur(2px) brightness(0.45);
}

#projectModal .attachment-thumb-icon{
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.25s, border-color 0.25s;
}

#projectModal .attachment-thumb:hover .attachment-thumb-icon{
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

#projectModal .attachment-thumb-icon svg{ opacity: 0.65; transition: opacity 0.25s; }
#projectModal .attachment-thumb:hover .attachment-thumb-icon svg{ opacity: 0.9; }

#projectModal .attachment-thumb-caption{
  position: relative;
  z-index: 2;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 0 8px;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#projectModal .attachment-thumb-expand{
  position: absolute;
  bottom: 7px; right: 7px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}

#projectModal .attachment-thumb:hover .attachment-thumb-expand{ opacity: 1; }

/* ─────────────────────────────────────────────
   LIGHTBOX OVERLAY
───────────────────────────────────────────── */
#lightboxOverlay{
  position: fixed;
  inset: 0;
  z-index: 99000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(24px) saturate(0%);
  -webkit-backdrop-filter: blur(24px) saturate(0%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}

#lightboxOverlay.lb-open{ opacity: 1; pointer-events: all; }

#lightboxOverlay .lightbox-close{
  position: fixed;
  top: 24px; right: 24px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.25s var(--ease-spring), border-color 0.2s;
}

#lightboxOverlay .lightbox-close:hover{
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.25);
  transform: scale(1.1) rotate(90deg);
}

#lightboxOverlay .lightbox-body{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 90vw;
  max-height: 90vh;
  padding: 24px;
}

#lightboxImg{
  max-width: 100%;
  max-height: 78vh;
  width: auto; height: auto;
  object-fit: contain;
  filter: grayscale(100%) contrast(1.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  transform: scale(0.96);
  transition: transform 0.4s var(--ease-spring), filter 0.4s;
}

#lightboxOverlay.lb-open #lightboxImg{ transform: scale(1); }

#lightboxOverlay .lightbox-meta{ display: flex; align-items: center; gap: 14px; }

#lightboxCaption{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

#lightboxOverlay .lightbox-counter{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.2);
  white-space: nowrap;
}

#lightboxOverlay .lightbox-nav{
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.25s var(--ease-spring);
}

#lightboxOverlay .lightbox-nav:hover{ background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.22); }
#lightboxOverlay .lightbox-nav-prev{ left: 20px; }
#lightboxOverlay .lightbox-nav-next{ right: 20px; }
#lightboxOverlay .lightbox-nav-prev:hover{ transform: translateY(-50%) translateX(-2px); }
#lightboxOverlay .lightbox-nav-next:hover{ transform: translateY(-50%) translateX(2px); }

/* ─────────────────────────────────────────────
   BEFORE & AFTER SLIDER
───────────────────────────────────────────── */
#projectModal .before-after-section{ display: none; }

#projectModal .ba-pairs-wrap{ display: flex; flex-direction: column; gap: 18px; }

#projectModal .ba-pair-label{
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin-bottom: 10px;
}

#projectModal .ba-slider{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #080808;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}

#projectModal .ba-slider img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
#projectModal .ba-img-after{ z-index: 2; clip-path: inset(0 0 0 50%); }
#projectModal .ba-img-before{ z-index: 1; }

.ba-label-before,
#projectModal .ba-label-after{
  position: absolute;
  bottom: 18px;
  z-index: 4;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

#projectModal .ba-label-before{ left: 18px;  background: rgba(0,0,0,0.55); color: rgba(255,255,255,0.5); }
#projectModal .ba-label-after{ right: 18px; background: rgba(0,0,0,0.55); color: rgba(255,255,255,0.85); }

#projectModal .ba-divider{
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: rgba(255,255,255,0.5);
  z-index: 5;
  transform: translateX(-50%);
  pointer-events: none;
}

.ba-slider:hover .ba-divider,
#projectModal .ba-slider.is-dragging .ba-divider{ background: rgba(255,255,255,0.85); }

#projectModal .ba-handle{
  position: absolute;
  top: 50%; left: 50%; z-index: 6;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  transition: background 0.2s, border-color 0.2s;
}

.ba-slider:hover .ba-handle,
#projectModal .ba-slider.is-dragging .ba-handle{
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.55);
}

/* ─────────────────────────────────────────────
   STAGGERED FADE-IN
───────────────────────────────────────────── */
#projectModal .fade-up{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

#projectModal.is-open .fade-up{ opacity: 1; transform: translateY(0); }

#projectModal .delay-1{ transition-delay: 0.45s; }
#projectModal .delay-2{ transition-delay: 0.52s; }
#projectModal .delay-3{ transition-delay: 0.60s; }
#projectModal .delay-4{ transition-delay: 0.68s; }
#projectModal .delay-5{ transition-delay: 0.75s; }
#projectModal .delay-6{ transition-delay: 0.82s; }

/* ─────────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────────── */
#projectModal::-webkit-scrollbar{ width: 6px; }
#projectModal::-webkit-scrollbar-track{ background: transparent; }
#projectModal::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
}

/* ─────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────── */
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.12; }
}

/* ─────────────────────────────────────────────
   RESPONSIVE — MODAL
───────────────────────────────────────────── */
@media (max-width: 768px) {
  #projectModal .hero-content { padding: 36px 24px 40px; }
  #projectModal .modal-body   { padding: 32px 20px 0; }
  #projectModal .modal-close  { top: 16px; right: 16px; }

  #projectModal .bc-year,
  #projectModal .bc-category,
  #projectModal .bc-color,
  #projectModal .bc-audio,
  #projectModal .bc-duration,
  #projectModal .bc-format   { grid-column: span 6; }
  #projectModal .bc-client   { grid-column: span 12; }
  #projectModal .bc-software { grid-column: span 12; }

  #projectModal .hero-title  { font-size: clamp(2rem, 9vw, 3rem); }

  /* Wider framing — less object-fit crop on portrait viewports; same 1.04→1 Ken Burns */
  #projectModal .modal-hero {
    min-height: 40vh;
  }

  #projectModal .hero-bg {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 130%;
    height: 130%;
    object-position: center 40%;
    transform: translate(-50%, -50%) scale(1.04);
  }

  #projectModal.is-open .hero-bg {
    transform: translate(-50%, -50%) scale(1);
    transition: transform 8s ease;
  }

  #projectModal .btn-watch {
    padding: 10px 18px;
    font-size: 0.68rem;
    gap: 6px;
  }

  #projectModal .btn-watch.btn-watch--series-index {
    gap: 0;
  }

  #projectModal .btn-watch-series-idx,
  #projectModal .btn-watch-series-jp {
    font-size: 0.68rem;
  }

  #projectModal .btn-watch svg {
    width: 11px;
    height: 11px;
  }

  #projectModal .breakdown-prose               { padding: 28px 24px 24px; }
  #projectModal .breakdown-attachments-section { padding: 16px 24px 24px; }

  #lightboxOverlay .lightbox-nav-prev { left: 8px; }
  #lightboxOverlay .lightbox-nav-next { right: 8px; }
}

@media (max-width: 480px) {
  #projectModal .bc-year,
  #projectModal .bc-category,
  #projectModal .bc-color,
  #projectModal .bc-audio,
  #projectModal .bc-duration,
  #projectModal .bc-format   { grid-column: span 6; }
  #projectModal .bc-client   { grid-column: span 12; }
  #projectModal .bc-software { grid-column: span 12; }
}