/* ============================================
   WALKMAN STUDIOS — Recent Works / Portfolio
   Cinematic poster showcase with asymmetric grid
   ============================================ */


/* ============================================================
   SECTION SHELL
   Alternates from stats (--color-bg) to surface.
   Film-strip perforation line runs across the top.
   ============================================================ */

.works-section {
  background: var(--color-surface);
  position: relative;
  overflow: hidden;
  z-index: var(--z-base);
}

/* ---- Film-strip perforation line ---- */
.works-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--color-border)    0px,
      var(--color-border)    2px,
      transparent            2px,
      transparent            10px
    );
  opacity: 0.35;
  pointer-events: none;
  z-index: 2;
}

/* ---- Sprocket-hole strip (film reel top border) ---- */
.works-section::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 24px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent          0px,
      transparent          22px,
      rgba(201,168,76,0.06) 22px,
      rgba(201,168,76,0.06) 26px,
      transparent          26px,
      transparent          50px
    );
  border-bottom: 1px solid rgba(42, 42, 42, 0.4);
  pointer-events: none;
  z-index: 2;
}


/* ============================================================
   AMBIENT GLOW ORBS
   Low-opacity blurred warm shapes drifting behind the grid
   ============================================================ */

.works-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.works-orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(120px);
  will-change: transform;
}

.works-orb--1 {
  width: 600px;
  height: 600px;
  top: -10%;
  right: -5%;
  background: radial-gradient(
    circle,
    rgba(201, 168, 76, 0.06) 0%,
    rgba(166, 138, 58, 0.03) 50%,
    transparent 70%
  );
  animation: worksOrbDrift1 18s ease-in-out infinite;
}

.works-orb--2 {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(140px);
  will-change: transform;
  width: 500px;
  height: 500px;
  bottom: -8%;
  left: -8%;
  background: radial-gradient(
    circle,
    rgba(232, 212, 139, 0.05) 0%,
    rgba(201, 168, 76, 0.025) 50%,
    transparent 70%
  );
  animation: worksOrbDrift2 22s ease-in-out infinite;
}

@keyframes worksOrbDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-30px, 40px) scale(1.05); }
  50%      { transform: translate(20px, 60px) scale(0.95); }
  75%      { transform: translate(-15px, 20px) scale(1.02); }
}

@keyframes worksOrbDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30%      { transform: translate(40px, -30px) scale(1.06); }
  60%      { transform: translate(-20px, -50px) scale(0.96); }
  80%      { transform: translate(25px, -15px) scale(1.03); }
}


/* ============================================================
   SECTION HEADER
   Two-column editorial header matching gallery-header pattern
   ============================================================ */

.works-header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-3xl);
  align-items: end;
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-3xl);
  position: relative;
  z-index: var(--z-base);
}

.works-header__left {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Gold accent line extending from label */
.works-header__line {
  width: 40px;
  height: 1px;
  background: var(--color-accent);
}

.works-header__right h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-text);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--space-sm);
}

.works-header__right h2 em {
  font-style: italic;
  color: var(--color-accent);
}

.works-header__right p {
  font-family: var(--font-body);
  font-size: var(--fs-body-lg);
  color: var(--color-text-muted);
  line-height: var(--lh-loose);
  margin: 0;
  max-width: 520px;
}


/* ============================================================
   FILM-STRIP DECORATION
   Subtle line sitting beneath section pseudo-elements
   ============================================================ */

.works-filmstrip {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-border) 20%,
    var(--color-border) 80%,
    transparent 100%
  );
  opacity: 0.3;
  pointer-events: none;
  z-index: 2;
}


/* ============================================================
   CINEMATIC MARQUEE — Scrolling Service Ticker
   Matches the philosophy-marquee pattern from home.css
   ============================================================ */

