/* ==========================================================================
   MORROWWAY PICTURES — MASTER STYLESHEET
   Jake Peress Portfolio · morrowway.com

   TABLE OF CONTENTS
   1.  Design Tokens (colors, type, spacing)
   2.  Font Faces / Imports
   3.  Reset & Base Elements
   4.  Accessibility Utilities
   5.  Film Grain + Scratch Overlay (site-wide texture)
   6.  Sprocket Rail (signature 35mm frame element)
   7.  Site Header / Navigation
   8.  Reel Page — Hero + Countdown Leader
   9.  Reel Page — Video Card Grid
   10. About Page — Hero
   11. About Page — Bio Section
   12. About Page — Gallery
   13. Contact Section
   14. Site Footer
   15. Shared Components (buttons, eyebrows, dividers)
   16. Responsive Breakpoints
   17. Reduced Motion / Print
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   Palette named after the physical world of a projection booth:
   void = the screen before the reel starts, bone = marquee bulb glow,
   gold = brass film-reel hardware, rust = the red leader/tail stock,
   ash = the smoke haze of a projector beam.
   -------------------------------------------------------------------------- */
:root {
  /* Color */
  --void:        #0a0a09;   /* primary background */
  --void-raised: #151412;   /* card / raised surface */
  --void-line:   #2a2723;   /* hairline borders on black */
  --bone:        #ece5d3;   /* primary text */
  --bone-dim:    #c9c0ab;   /* secondary text */
  --ash:         #8a8378;   /* tertiary / metadata text */
  --gold:        #c9a24b;   /* brass accent — links, active states */
  --gold-bright: #e6c877;   /* hover state of gold */
  --rust:        #7c2c22;   /* leader-stock red — rare accent only */

  /* Type */
  --font-display: "Bodoni Moda", "Times New Roman", serif;
  --font-body:    "Jost", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", "Courier New", monospace;

  /* Type scale (fluid) */
  --fs-hero:   clamp(3.2rem, 9vw, 8.5rem);
  --fs-h1:     clamp(2.2rem, 5vw, 4rem);
  --fs-h2:     clamp(1.5rem, 3vw, 2.25rem);
  --fs-lede:   clamp(1.1rem, 1.6vw, 1.35rem);
  --fs-body:   1.0625rem;
  --fs-meta:   0.8rem;
  --fs-eyebrow: 0.78rem;

  /* Spacing */
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --rail-w: clamp(18px, 3vw, 34px);
  --section-space: clamp(4rem, 10vw, 8rem);

  /* Motion */
  --ease-film: cubic-bezier(0.22, 0.61, 0.36, 1);
}


/* --------------------------------------------------------------------------
   2. FONT IMPORTS
   Loaded via <link> in the document <head> for performance (preconnect +
   font-display: swap). This block intentionally left as documentation only.
   Fonts used: Bodoni Moda (display), Jost (body), IBM Plex Mono (utility).
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   3. RESET & BASE ELEMENTS
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--void);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
  margin: 0;
  color: var(--bone);
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul { margin: 0; padding: 0; list-style: none; }

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

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}


/* --------------------------------------------------------------------------
   4. ACCESSIBILITY UTILITIES
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -60px;
  background: var(--gold);
  color: var(--void);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  z-index: 500;
  transition: top 0.2s var(--ease-film);
}
.skip-link:focus { top: 1rem; }


/* --------------------------------------------------------------------------
   5. FILM GRAIN + SCRATCH OVERLAY
   Site-wide texture layered above content but below UI focus rings.
   Two layers: a static SVG turbulence grain (cheap, GPU-friendly) and a
   handful of thin scratch lines that drift very slowly. Pointer-events
   disabled so it never blocks interaction. Intensity kept low ("very
   light") per brief — this is atmosphere, not noise.
   -------------------------------------------------------------------------- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

.scratch-overlay {
  position: fixed;
  inset: 0;
  z-index: 401;
  pointer-events: none;
  opacity: 0.5;
}

.scratch-overlay span {
  position: absolute;
  top: -10%;
  width: 1px;
  height: 120%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(236, 229, 211, 0.35) 8%,
    transparent 15%,
    transparent 40%,
    rgba(236, 229, 211, 0.18) 46%,
    transparent 55%,
    transparent 100%
  );
  animation: scratch-drift linear infinite;
}

@keyframes scratch-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(40px); }
}

/* occasional vignette flicker to sell "projector" atmosphere */
.flicker-overlay {
  position: fixed;
  inset: 0;
  z-index: 399;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
  animation: flicker 6s steps(30) infinite;
  opacity: 0.9;
}

