/* ── Plyr Theme Overrides ─────────────────────────────────────── */
/* Restyles Plyr's default blue accents to match the site's matte
   black / grayscale-only palette. */
:root {
  --plyr-color-main: #ffffff;
  --plyr-video-controls-background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.85));
  --plyr-control-color: #a3a3a3;
  --plyr-control-color-hover: #ffffff;
}

.plyr--full-ui input[type="range"] {
  color: #ffffff !important;
}

/* Plyr's YouTube embed wrapper otherwise applies its own aspect-ratio
   box; this makes it fill the modal's existing 16:9 frame instead. */
.modal__player-wrap .plyr,
.modal__player-wrap .plyr__video-wrapper,
.modal__player-wrap .plyr__video-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Plyr's own stylesheet renders the YouTube iframe at 200% size with
   a -50% offset to hide YouTube's native UI chrome — this doubles as
   a digital zoom that crops the edges of the video frame. Reset it
   back to a true, uncropped 100% fill. */
.modal__player-wrap .plyr__video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
}

/* Premium High-Contrast Center Play Button */
.plyr__control--overlaid {
  background: rgba(10, 10, 10, 0.65) !important; /* Deep dark semi-transparent backing */
  color: #ffffff !important; /* Crisp white play icon arrow */
  border: 1px solid rgba(255, 255, 255, 0.15); /* Subtle rim light border */
  backdrop-filter: blur(8px); /* Frosted glass effect to blend with cinematic textures */
  /* Plyr centers this button via `left: 50%; top: 50%;` plus its own
     `translate(-50%, -50%)` transform. Since `transform` isn't
     additive, the centering offset must be re-included here — a
     bare `scale()` alone would overwrite it and drift off-center. */
  transform: translate(-50%, -50%) scale(1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Elegant Hover State Transition */
.plyr__control--overlaid:hover {
  background: #ffffff !important; /* Invert to pure white on hover */
  color: #000000 !important; /* The arrow turns sharp black on hover */
  border-color: #ffffff;
  transform: translate(-50%, -50%) scale(1.08); /* Minimal pop scale animation */
}

/* ── Base & Reset ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #0b0b0b;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ── Typography helpers ───────────────────────────────────────── */
.text-muted {
  color: #888888;
}

/* ── Navigation ───────────────────────────────────────────────── */
.nav-link {
  position: relative;
  color: #888888;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  text-transform: uppercase;
  transition: color 0.4s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #ffffff;
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #ffffff;
  outline: none;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero-title {
  letter-spacing: 0.35em;
  font-weight: 300;
}

.hero-subtitle {
  letter-spacing: 0.15em;
  color: #888888;
}

/* ── Section labels ───────────────────────────────────────────── */
.section-label {
  letter-spacing: 0.3em;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #888888;
}

/* ── Enhanced Editorial Grid ────────────────────────────── */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}

@media (min-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 4rem;
    row-gap: 5rem;
  }
}

/* Category Header Enhancements */
.category-header {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #888888;
  margin-top: 6rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-b: 1px solid rgba(255, 255, 255, 0.05);
}

.video-card {
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  width: 100%;
  group: video-card;
}

.video-card:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.4);
  outline-offset: 6px;
}

.video-card__thumb-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111111;
}

.video-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(0.85) brightness(0.7);
  transform: scale(1);
  transition:
    filter 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.video-card:hover .video-card__thumb,
.video-card:focus-visible .video-card__thumb {
  filter: grayscale(0%) contrast(1) brightness(1);
  transform: scale(1.03);
}

.video-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(11, 11, 11, 0.6) 0%,
    transparent 50%
  );
  opacity: 0.8;
  transition: opacity 0.6s ease;
}

.video-card:hover .video-card__overlay,
.video-card:focus-visible .video-card__overlay {
  opacity: 0.3;
}

.video-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color 0.4s ease;
}

.video-card__play::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.8);
  margin-left: 3px;
}

.video-card:hover .video-card__play,
.video-card:focus-visible .video-card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  border-color: rgba(255, 255, 255, 0.7);
}

/* NDA-protected card thumbnail — real image, heavily blurred and
   darkened so it keeps the grid's visual rhythm without exposing
   any recognizable UI or content. */
.video-card__thumb-wrap--nda {
  position: relative;
}

.video-card__thumb--nda {
  /* Scaled up slightly so the blur doesn't reveal soft edges at
     the container boundary. */
  transform: scale(1.15);
  filter: blur(16px) grayscale(100%) brightness(0.45) contrast(0.9);
}

