/* =============================================================
   JVisual Studio — Lean CSS
   Optimized styles for fashion film studio website
   ============================================================= */

/* Import design tokens */
@import url('colors_and_type.css');

/* =============================================================
   Reset & Base
   ============================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: transparent;
  color: var(--stage-fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--dur-base) var(--ease);
}

a:hover {
  opacity: 0.7;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* =============================================================
   Layout & Grid System (Only Used Classes)
   ============================================================= */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.grid {
  display: grid;
  gap: var(--s-5);
}

.grid--12 {
  grid-template-columns: repeat(12, 1fr);
}

/* Only used span classes */
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }

/* =============================================================
   Global Header
   ============================================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 72px;
  background: rgba(14, 13, 11, 0.85);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(237, 234, 227, 0.08);
}

.header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 100%;
  padding: 0 var(--gutter);
}

.header__logo {
  display: flex;
  align-items: center;
  font-size: 20px;
  color: var(--stage-fg);
}

.header__logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.header__nav {
  justify-self: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-fg-2);
}

.header__actions {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-fg-2);
}

.header__cta {
  border: 1px solid var(--stage-fg);
  border-radius: 999px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-base) var(--ease);
}

.header__cta:hover {
  background: var(--stage-fg);
  color: var(--stage);
  opacity: 1;
}

.header__cta::after {
  content: "+";
  font-weight: 400;
  font-size: 14px;
}

/* =============================================================
   Global Footer
   ============================================================= */
.footer {
  background: var(--stage-2);
  color: var(--stage-fg);
  padding: clamp(64px, 8vw, 96px) 0 clamp(32px, 4vw, 48px);
  border-top: 1px solid rgba(237, 234, 227, 0.08);
}

.footer__mast {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--s-6);
  margin-bottom: var(--s-8);
}

.footer__mark {
  font-size: clamp(48px, 8vw, 80px);
  color: var(--stage-fg);
}

.footer__logo-img {
  height: clamp(48px, 8vw, 80px);
  width: auto;
  display: block;
}

.footer__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(16px, 2.4vw, 24px);
  line-height: 1.3;
  color: var(--stage-fg-2);
  justify-self: end;
  text-align: right;
  max-width: 24ch;
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-6);
  margin-bottom: var(--s-8);
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.footer__col-title {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-fg-3);
  margin-bottom: var(--s-1);
}

.footer__link {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--stage-fg-2);
  transition: color var(--dur-base) var(--ease);
}

.footer__link:hover {
  color: var(--stage-fg);
  opacity: 1;
}

.footer__link--serif {
  font-family: var(--font-display);
  font-style: italic;
}

.footer__bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid rgba(237, 234, 227, 0.16);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-fg-2);
}

.footer__bottom--center {
  justify-self: center;
}

.footer__bottom--right {
  justify-self: center;
}

/* =============================================================
   Page Sections
   ============================================================= */
.section {
  padding: clamp(64px, 8vw, 120px) 0;
  background: var(--stage);
}

.section--hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-video__media {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.hero-video__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 13, 11, 0.4);
  z-index: 2;
}

.section__header {
  margin-bottom: var(--s-8);
  max-width: 1200px;
}

.section__eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-fg-2);
  margin-bottom: var(--s-5);
  display: block;
}

.section__title {
  font-family: var(--font-headline);
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  max-width: 16ch;
}

.section__title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.015em;
}

.section__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.4;
  color: var(--stage-fg-2);
  max-width: 48ch;
}

/* =============================================================
   Film Components
   ============================================================= */
/* Masonry: fine auto-rows + JS-computed row-spans pack mixed-orientation
   tiles (vertical Shorts + horizontal films) tightly with no gaps, while
   the featured tile keeps its wider column span. */
.film-reel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1px;
  grid-auto-flow: row dense;
  column-gap: var(--s-5);
  row-gap: 0;
  align-items: start;
  margin-bottom: var(--s-7);
}

.film-item {
  position: relative;
  cursor: pointer;
  align-self: start;
  transition: transform var(--dur-slow) var(--ease);
}

.film-item:hover {
  transform: translateY(-4px);
}

.film-item--featured {
  grid-column: span 2;
}

.film-item--secondary,
.film-item--tertiary {
  grid-column: span 1;
}

/* Tablet: drop to 2 columns, featured spans full width */
@media (max-width: 1024px) and (min-width: 769px) {
  .film-reel {
    grid-template-columns: repeat(2, 1fr);
  }
  .film-item--featured {
    grid-column: span 2;
  }
}

.film-frame {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule);
  overflow: hidden;
  margin-bottom: var(--s-3);
}

.film-frame--cinematic {
  aspect-ratio: 21 / 9;
}

.film-frame--landscape {
  aspect-ratio: 16 / 9;
}