@keyframes flicker {
  0%, 100% { opacity: 0.85; }
  4%  { opacity: 0.75; }
  8%  { opacity: 0.9; }
  40% { opacity: 0.82; }
  62% { opacity: 0.88; }
  63% { opacity: 0.7; }
  64% { opacity: 0.88; }
}


/* --------------------------------------------------------------------------
   6. SPROCKET RAIL
   Signature element: the page's content column is framed, left and right,
   by rails of sprocket holes — the physical edge of a 35mm film strip.
   Purely decorative (aria-hidden), fixed to viewport edges.
   -------------------------------------------------------------------------- */
.sprocket-rail {
  position: fixed;
  top: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 40;
  background-color: #060605;
  background-image: radial-gradient(
    circle at center,
    var(--void) 0 34%,
    transparent 35%
  );
  background-size: 100% 64px;
  background-repeat: repeat-y;
  border-color: var(--void-line);
}

.sprocket-rail--left  { left: 0; background-position: center 14px; border-right: 1px solid var(--void-line); }
.sprocket-rail--right { right: 0; background-position: center 46px; border-left: 1px solid var(--void-line); }


/* --------------------------------------------------------------------------
   7. SITE HEADER / NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem var(--gutter);
  padding-left: calc(var(--gutter) + var(--rail-w));
  padding-right: calc(var(--gutter) + var(--rail-w));
}

.brand-logo {
  height: clamp(22px, 3vw, 30px);
  width: auto;
  filter: drop-shadow(0 0 14px rgba(201, 162, 75, 0.08));
}

.brand-logo img { height: 100%; width: auto; }

.main-nav ul {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}

.main-nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-dim);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease-film), border-color 0.25s var(--ease-film);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}


/* --------------------------------------------------------------------------
   8. REEL PAGE — HERO + COUNTDOWN LEADER
   The countdown circle references the physical film-leader countdown
   ("8-7-6-5-4-3-2") projectionists once spliced before a reel began —
   here it doubles as a live count of works in the reel.
   -------------------------------------------------------------------------- */
.reel-hero {
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  text-align: center;
}

.countdown-leader {
  width: clamp(64px, 8vw, 88px);
  height: clamp(64px, 8vw, 88px);
  margin: 0 auto 2rem;
  border: 1px solid var(--void-line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.countdown-leader::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border-top: 1px solid var(--gold);
  animation: sweep 4s linear infinite;
}

@keyframes sweep {
  to { transform: rotate(360deg); }
}

.countdown-leader span {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 1.1rem;
}

.reel-hero h1 {
  font-size: var(--fs-hero);
  letter-spacing: -0.01em;
}

.reel-hero h1 em {
  font-style: italic;
  color: var(--gold);
}

.reel-hero .lede {
  max-width: 46ch;
  margin: 1.5rem auto 0;
  color: var(--bone-dim);
  font-size: var(--fs-lede);
}


/* --------------------------------------------------------------------------
   9. REEL PAGE — VIDEO CARD GRID
   Each work is numbered in descending order (07 → 01), reading like a
   countdown leader ticking toward the final frame as the visitor scrolls.
   Thumbnails use a lightweight "facade" pattern: a static preview image
   loads at first paint, and the real YouTube iframe is only injected on
   click (see js/lite-embed.js) — this keeps the page fast and SEO-clean.
   -------------------------------------------------------------------------- */
.reel-list {
  padding-bottom: var(--section-space);
}

.reel-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: start;
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
  border-top: 1px solid var(--void-line);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-film), transform 0.7s var(--ease-film);
}

.reel-item:last-child {
  border-bottom: 1px solid var(--void-line);
}

.reel-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reel-item__index {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--void-line);
  line-height: 1;
  -webkit-text-stroke: 1px var(--ash);
  color: transparent;
}

.reel-item__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}

