/* ============================================
   BRILLION STUDIO - SHOWCASE PAGE
   Pinned mockup crossfade with GSAP delight
   ============================================ */

.showcase-body {
  overflow-x: hidden;
}

/* Hide the default nav on showcase (kept in DOM for script.js) */
.showcase-body > .nav { display: none !important; }

/* ---------- INTEGRATED SHOWCASE NAV (glass pill, matches View Case Study button) ---------- */
.sc-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  /* Dark mode: dimmed pill with visible border + blur so it reads against
     the dark mockup backgrounds without overpowering the image. */
  background: rgba(20, 20, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: #f5eee3;
  max-width: calc(100vw - 32px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
[data-theme="light"] .sc-nav {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(26, 24, 20, 0.12);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  color: #1a1814;
}

.sc-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.sc-nav__mark {
  width: 26px;
  height: 26px;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sc-nav__mark img { width: 100%; height: 100%; object-fit: contain; }
.sc-nav__wordmark {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: inherit;
}
/* Hide wordmark on mid widths to save horizontal space */
@media (max-width: 1100px) {
  .sc-nav__wordmark { display: none; }
}

.sc-nav__links {
  display: none; /* Glass pill intentionally minimal — all nav via hamburger drawer */
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.sc-nav__links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0.72;
  transition: opacity 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.sc-nav__links a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .sc-nav__links a:hover {
  background: rgba(0, 0, 0, 0.04);
}
.sc-nav__links a.is-active {
  opacity: 1;
  color: var(--accent);
}

/* Dynamic overflow "More" dropdown for the glass pill */
.sc-nav__more-item {
  position: relative;
  list-style: none;
}
.sc-nav__more-item.is-empty { display: none; }
.sc-nav__more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 10px 14px;
  border-radius: 999px;
  opacity: 0.72;
  cursor: pointer;
  transition: opacity 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.sc-nav__more-btn:hover,
.sc-nav__more-item.is-open .sc-nav__more-btn {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .sc-nav__more-btn:hover,
[data-theme="light"] .sc-nav__more-item.is-open .sc-nav__more-btn {
  background: rgba(26, 24, 20, 0.06);
}
.sc-nav__more-btn svg {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sc-nav__more-item.is-open .sc-nav__more-btn svg {
  transform: rotate(180deg);
}
.sc-nav__more-tray {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px) scale(0.98);
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(14, 14, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}
[data-theme="light"] .sc-nav__more-tray {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(26, 24, 20, 0.18);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}
.sc-nav__more-item.is-open .sc-nav__more-tray {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}
.sc-nav__more-tray > li { list-style: none; }
.sc-nav__more-tray a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  opacity: 0.78;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.sc-nav__more-tray a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .sc-nav__more-tray a:hover {
  background: rgba(26, 24, 20, 0.04);
}
.sc-nav__more-tray a.is-active {
  opacity: 1;
  color: var(--accent);
}

.sc-nav__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
/* Shared icon button style — theme toggle + mail */
.sc-nav__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: 0.75;
  text-decoration: none;
  transition: opacity 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.sc-nav__icon:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}
[data-theme="light"] .sc-nav__icon:hover {
  background: rgba(26, 24, 20, 0.06);
  color: var(--accent);
}
.sc-nav__theme-icon {
  position: absolute;
  transition: opacity 0.25s ease, transform 0.3s ease;
}
.sc-nav__theme-icon--dark  { opacity: 1; }
.sc-nav__theme-icon--light { opacity: 0; transform: rotate(-45deg); }
[data-theme="light"] .sc-nav__theme-icon--dark  { opacity: 0; transform: rotate(45deg); }
[data-theme="light"] .sc-nav__theme-icon--light { opacity: 1; transform: rotate(0deg); }

.sc-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: transform 0.18s ease, background 0.18s ease;
  position: relative;
  overflow: hidden;
}
.sc-nav__cta:hover { background: #e82900; transform: translateY(-1px); }
.sc-nav__cta .sc-arrow { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.sc-nav__cta:hover .sc-arrow { transform: translateX(4px); }

.sc-nav__mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.sc-nav__mobile-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sc-nav__mobile-toggle span:first-child { transform: translate(-50%, calc(-50% - 3px)); }
.sc-nav__mobile-toggle span:last-child  { transform: translate(-50%, calc(-50% + 3px)); }
.sc-nav__mobile-toggle[aria-expanded="true"] span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}
.sc-nav__mobile-toggle[aria-expanded="true"] span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Showcase now uses the shared .site-drawer from styles.css */

/* Hamburger shown at all widths (matches main nav mobile pattern) */
.sc-nav__mobile-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.25s ease, background 0.25s ease;
}
.sc-nav__mobile-toggle:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .sc-nav__mobile-toggle:hover { background: rgba(26, 24, 20, 0.06); }

/* Collapse inline links & CTA on smaller widths (all enter via drawer).
   Aligned to the main nav's 1100px breakpoint so tablet behavior matches
   site-wide. */
@media (max-width: 1100px) {
  .sc-nav__links { display: none; }
  .sc-nav__cta { display: none; }
}
@media (max-width: 480px) {
  .sc-nav { padding: 6px 6px 6px 16px; }
}


/* ---------- LOCKED RAIL ---------- */
.sc-rail {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}
.sc-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  transition: var(--transition-theme);
}

/* Mockup layers — edge to edge, stacked */
.sc-mockups {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.sc-mockup {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity;
}
.sc-mockup.is-active {
  opacity: 1;
}
.sc-mockup__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Edge-to-edge vignette for overlay readability */
.sc-mockup::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0) 100%),
    linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 50%);
  pointer-events: none;
}

