/* ============================================
   BRILLION STUDIO - OUR WORK PAGE
   ============================================ */

/* ── Shared placeholder (same as services) ── */
.placeholder-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 20px;
}

.nav-active {
  color: var(--accent) !important;
}

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

/* ============================================
   S1: HERO WITH SHOWREEL
   ============================================ */
.wrk-hero {
  padding-top: calc(var(--nav-h) + 80px);
  padding-bottom: 0;
}

.wrk-hero__content {
  max-width: 800px;
}

.wrk-hero__eyebrow {
  animation: fadeUp 0.6s ease both;
}

.wrk-hero__title {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 16px 0 0;
  animation: fadeUp 0.6s ease 0.15s both;
}

.wrk-hero__sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 600px;
  margin: 24px 0 0;
  animation: fadeUp 0.6s ease 0.3s both;
}

.wrk-hero__scroll-hint {
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  animation: fadeUp 0.6s ease 0.45s both;
}

/* Showreel */
.wrk-hero__reel {
  margin-top: 64px;
}

.wrk-hero__reel-placeholder {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 50%; /* 2:1 aspect ratio */
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.4s ease;
}

.wrk-hero__reel-placeholder--video {
  border-style: solid;
}

.wrk-hero__reel-placeholder:hover {
  transform: scale(1.005);
}

.wrk-hero__reel-placeholder .placeholder-label {
  position: absolute;
  inset: 0;
}

.wrk-hero__reel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.wrk-hero__reel-play {
  /* --magnet-x / --magnet-y driven by JS on mousemove (cursor-magnet pattern,
     mirrors showcase CTA). Composed into transform so centering + hover scale
     + magnet pull all stack without one overwriting the other. */
  --magnet-x: 0px;
  --magnet-y: 0px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translate(var(--magnet-x), var(--magnet-y));
  z-index: 2;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
  box-shadow: 0 0 0 0 rgba(255, 46, 0, 0.3);
  /* overflow stays visible so the orbit SVG can extend beyond the 72px circle */
}

/* Orbiting label — sits on a larger concentric circle around the button,
   rotates slowly on hover, fades in/out with opacity. Pure SVG textPath so
   it scales cleanly at any resolution. pointer-events off so clicks pass
   through to the placeholder's video-open handler. */
.wrk-hero__reel-play__orbit {
  position: absolute;
  inset: -34px;        /* 140px - 72px = 68px extra, 34px each side */
  width: 140px;
  height: 140px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  animation: wrk-reel-orbit-spin 14s linear infinite;
  animation-play-state: paused;
  will-change: transform, opacity;
}
.wrk-hero__reel-play__orbit text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  fill: #fff;
}
.wrk-hero__reel-placeholder:hover .wrk-hero__reel-play__orbit {
  opacity: 1;
  animation-play-state: running;
}
@keyframes wrk-reel-orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wrk-hero__reel-play__orbit { animation: none; }
}

.wrk-hero__reel-placeholder:hover .wrk-hero__reel-play {
  transform: translate(-50%, -50%) translate(var(--magnet-x), var(--magnet-y)) scale(1.1);
}

/* Desktop-only: after a grace period on page load, the play button fades away.
   Hovering the tile always brings it back. JS sets .is-reel-dormant on the
   placeholder after the grace timer fires (see work.js). On touch devices the
   media query doesn't match, so the button stays persistently visible. */
@media (hover: hover) and (pointer: fine) {
  .wrk-hero__reel-play {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .wrk-hero__reel-placeholder.is-reel-dormant .wrk-hero__reel-play {
    opacity: 0;
  }
  .wrk-hero__reel-placeholder.is-reel-dormant:hover .wrk-hero__reel-play {
    opacity: 1;
  }
}

/* ============================================
   S2: CATEGORY FILTERS
   ============================================ */
.wrk-filters {
  padding: 16px 0;
  margin-bottom: 16px;
  position: sticky;
  top: var(--nav-h);
  z-index: 10;
  background: var(--bg);
  transition: var(--transition-theme);
}

.wrk-filters__bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.wrk-filters__bar::-webkit-scrollbar {
  display: none;
}

.wrk-filter-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.wrk-filter-tab:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.wrk-filter-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================
   S3: FEATURED CASE STUDY
   ============================================ */
.wrk-featured {
  padding: 80px 0 120px;
}

.wrk-featured__label {
  margin-bottom: 24px;
}

.wrk-featured__layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.wrk-featured__img {
  position: relative;
  min-height: 500px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wrk-featured__img-overlay {
  position: absolute;
  top: 24px;
  left: 24px;
}

.wrk-featured__img-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius);
}