@media (min-width: 760px) {
  .reel-item__body {
    grid-template-columns: minmax(280px, 460px) 1fr;
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: center;
  }
}

/* --- lite youtube facade --- */
.lite-yt {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: var(--void-raised);
  cursor: pointer;
  border: 1px solid var(--void-line);
}

.lite-yt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-film), filter 0.6s var(--ease-film);
  filter: grayscale(55%) contrast(1.05) brightness(0.85);
}

.lite-yt:hover img,
.lite-yt:focus-visible img {
  transform: scale(1.045);
  filter: grayscale(0%) contrast(1.05) brightness(0.95);
}

.lite-yt__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.lite-yt__play svg {
  width: clamp(46px, 6vw, 60px);
  height: clamp(46px, 6vw, 60px);
  transition: transform 0.35s var(--ease-film);
}

.lite-yt:hover .lite-yt__play svg,
.lite-yt:focus-visible .lite-yt__play svg {
  transform: scale(1.1);
}

.lite-yt__play circle {
  fill: rgba(10, 10, 9, 0.55);
  stroke: var(--gold);
  stroke-width: 1;
}

.lite-yt__play path { fill: var(--bone); }

.lite-yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reel-item__title {
  font-size: var(--fs-h2);
  margin-bottom: 0.6rem;
}

.reel-item__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--ash);
  letter-spacing: 0.03em;
  line-height: 1.8;
}

.reel-item__meta .sep {
  color: var(--void-line);
  margin-inline: 0.55em;
}

.reel-item__watch {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.reel-item__watch::after {
  content: "→";
  transition: transform 0.25s var(--ease-film);
}

.reel-item:hover .reel-item__watch::after { transform: translateX(4px); }


/* --------------------------------------------------------------------------
   10. ABOUT PAGE — HERO
   -------------------------------------------------------------------------- */
.about-hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.about-hero__img {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.about-hero__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: grayscale(100%) contrast(1.08);
}

.about-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--void) 2%, rgba(10,10,9,0.15) 42%, rgba(10,10,9,0.55) 100%),
    linear-gradient(to right, rgba(10,10,9,0.5) 0%, transparent 40%);
  z-index: -1;
}

.about-hero__content {
  position: relative;
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
  padding-top: 6rem;
}

.about-hero h1 {
  font-size: clamp(2.8rem, 8vw, 6.2rem);
}

.about-hero .role {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  letter-spacing: 0.08em;
  color: var(--gold);
}

.about-hero .role span { color: var(--bone-dim); }


/* --------------------------------------------------------------------------
   11. ABOUT PAGE — BIO SECTION
   -------------------------------------------------------------------------- */
.bio-section {
  padding-block: var(--section-space);
  border-bottom: 1px solid var(--void-line);
}

.bio-grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
}

@media (min-width: 860px) {
  .bio-grid {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
  }
}

.bio-portrait {
  position: relative;
}

.bio-portrait img {
  filter: grayscale(100%) contrast(1.05);
  border: 1px solid var(--void-line);
}

.bio-portrait__cap {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ash);
}

.bio-copy h2 {
  font-size: var(--fs-h1);
  max-width: 14ch;
  margin-bottom: 1.5rem;
}

.bio-copy p {
  color: var(--bone-dim);
  font-size: var(--fs-lede);
  max-width: 62ch;
}

.bio-copy p + p { margin-top: 1.1em; }

.bio-stats {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.bio-stats dl {
  margin: 0;
}

.bio-stats dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 0.35rem;
}

.bio-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--bone);
}


/* --------------------------------------------------------------------------
   12. ABOUT PAGE — GALLERY
   Asymmetric grid mimicking a contact sheet — frames of uneven size laid
   against each other, as a strip of selects would be marked on a light
   table, rather than a uniform, templated grid.
   -------------------------------------------------------------------------- */
.gallery-section {
  padding-block: var(--section-space);
  border-bottom: 1px solid var(--void-line);
}

.gallery-head {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  max-width: 56ch;
}

.gallery-head h2 { font-size: var(--fs-h1); margin-bottom: 0.75rem; }
.gallery-head p { color: var(--ash); font-size: 0.95rem; }

.contact-sheet {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 1.2vw, 0.9rem);
}

.contact-sheet figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: var(--void-raised);
}