.works-marquee {
  position: relative;
  z-index: var(--z-base);
  overflow: hidden;
  padding: var(--space-md) 0;
  margin-bottom: var(--space-2xl);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

.works-marquee__track {
  display: flex;
  gap: var(--space-lg);
  white-space: nowrap;
  animation: worksMarqueeScroll 20s linear infinite;
  width: max-content;
}

.works-marquee__track span {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: var(--fw-light);
  font-style: italic;
  color: var(--color-text-muted);
  opacity: 0.4;
  letter-spacing: var(--ls-wide);
}

.works-marquee__track .marquee-dot {
  font-style: normal;
  color: var(--color-accent);
  opacity: 0.3;
}

@keyframes worksMarqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .works-marquee__track {
    animation: none;
  }
}

@media (max-width: 768px) {
  .works-marquee {
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-xl);
  }

  .works-marquee__track span {
    font-size: var(--fs-h4);
  }
}


/* ============================================================
   POSTER GRID — Asymmetric 3-Column Layout
   Featured card spans 2 rows on the left for dramatic weight.
   ============================================================ */

.works-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--space-md);
  position: relative;
  z-index: var(--z-base);
}


/* ============================================================
   WORK CARD — Cinematic Poster Unit
   ============================================================ */

.work-card {
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition:
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.work-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(201, 168, 76, 0.06);
}

/* ---- Featured card: spans 2 rows ---- */
.work-card--featured {
  grid-row: 1 / 3;
}


/* ============================================================
   POSTER IMAGE
   ============================================================ */

.work-card__poster {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
  aspect-ratio: 2 / 3;
}

.work-card__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out);
  will-change: transform;
}

.work-card:hover .work-card__poster img {
  transform: scale(1.08);
}

/* ---- Cinematic gradient overlay (bottom) ---- */
.work-card__poster::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.55) 35%,
    rgba(0, 0, 0, 0.0)  100%
  );
  z-index: 1;
  pointer-events: none;
  transition: height var(--duration-normal) var(--ease-out);
}

.work-card:hover .work-card__poster::after {
  height: 70%;
}

/* ---- Gold glow pulse ---- */
.work-card__glow {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(201, 168, 76, 0.08);
  z-index: 3;
  pointer-events: none;
  transition:
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
  animation: worksGlowPulse 4s ease-in-out infinite;
}

.work-card:hover .work-card__glow {
  border-color: rgba(201, 168, 76, 0.22);
  box-shadow:
    inset 0 0 30px rgba(201, 168, 76, 0.06),
    0 0 20px rgba(201, 168, 76, 0.08);
  animation-play-state: paused;
}

@keyframes worksGlowPulse {
  0%, 100% {
    border-color: rgba(201, 168, 76, 0.06);
    box-shadow: inset 0 0 20px rgba(201, 168, 76, 0.02);
  }
  50% {
    border-color: rgba(201, 168, 76, 0.14);
    box-shadow: inset 0 0 30px rgba(201, 168, 76, 0.05);
  }
}


/* ============================================================
   CARD INFO — Title, Year, Role overlay
   Positioned at the bottom of the poster over the gradient
   ============================================================ */

.work-card__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg) var(--space-md);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  transform: translateY(4px);
  transition: transform var(--duration-normal) var(--ease-out);
}

.work-card:hover .work-card__info {
  transform: translateY(0);
}

/* Year — gold label style */
.work-card__year {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--color-accent);
  display: inline-block;
}

/* Title — Playfair, prominent */
.work-card__title {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-tight);
  margin: 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.work-card:hover .work-card__title {
  color: var(--color-white);
}

/* Role — small muted text */
.work-card__role {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  color: var(--color-text-muted);
  line-height: var(--lh-body);
  transition: color var(--duration-fast) var(--ease-out);
}

.work-card:hover .work-card__role {
  color: var(--color-text-secondary);
}


/* ============================================================
   FEATURED CARD — Enhanced Styling
   Larger typography, corner-frame accents
   ============================================================ */

.work-card--featured .work-card__info {
  padding: var(--space-xl) var(--space-lg);
}

.work-card--featured .work-card__title {
  font-size: var(--fs-h2);
}