.wrk-featured__img-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 2.5%;
}


.wrk-featured__info {
  background: var(--bg-card);
  display: flex;
  align-items: center;
}

.wrk-featured__info-inner {
  padding: 48px;
}

.wrk-featured__name {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.wrk-featured__cat {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.wrk-featured__desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-top: 20px;
}

.wrk-featured__metrics {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.wrk-featured__metric {
  display: flex;
  flex-direction: column;
}

.wrk-featured__metric-row {
  display: flex;
  align-items: baseline;
}

.wrk-featured__metric-val,
.wrk-featured__metric-suffix,
.wrk-featured__metric-prefix {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.wrk-featured__metric-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.wrk-featured__cta {
  margin-top: 32px;
}

/* ============================================
   S4: PROJECT GRID
   ============================================ */
.wrk-grid-section {
  padding: 80px 0 120px;
  background: var(--bg-surface);
}

.wrk-project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 40px;
}

.wrk-project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.3s ease, transform 0.3s ease;
  position: relative;
}

.wrk-project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.wrk-project-card__img {
  width: 100%;
  height: 310px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.3s ease;
  position: relative;
}

.wrk-project-card:hover .wrk-project-card__img {
  background: var(--bg);
}

.wrk-project-card__img-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 2.5%;
  transition: transform 0.4s ease;
}

.wrk-project-card:hover .wrk-project-card__img-photo {
  transform: scale(1.03);
}

.wrk-project-card__info {
  padding: 20px;
}

.wrk-project-card__info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.wrk-project-card__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

.wrk-project-card__arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 18px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.wrk-project-card:hover .wrk-project-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Filter animation */
.wrk-project-card.is-hidden {
  display: none;
}

.wrk-project-card.is-fading {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ============================================
   S5: ISOMETRIC 3D SHOWCASE
   ============================================ */
.wrk-iso {
  padding: 120px 0;
  overflow: hidden;
}

.wrk-iso__title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 12px;
}

.wrk-iso__scene-wrap {
  margin-top: 64px;
}

/* Stats row */
.wrk-iso__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  gap: 48px 32px;
  margin-top: 64px;
}

.wrk-iso__stat {
  text-align: center;
  min-width: 0;
}

.wrk-iso__stat-val {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.wrk-iso__stat-suffix {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.wrk-iso__stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ============================================
   S6: VIDEO REEL / PROCESS TEASER
   ============================================ */
.wrk-reel {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wrk-reel__video-wrap {
  position: absolute;
  inset: -25% 0;
  z-index: 0;
}

.wrk-reel__placeholder {
  width: 100%;
  height: 100%;
  background: #0b0b0b url('images/work-reel-bg.jpg') center/cover no-repeat;
  will-change: transform;
}

.wrk-reel__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(11, 11, 11, 0.55) 0%, rgba(11, 11, 11, 0.2) 60%),
    linear-gradient(to bottom, rgba(11, 11, 11, 0.5) 0%, rgba(11, 11, 11, 0.85) 100%);
}
[data-theme="light"] .wrk-reel__overlay {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(11, 11, 11, 0.55) 0%, rgba(11, 11, 11, 0.2) 60%),
    linear-gradient(to bottom, rgba(11, 11, 11, 0.5) 0%, rgba(11, 11, 11, 0.85) 100%);
}

.wrk-reel__content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.wrk-reel__content h2 {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #f8f6f2;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.wrk-reel__content p {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(248, 246, 242, 0.85);
  margin: 16px auto 0;
  max-width: 480px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.wrk-reel__content .btn {
  margin-top: 32px;
}

/* ============================================
   S7: CTA
   ============================================ */
.wrk-cta {
  position: relative;
  padding: 120px 0;
  text-align: center;
  overflow: hidden;
}

.wrk-cta__content {
  position: relative;
  z-index: 2;
}

.wrk-cta__content h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 12px;
}

