/* ============================================================
   Luke Orlando — Director's Reel

   DESKTOP: fluid layout. The logo, project list and footer span the
   full window (minus a 56px gutter), so the design fills the screen
   edge to edge rather than sitting in a letterboxed box.

   The video panel is positioned proportionally — the same percentages
   as the Figma frame — but its SIZE is locked to a true aspect ratio
   and floored at 75% of the design size. So:
     - it can never distort (aspect-ratio does the second dimension),
     - it can never shrink into a postage stamp (the max() floor),
     - and once it can no longer fit, it overflows and the page
       scrolls, rather than the layout rearranging itself.

   It is position:absolute inside .site, NOT position:fixed —
   fixed elements don't extend the scrollable area, so an overflowing
   video would be clipped with no way to scroll to it.

   MOBILE (touch devices only): a separate reel feed. See the media
   query at the bottom.
   ============================================================ */

@font-face {
  font-family: 'Suisse Int\'l Mono';
  src: url('../assets/fonts/SuisseIntlMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Int\'l Mono';
  src: url('../assets/fonts/SuisseIntlMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Int\'l Mono';
  src: url('../assets/fonts/SuisseIntlMono-Thin.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #213034;
  --ink: #eef0ef;
  --ink-dim: rgba(238, 240, 239, 0.6);
  --ink-faint: rgba(238, 240, 239, 0.32);
  --hairline: rgba(238, 240, 239, 0.28);
  --accent: #e990a2;

  --font-mono: 'Suisse Int\'l Mono', 'IBM Plex Mono', 'SF Mono', ui-monospace, 'Menlo', monospace;

  --gutter: 56px;
  --row-size: clamp(15px, 1.8vw, 30px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  /* Scrolls only when the video panel hits its floor and overflows. */
  overflow: auto;
}

.site {
  position: relative; /* containing block for the video panel + footer */
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 40px var(--gutter) 0;
}

/* ---------- Masthead ---------- */

.masthead {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
}

.studio-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.mark-symbol {
  height: 16px;
  width: auto;
  display: block;
}

.mobile-director-name {
  display: none; /* shown only in the mobile reel layout, next to the logo */
}

.prepared-for {
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-align: right;
}

/* ---------- Project index (the only scrolling region on desktop) ---------- */

.index {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0 0 100px; /* clears the footer at the bottom of scroll */
}

.project-item {
  position: relative;
  border-bottom: 1px solid var(--hairline);
}

.project-row {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 0;
  margin: 0;
  text-align: left;
  font-family: inherit;
  font-size: var(--row-size);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.3s ease;
}

.project-row:hover {
  color: var(--ink-dim);
}

.project-item.is-active .project-row {
  color: var(--accent);
}

/* ---------- Floating video panel ----------
   Position: the Figma percentages, so it sits in the same place
   relative to the window that it does in the reference frame.

   Size: min() picks whichever axis is tighter, so the box only ever
   shrinks to fit and never stretches — aspect-ratio derives the other
   dimension, which is what makes distortion impossible. max() then
   stops it shrinking below 75% of the design size; past that it
   overflows and the page scrolls.

   The two vh/vw figures per rule are the SAME dimension expressed off
   each axis — e.g. horizontal is 61.81vw wide by 55.67vh tall, and
   55.67vh x 16/9 = 98.97vh. Don't "simplify" one away. */

.video-panel {
  position: absolute;
  z-index: 4;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.video-panel[hidden] {
  display: none;
}

.video-panel.is-horizontal {
  top: 22.11%;
  left: 36.39%;
  width: max(668px, min(61.81vw, 98.97vh)); /* floor = 75% of 890px */
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.video-panel.is-vertical {
  top: 5.67%;
  left: 53.96%;
  height: max(584px, min(86.44vh, 53.96vw)); /* floor = 75% of 778px */
  aspect-ratio: 9 / 16;
  border-radius: clamp(8px, 1.4vw, 20px);
}

.video-panel mux-player,
.video-panel video {
  width: 100%;
  height: 100%;
  display: block;
  --media-object-fit: cover;
}

/* ---------- Footer ---------- */

.page-footer {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 36px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}

.rights {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.director-name {
  font-size: var(--row-size);
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* ---------- Sound toggle (mobile reel feed only) ---------- */

.sound-toggle {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 6;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.sound-toggle[hidden] { display: none; }

/* ---------- Mobile reel feed ----------
   No scaling and no clicking. Every project is a full-height
   scroll-snapped slide; it autoplays as it fills the screen and
   stops as it leaves (see js/main.js). The masthead — T mark +
   "Luke Orlando" — sits outside the scrolling region, so it stays
   locked in place the whole way down.

   NOTE the `pointer: coarse` condition. Keying this on width alone
   meant a desktop window dragged narrow would suddenly mutate into
   the phone layout — which reads as the site breaking. Gating on a
   touch pointer means a desktop browser ALWAYS keeps the real
   layout no matter how narrow it goes (it just overflows and
   scrolls), and only real touch devices get the reel.

   To preview this on a desktop: Chrome DevTools > toggle the device
   toolbar > pick a phone. Device emulation reports a coarse pointer,
   so the reel layout kicks in. Simply narrowing the window will not
   trigger it, by design. */

@media (max-width: 860px) and (pointer: coarse) {
  :root { --gutter: 20px; }

  body { overflow: hidden; } /* the feed does the scrolling */

  .site { padding: 20px 0 0; }

  .masthead {
    flex-direction: row;
    align-items: center;
    padding: 0 var(--gutter);
    margin-bottom: 20px;
    gap: 12px;
  }

  .studio-mark { gap: 10px; }

  .mobile-director-name {
    display: inline;
    margin-left: auto;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .prepared-for { display: none; }

  .index {
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .project-list { padding: 0; }

  .reel-slide {
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background: #000;
    border-bottom: none;
  }

  .reel-slide mux-player,
  .reel-slide video {
    width: 100%;
    height: 100%;
    display: block;
    --media-object-fit: cover;
  }

  .reel-caption {
    position: absolute;
    left: var(--gutter);
    bottom: 24px;
    z-index: 2;
    max-width: 75%;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ink);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  }

  .video-panel { display: none !important; }

  .sound-toggle { display: block; }

  /* Replaced by .reel-footer, appended as the last item in the feed,
     so every video slide gets the full screen height. */
  .page-footer { display: none; }

  .reel-footer {
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px var(--gutter) 40px;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--ink-faint);
  }
}