.film-frame--portrait {
  aspect-ratio: 9 / 16;
}

.film-frame__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}

.film-item:hover .film-frame__media {
  transform: scale(1.02);
}

.film-frame__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(14, 13, 11, 0) 0%,
    rgba(14, 13, 11, 0) 60%,
    rgba(14, 13, 11, 0.8) 100%
  );
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}

.film-item:hover .film-frame__overlay {
  opacity: 1;
}

.film-frame__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(237, 234, 227, 0.9);
  color: var(--stage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  opacity: 0;
  transition: all var(--dur-base) var(--ease);
  backdrop-filter: blur(8px);
}

.film-item:hover .film-frame__play {
  opacity: 1;
}

.film-frame__meta {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}

.film-item:hover .film-frame__meta {
  opacity: 1;
}

.film-frame__title {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--stage-fg);
  margin-bottom: 4px;
}

.film-frame__title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
}

.film-frame__client {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-fg-2);
}

.film-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}

.film-meta__number {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-fg-3);
}

.film-meta__title {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--stage-fg);
  flex: 1;
}

.film-meta__title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.015em;
}

.film-meta__year {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-fg-2);
}

.film-frame__player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.film-frame__player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Masonry Grid for Work Page */
.film-reel--masonry {
  columns: 3;
  column-gap: var(--s-5);
  column-fill: balance;
}

.film-reel--masonry .film-item {
  display: inline-block;
  width: 100%;
  margin-bottom: var(--s-5);
  break-inside: avoid;
  grid-column: unset;
}

.film-reel--masonry .film-frame--cinematic {
  aspect-ratio: 16 / 9;
}

.film-reel--masonry .film-frame--landscape {
  aspect-ratio: 16 / 10;
}

.film-reel--masonry .film-frame--portrait {
  aspect-ratio: 9 / 16;
}

.film-reel--masonry .film-frame--square {
  aspect-ratio: 1;
}

/* =============================================================
   Mobile Responsive (768px and below)
   ============================================================= */
@media (max-width: 768px) {
  /* Mobile header */
  .header {
    height: 56px;
    padding: 0;
  }
  
  .header__inner {
    padding: 0 var(--gutter);
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  
  .header__logo {
    font-size: 18px;
  }
  
  .header__nav {
    display: none;
  }
  
  .header__actions {
    gap: var(--s-2);
    font-size: 10px;
  }
  
  .header__cta {
    padding: 6px 12px;
    font-size: 10px;
  }
  
  /* Mobile sections */
  .section {
    padding: clamp(32px, 8vw, 48px) 0;
  }
  
  .section__title {
    font-size: clamp(32px, 10vw, 48px) !important;
    line-height: 0.9;
  }
  
  /* Mobile grids */
  .grid--12 {
    grid-template-columns: 1fr;
  }
  
  .span-5, .span-6, .span-7 {
    grid-column: span 1;
  }
  
  /* Mobile film reel — single column, normal flow (masonry off) */
  .film-reel {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    grid-auto-flow: row;
    row-gap: var(--s-4);
    column-gap: 0;
  }

  .film-item--featured,
  .film-item--secondary,
  .film-item--tertiary {
    grid-column: span 1;
  }
  
  /* Mobile footer */
  .footer {
    padding: clamp(48px, 8vw, 64px) 0 clamp(24px, 4vw, 32px);
  }
  
  .footer__mast {
    grid-template-columns: 1fr;
    gap: var(--s-4);
    text-align: center;
    margin-bottom: var(--s-6);
  }
  
  .footer__tagline {
    text-align: center;
    justify-self: center;
  }
  
  .footer__nav {
    grid-template-columns: 1fr;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
  }
  
  .footer__col {
    text-align: center;
  }
  
  .footer__bottom {
    grid-template-columns: 1fr;
    gap: var(--s-2);
    text-align: center;
  }
  
  /* Mobile layout fixes */
  [style*="display: grid"][style*="grid-template-columns: 1fr auto"] {
    display: block !important;
  }
  
  /* Vision section mobile */
  .section[style*="background: var(--stage)"] [style*="grid-template-columns: 1fr auto"] {
    display: block !important;
  }
  
  .section[style*="background: var(--stage)"] .jvs-mark {
    display: block !important;
    text-align: center !important;
    margin-top: var(--s-6) !important;
  }
  
  .section[style*="background: var(--stage)"] h2 {
    max-width: none !important;
    text-align: center !important;
  }
  
  /* Hero video mobile optimizations */
  .hero-video__media {
    /* Ensure video covers properly on mobile */
    object-fit: cover;
  }
  
  .hero-video__overlay {
    /* Slightly darker overlay on mobile for better text readability */
    background: rgba(14, 13, 11, 0.5);
  }
}

/* =============================================================
   Utilities (Only Used)
   ============================================================= */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}