.wrk-cta__content .section-sub {
  margin: 16px auto 0;
  max-width: 480px;
}

.wrk-cta__content .btn {
  margin-top: 32px;
}

@keyframes float3d {
  0%, 100% { transform: perspective(600px) rotateX(10deg) rotateY(-10deg) translateY(0); }
  50%      { transform: perspective(600px) rotateX(12deg) rotateY(-8deg) translateY(-12px); }
}

.wrk-cta__floating-shape {
  position: absolute;
  z-index: 0;
  width: 300px;
  height: 200px;
  top: 50%;
  left: 50%;
  margin-top: -140px;
  margin-left: -200px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  opacity: 0.2;
  animation: float3d 6s ease-in-out infinite;
}

.wrk-cta__floating-shape--alt {
  width: 200px;
  height: 150px;
  margin-left: 40px;
  margin-top: -60px;
  animation-delay: -3s;
  opacity: 0.12;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .wrk-featured__layout {
    grid-template-columns: 1fr 1fr;
  }
  .wrk-featured__img {
    min-height: 400px;
  }
  .wrk-featured__img-photo {
    object-position: center 10%;
  }
  .wrk-project-card__img {
    height: 310px;
  }
  .wrk-project-card__img-photo {
    object-position: center center;
  }
  .wrk-featured__info-inner {
    padding: 32px;
  }
  .wrk-featured__metrics {
    gap: 24px;
  }
  .wrk-iso__stats {
    gap: 40px 24px;
  }
}

@media (max-width: 768px) {
  /* Hero */
  .wrk-hero {
    padding-top: calc(var(--nav-h) + 48px);
  }
  .wrk-hero__reel-placeholder {
    padding-bottom: 66%; /* taller on mobile */
  }

  /* Featured */
  .wrk-featured__layout {
    grid-template-columns: 1fr;
  }
  .wrk-featured__img {
    min-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .wrk-featured__metrics {
    flex-wrap: wrap;
    gap: 24px;
  }

  /* Project grid */
  .wrk-project-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .wrk-project-card__img {
    height: 260px;
  }
  .wrk-project-card__img-photo {
    object-position: center center;
  }
  .wrk-featured__img-photo {
    object-position: center 10%;
  }
  .wrk-project-card__arrow {
    opacity: 1;
  }

  .wrk-iso__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 16px;
    margin-top: 48px;
  }
  .wrk-iso__scene-wrap {
    margin-top: 40px;
  }
  .wrk-iso__stat-val {
    font-size: 36px;
  }

  /* Reel */
  .wrk-reel {
    min-height: 50vh;
  }

  /* CTA shapes */
  .wrk-cta__floating-shape {
    width: 200px;
    height: 140px;
  }
}

/* Wide-desktop: denser project grid */
@media (min-width: 1280px) {
  .wrk-project-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================
   VIDEO DEEP-DIVE MODAL
   ============================================ */
.video-deepdive {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  /* Matched to FLIP frame transition below for a synchronized open/close */
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-deepdive.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* During the JS-measurement step we briefly unhide the modal at opacity 0 so
   the frame has layout and we can read its natural rect. No transition in this
   window — it would flash without this class. */
.video-deepdive.is-measuring {
  transition: none;
}

.video-deepdive__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(11, 11, 11, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.video-deepdive__frame {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  background: #0b0b0b;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  /* Frame transform is controlled by JS FLIP animation (translate + scale from
     the clicked tile's bounding rect to identity). No CSS default transform so
     JS and CSS don't fight for control during the open/close sequence. */
}

.video-deepdive__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  gap: 12px;
}

.video-deepdive__title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-deepdive__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.video-deepdive__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.video-deepdive__btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  transform: translateY(-1px);
}

.video-deepdive__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.video-deepdive__btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.video-deepdive__video-wrap {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 48px - 64px);
}

.video-deepdive__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  outline: none;
}

body.is-deepdive-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .video-deepdive {
    padding: 12px;
  }
  .video-deepdive__header {
    padding: 10px 12px;
  }
  .video-deepdive__title {
    font-size: 12px;
  }
}