/* Overlay layers */
.sc-overlays {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.sc-overlay {
  position: absolute;
  left: 6vw;
  bottom: 8vh;
  max-width: 620px;
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  visibility: hidden;
  z-index: 1;
  will-change: opacity, transform;
  transition: visibility 0s linear 0.35s; /* delay hide until fade-out completes */
}
.sc-overlay.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  z-index: 2; /* always on top so nothing else can intercept taps on it */
  transition: visibility 0s linear 0s;
}
/* Inactive overlays and every descendant are non-interactive — the active
   overlay is always on top via z-index, and inactive ones are visibility:hidden
   after their opacity fade-out so they can't capture pointer events. */
.sc-overlay:not(.is-active),
.sc-overlay:not(.is-active) * {
  pointer-events: none !important;
}
.sc-overlay__cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.sc-overlay__label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.sc-overlay__name {
  font-size: clamp(40px, 6.2vw, 84px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #f5eee3;
  margin: 0;
}
[data-theme="light"] .sc-overlay__name { color: #fff; }
.sc-overlay__meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin: 0;
}
.sc-overlay__desc {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
  max-width: 520px;
  margin: 0;
}
.sc-overlay__metrics {
  display: flex;
  gap: 40px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.sc-metric__val {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.sc-metric__lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

/* Desktop: hide the toggle button — metrics live on the right edge already */
@media (min-width: 1025px) {
  .sc-overlay__metrics-toggle { display: none; }
}

/* Mobile / tablet: hide metrics by default, reveal when is-metrics-open */
@media (max-width: 1024px) {
  .sc-overlay__metrics {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease,
                margin-top 0.4s ease,
                padding 0.4s ease;
  }
  .sc-overlay.is-metrics-open .sc-overlay__metrics {
    max-height: 320px;
    opacity: 1;
    margin-top: 24px;
    padding-top: 22px;
    padding-bottom: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  /* When open, lift the overlay up so it doesn't clip against the viewport bottom */
  .sc-overlay.is-metrics-open {
    bottom: 4vh;
  }
  /* Actions row: wrap on narrow so toggle sits nicely next to CTA */
  .sc-overlay__actions {
    flex-wrap: wrap;
    gap: 10px;
  }
}
/* Safety: never show toggle on desktop */
@media (min-width: 1025px) {
  .sc-overlay__metrics-toggle { display: none !important; }
  .sc-overlay__actions { gap: 0; }
}

/* Desktop: overlay spans full stage so metrics can float to the right edge */
@media (min-width: 1025px) {
  .sc-overlay {
    inset: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
  }
  /* Left cluster: bottom-left, flex column with generous gaps so no squishing */
  .sc-overlay__cluster {
    position: absolute;
    left: 6vw;
    bottom: 8vh;
    right: auto;
    max-width: min(680px, 52vw);
    gap: 22px;
  }
  /* Tiny tighten between name and meta (they feel paired) */
  .sc-overlay__name + .sc-overlay__meta { margin-top: -8px; }
  /* Metrics: right-edge column, vertically centered */
  .sc-overlay__metrics {
    position: absolute;
    top: 50%;
    right: 6vw;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
    align-items: flex-end;
    text-align: right;
    width: 200px;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sc-overlay.is-active .sc-overlay__metrics { opacity: 0.78; }
  .sc-stage:hover .sc-overlay.is-active .sc-overlay__metrics { opacity: 1; }
  .sc-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    width: 100%;
  }
  .sc-metric:first-child { border-top: none; padding-top: 0; }
  .sc-metric__val {
    font-size: 22px;
    margin-bottom: 2px;
  }
  .sc-metric__lbl {
    font-size: 9px;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.6);
  }
}
.sc-overlay__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sc-overlay__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #f5eee3;
  text-decoration: none;
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  position: relative;
  overflow: hidden;
}
.sc-overlay__cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.sc-overlay__cta .sc-arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sc-overlay__cta:hover .sc-arrow { transform: translateX(4px); }

/* Glass circle toggle: "+" becomes "×" when open */
.sc-overlay__metrics-toggle {
  width: 48px;
  height: 48px;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f5eee3;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sc-overlay__metrics-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.sc-overlay__metrics-toggle-icon {
  position: relative;
  width: 14px;
  height: 14px;
  display: block;
}
.sc-overlay__metrics-toggle-icon::before,
.sc-overlay__metrics-toggle-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sc-overlay__metrics-toggle-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
/* Open state → "+" rotates 45° to form "×" */
.sc-overlay.is-metrics-open .sc-overlay__metrics-toggle {
  transform: rotate(135deg);
  background: var(--accent);
  border-color: var(--accent);
}

/* Progress dots (right edge) — original visual, expanded tap target */
.sc-dots {
  position: absolute;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  pointer-events: auto;
}
.sc-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  position: relative;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* Invisible expanded tap target so small dots are easy to hit */
.sc-dot::after {
  content: '';
  position: absolute;
  inset: -12px -18px;
}
.sc-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}
.sc-dot.is-active {
  height: 28px;
  background: var(--accent);
}

/* Index chip bottom-left (anchored under the sc-nav) */
.sc-index {
  position: absolute;
  left: 6vw;
  top: 96px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.55);
  z-index: 3;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.sc-index #scIndexCurrent { color: var(--accent); font-weight: 700; font-size: 14px; }
.sc-index__sep { opacity: 0.5; }

/* (Spacers removed — rail is gesture-controlled now) */

/* ---------- RIPPLE ---------- */
.sc-ripple {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 86, 16, 0.4) 0%, rgba(255, 86, 16, 0) 70%);
  transform: translate(-50%, -50%) scale(0);
  z-index: 999;
}