/* Stays obscured on hover/focus — overrides the base thumbnail's
   hover rule, which would otherwise sharpen it back into focus. */
.video-card:hover .video-card__thumb--nda,
.video-card:focus-visible .video-card__thumb--nda {
  transform: scale(1.15);
  filter: blur(16px) grayscale(100%) brightness(0.45) contrast(0.9);
}

.video-card__nda-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, 0.5);
}

.video-card__nda-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
}

.video-card__nda-lock {
  font-size: 0.9rem;
  opacity: 0.85;
  filter: grayscale(100%);
}

.video-card__meta {
  padding-top: 1.25rem;
}

.video-card__title {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.video-card__desc {
  font-size: 0.78rem;
  color: #888888;
  line-height: 1.6;
  max-width: 90%;
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal__container {
  position: relative;
  width: 100%;
  max-width: 960px;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal.is-open .modal__container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal__close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: none;
  color: #888888;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}

.modal__close:hover,
.modal__close:focus-visible {
  color: #ffffff;
  outline: none;
}

.modal__player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
}

.modal__player-wrap video,
.modal__player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
}

.modal__info {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0;
}

.modal__title {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.modal__desc {
  font-size: 0.8rem;
  color: #888888;
  line-height: 1.6;
}

.modal__player-wrap.is-hidden {
  display: none;
}

/* Redacted placeholder shown in the modal for NDA-protected items */
.modal__nda-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background-color: #111111;
}

.modal__nda-icon {
  font-size: 1.75rem;
  opacity: 0.6;
  filter: grayscale(100%);
}

.modal__nda-text {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #888888;
}

/* ── About Section ────────────────────────────────────────────── */
.about-text {
  max-width: 36rem;
  line-height: 1.85;
  color: #888888;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #888888;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── Fade-in on load ──────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.fade-in-delay-1 { animation-delay: 0.15s; }
.fade-in-delay-2 { animation-delay: 0.3s; }
.fade-in-delay-3 { animation-delay: 0.45s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Scroll offset for fixed header ─────────────────────────── */
section[id],
.portfolio-category {
  scroll-margin-top: 6rem;
}

/* ── Vertical Scroll-Spy Sidebar ──────────────────────────────── */
.sidebar-index {
  position: fixed;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  /* `display` is intentionally left to the Tailwind `hidden md:flex`
     utility classes on the element itself, so responsive visibility
     is controlled in one place instead of fighting a fixed value here. */
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
}

.sidebar-index__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.sidebar-index__link:hover,
.sidebar-index__link:focus-visible {
  opacity: 0.7;
  outline: none;
}

.sidebar-index__link.active {
  opacity: 1;
}

.sidebar-index__label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #ffffff;
}

.sidebar-index__dot {
  display: block;
  width: 4px;
  height: 4px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #ffffff;
  transition:
    height 0.3s ease,
    border-radius 0.3s ease;
}

.sidebar-index__link.active .sidebar-index__dot {
  height: 20px;
  border-radius: 2px;
}

/* Expandable "Work" item + category submenu */
.sidebar-index__item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-index__submenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition:
    max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.4s ease,
    margin-top 0.4s ease;
}

.sidebar-index__item.is-open .sidebar-index__submenu {
  max-height: 640px;
  opacity: 1;
  margin-top: 1.5rem;
}

.sidebar-index__sublink {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.sidebar-index__sublink:hover,
.sidebar-index__sublink:focus-visible {
  opacity: 0.7;
  outline: none;
}

.sidebar-index__sublink.active {
  opacity: 1;
}

.sidebar-index__sublabel {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffffff;
}

.sidebar-index__subdot {
  display: block;
  width: 3px;
  height: 3px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #888888;
  transition:
    height 0.3s ease,
    border-radius 0.3s ease,
    background-color 0.3s ease;
}

.sidebar-index__sublink.active .sidebar-index__subdot {
  height: 12px;
  border-radius: 2px;
  background-color: #ffffff;
}

/* Hidden below the md breakpoint to keep mobile layouts uncluttered */
/* Mobile visibility for the sidebar is now handled by the Tailwind
   `hidden md:flex` classes on the <nav> element itself. */

/* Tailwind's CDN build ships no scrollbar-hiding utility by default,
   so `no-scrollbar` (used on the mobile filter pill row) is defined
   here for cross-browser scrollbar suppression. */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