.contact-sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.08);
  transition: transform 0.7s var(--ease-film), filter 0.5s var(--ease-film);
}

.contact-sheet a:hover img,
.contact-sheet a:focus-visible img {
  transform: scale(1.04);
  filter: grayscale(0%) contrast(1.08);
}

/* Frame 1: wide theatre-doorway shot spans the full row, landscape crop */
.contact-sheet li:nth-child(1) { grid-column: span 6; }
.contact-sheet li:nth-child(1) figure { aspect-ratio: 3 / 2; }

/* Frames 2–3: the two portrait-orientation shots sit side by side beneath */
.contact-sheet li:nth-child(2),
.contact-sheet li:nth-child(3) { grid-column: span 3; }
.contact-sheet li:nth-child(2) figure,
.contact-sheet li:nth-child(3) figure { aspect-ratio: 2 / 3; }

.frame-tag {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--bone);
  background: rgba(10,10,9,0.55);
  padding: 0.2rem 0.45rem;
  opacity: 0;
  transition: opacity 0.3s var(--ease-film);
}

.contact-sheet a:hover .frame-tag,
.contact-sheet a:focus-visible .frame-tag { opacity: 1; }


/* --------------------------------------------------------------------------
   13. CONTACT SECTION
   -------------------------------------------------------------------------- */
.contact-section {
  padding-block: var(--section-space);
  text-align: center;
}

.contact-section h2 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  max-width: 18ch;
  margin-inline: auto;
}

.contact-section .lede {
  max-width: 48ch;
  margin: 1.25rem auto 2.5rem;
  color: var(--bone-dim);
  font-size: var(--fs-lede);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2.5rem;
  margin-bottom: 2.5rem;
}

.contact-links a {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--bone);
  border-bottom: 1px solid var(--void-line);
  padding-bottom: 4px;
  transition: color 0.25s var(--ease-film), border-color 0.25s var(--ease-film);
}

.contact-links a:hover { color: var(--gold); border-color: var(--gold); }

.cta-button {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 1rem 2.25rem;
  transition: background-color 0.3s var(--ease-film), color 0.3s var(--ease-film);
}

.cta-button:hover {
  background-color: var(--gold);
  color: var(--void);
}


/* --------------------------------------------------------------------------
   14. SITE FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 2.5rem var(--gutter);
  padding-left: calc(var(--gutter) + var(--rail-w));
  padding-right: calc(var(--gutter) + var(--rail-w));
  border-top: 1px solid var(--void-line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ash);
}

.site-footer a { color: var(--ash); transition: color 0.2s var(--ease-film); }
.site-footer a:hover { color: var(--gold); }

.site-footer .footer-nav {
  display: flex;
  gap: 1.5rem;
}


/* --------------------------------------------------------------------------
   15. SHARED COMPONENTS
   -------------------------------------------------------------------------- */
.rule {
  border: none;
  border-top: 1px solid var(--void-line);
  margin: 0;
}


/* --------------------------------------------------------------------------
   16. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .contact-sheet { grid-template-columns: 1fr; }
  .contact-sheet li:nth-child(1),
  .contact-sheet li:nth-child(2),
  .contact-sheet li:nth-child(3) { grid-column: span 1; }
  .contact-sheet li:nth-child(1) figure { aspect-ratio: 3 / 2; }
  .contact-sheet li:nth-child(2) figure,
  .contact-sheet li:nth-child(3) figure { aspect-ratio: 4 / 3; }
}

@media (max-width: 640px) {
  :root { --rail-w: 12px; }

  .site-header { flex-direction: row; }
  .main-nav ul { gap: 1rem; }

  .reel-item { grid-template-columns: 46px 1fr; }
  .reel-item__index { font-size: 1.3rem; }

  .bio-stats { gap: 1.5rem; }
}


/* --------------------------------------------------------------------------
   17. REDUCED MOTION / PRINT
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scratch-overlay,
  .flicker-overlay,
  .countdown-leader::before { animation: none; }
  .reel-item {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .lite-yt img,
  .lite-yt__play svg,
  .contact-sheet img {
    transition: none;
  }
}

@media print {
  .grain-overlay, .scratch-overlay, .flicker-overlay, .sprocket-rail { display: none; }
}