/* ---------- OUTRO ---------- */
.sc-outro {
  padding: 140px 0 120px;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
  background: var(--bg);
}
.sc-outro__inner {
  max-width: 720px;
}
.sc-outro h2 {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 16px 0 20px;
}
.sc-outro__cta {
  margin-top: 32px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .sc-overlay { left: 4vw; max-width: 80vw; }
  .sc-overlay__desc { max-width: 100%; }
}

@media (max-width: 768px) {
  .sc-intro { padding-top: calc(var(--nav-h) + 60px); padding-bottom: 60px; }
  .sc-stage { height: 100svh; }
  .sc-overlay {
    left: 5vw;
    right: 5vw;
    max-width: none;
    bottom: 12vh;
  }
  .sc-overlay__name { font-size: clamp(32px, 10vw, 48px); }
  .sc-overlay__meta { font-size: 10px; }
  .sc-overlay__desc {
    font-size: 15px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .sc-overlay__metrics { gap: 20px; margin-bottom: 20px; }
  .sc-metric__val { font-size: 22px; }
  .sc-dots { right: 14px; gap: 8px; }
  .sc-index { left: 5vw; top: 78px; }
  .sc-outro { padding: 80px 0 60px; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .sc-mockup { transform: none !important; transition: opacity 0.2s ease; }
  .sc-overlay { transform: none !important; transition: opacity 0.2s ease; }
  .sc-intro__hint-line { animation: none; }
  .sc-ripple { display: none; }
}