/* Gold corner frame — top-left */
.work-card--featured::before {
  content: '';
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  width: 36px;
  height: 36px;
  border-top: 2px solid var(--color-accent);
  border-left: 2px solid var(--color-accent);
  z-index: 4;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity var(--duration-normal) var(--ease-out);
}

/* Gold corner frame — bottom-right */
.work-card--featured::after {
  content: '';
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border-bottom: 2px solid var(--color-accent);
  border-right: 2px solid var(--color-accent);
  z-index: 4;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.work-card--featured:hover::before,
.work-card--featured:hover::after {
  opacity: 0.9;
}


/* ============================================================
   PROJECTOR GRAIN — Subtle cinematic texture over grid
   Thin noise overlay to evoke 35mm film projection
   ============================================================ */

.works-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.025;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}


/* ============================================================
   RESPONSIVE — 1200px
   Adjust featured card sizing, tighten gaps
   ============================================================ */

@media (max-width: 1200px) {
  .works-grid {
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: var(--space-sm);
  }

  .works-header {
    gap: var(--space-2xl);
  }

  .work-card--featured .work-card__title {
    font-size: var(--fs-h3);
  }

  .work-card--featured .work-card__info {
    padding: var(--space-lg) var(--space-md);
  }
}


/* ============================================================
   RESPONSIVE — 1024px
   2-column grid, featured card spans full width on top
   ============================================================ */

@media (max-width: 1024px) {
  .works-header {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding-bottom: var(--space-2xl);
    margin-bottom: var(--space-2xl);
  }

  .works-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: var(--space-sm);
  }

  /* Featured card spans full width as a banner */
  .work-card--featured {
    grid-column: 1 / -1;
    grid-row: auto;
    max-height: 500px;
  }

  .work-card--featured .work-card__poster img {
    aspect-ratio: 16 / 9;
    object-position: center 20%;
  }

  .work-card--featured .work-card__title {
    font-size: var(--fs-h3);
  }
}


/* ============================================================
   RESPONSIVE — 768px
   Maintain 2-col but refine spacing and typography
   ============================================================ */

@media (max-width: 768px) {
  .works-grid {
    gap: var(--space-xs);
  }

  .works-header {
    gap: var(--space-md);
    padding-bottom: var(--space-xl);
    margin-bottom: var(--space-xl);
  }

  .works-header__right h2 {
    font-size: var(--fs-h2);
  }

  .work-card__info {
    padding: var(--space-md) var(--space-sm);
  }

  .work-card__title {
    font-size: var(--fs-h4);
  }

  .work-card--featured .work-card__info {
    padding: var(--space-md) var(--space-sm);
  }

  .work-card--featured .work-card__title {
    font-size: var(--fs-h3);
  }

  .work-card--featured::before,
  .work-card--featured::after {
    width: 24px;
    height: 24px;
  }

  /* Hide ambient orbs on smaller screens for perf */
  .works-orb--1,
  .works-orb--2 {
    display: none;
  }
}


/* ============================================================
   RESPONSIVE — 480px
   Single column stack
   ============================================================ */

@media (max-width: 480px) {
  .works-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .work-card--featured {
    grid-column: auto;
    max-height: 420px;
  }

  .works-header__right p {
    font-size: var(--fs-body);
  }

  .work-card__title {
    font-size: var(--fs-h4);
  }

  .work-card--featured .work-card__title {
    font-size: var(--fs-h3);
  }

  /* Simplified film strip on mobile */
  .works-section::after {
    display: none;
  }
}


/* ============================================================
   REDUCED MOTION
   Respect user preferences — disable ambient and hover animations
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .works-orb--1,
  .works-orb--2 {
    animation: none;
  }

  .work-card__glow {
    animation: none;
  }

  .work-card__poster img {
    transition: none;
  }

  .work-card__poster::after {
    transition: none;
  }

  .work-card__info {
    transform: none;
    transition: none;
  }
}
