/* =========================================================================
   STUART HOLMES — Client-First + Fluid Responsive
   Section 1: Splash / Loading / Main Hero
   -------------------------------------------------------------------------
   Organisation:
     1. VARIABLES   (colors, spacing, typography, fluid tokens)
     2. RESET / BASE
     3. UTILITIES   (global Client-First utility classes)
     4. COMPONENTS  (hero, splash, logo, footer nav)
     5. MOTION      (splash reveal states + reduced-motion)
   ========================================================================= */


/* =========================================================================
   0. FONTS
   ========================================================================= */
@font-face {
  font-family: "Gyst";
  src: url("../assets/fonts/Gyst-Regular.woff2") format("woff2"),
       url("../assets/fonts/Gyst-Regular.woff")  format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


/* =========================================================================
   1. VARIABLES
   ========================================================================= */
:root {

  /* --- Colour system (from Figma) --- */
  --color-neutral-darkest: #171b1a;   /* page / splash background */
  --color-neutral-dark:    #1f2423;
  --color-neutral-muted:   #7e8479;   /* footer text + nav + headings */
  --color-text-body:       #cdd0d4;   /* body copy (primary white) */
  --color-white:           #ffffff;
  --color-overlay:         rgba(23, 27, 26, 0.40);  /* hero dark overlay */
  --color-divider:         rgba(205, 208, 212, 0.10);

  /* --- Client-First spacing scale (rem) --- */
  --spacing-0:    0rem;
  --spacing-xxs:  0.25rem;
  --spacing-xs:   0.5rem;
  --spacing-sm:   1rem;
  --spacing-md:   1.5rem;
  --spacing-lg:   2rem;
  --spacing-xl:   3rem;
  --spacing-2xl:  4rem;
  --spacing-3xl:  5rem;

  /* --- Fluid tokens (clamp: min @ 375px  →  max @ 1440px) --- */
  --padding-global:        clamp(1.25rem, 5vw, 4.5rem);   /* Figma: 72px @1440 */
  --padding-footer-block:  clamp(1.25rem, 2.5vw, 2rem);   /* Figma: 32px @1440 */
  --gap-footer-nav:        clamp(1.5rem, 4.4vw, 4rem);     /* Figma: 64px gap   */

  /* --- Typography --- */
  --font-display: "Gyst", "Cormorant Garamond", "Times New Roman", serif;
  --font-body:    "Satoshi", "Helvetica Neue", Arial, sans-serif;

  /* Logo: resting (top-bar) width + splash scale-up factor.
     resting 150px × 2.4 ≈ 360px (Figma hero size). */
  --logo-size:         clamp(110px, 10.4vw, 150px);
  --logo-splash-scale: 2.4;

  /* Footer micro-type */
  --text-micro:   0.625rem;   /* 10px */
  --tracking-micro: 0.125rem; /* 2px  */

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-splash: 1100ms;
  --dur-fade:   900ms;
}


/* =========================================================================
   2. RESET / BASE
   ========================================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color-scheme: dark;
}

html, body { height: 100%; }

/* Visible focus ring for keyboard users (mouse clicks stay clean) */
:focus-visible {
  outline: 2px solid var(--color-text-body);
  outline-offset: 3px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-neutral-darkest);
  color: var(--color-white);
  overflow: hidden;            /* full-page experience: no native page scroll */
}

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

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


/* =========================================================================
   3. UTILITIES  (Client-First global classes)
   ========================================================================= */
.page-wrapper { position: relative; }

.main-wrapper { position: relative; }

/* ---- Full-page slides (one section at a time, crossfade between) ---- */
.fullpage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.fullpage .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 850ms var(--ease-out), visibility 0s linear 850ms;
}

.fullpage .slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
  transition: opacity 850ms var(--ease-out);
}

.padding-global { padding-left: var(--padding-global); padding-right: var(--padding-global); }

.u-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;
}


/* =========================================================================
   4. COMPONENTS
   ========================================================================= */

/* ---- Hero section ---- */
.section_hero {
  position: relative;
  width: 100%;
  height: 100svh;          /* full viewport, mobile-safe */
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--color-neutral-darkest);
}

/* ---- Background (video + overlay) ---- */
.hero_background {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Fallback gradient that mimics the moody montage before footage loads */
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(60, 52, 46, 0.55) 0%, transparent 55%),
    radial-gradient(110% 80% at 85% 80%, rgba(78, 60, 48, 0.45) 0%, transparent 50%),
    var(--color-neutral-darkest);
}

.hero_video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero_overlay {
  position: absolute;
  inset: 0;
  background-color: var(--color-overlay);
  opacity: 1;
  transition: opacity var(--dur-splash) var(--ease-out);
}

/* On is-loaded the logo scales up to the top bar AND the overlay fades
   away at the same time (same duration). */
.is-loaded .hero_overlay { opacity: 0; }

/* ---- Splash cover (solid → fades out) ---- */
.splash_cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-color: var(--color-neutral-darkest);
  opacity: 1;
  transition: opacity var(--dur-splash) var(--ease-out);
  will-change: opacity;
}

/* ---- Global logo (animates hero-centre → fixed top bar) ---- */
.site-logo {
  position: fixed;
  top: var(--spacing-lg);              /* resting: top bar */
  left: 50%;
  z-index: 60;
  width: var(--logo-size);             /* resting size (~150px) */
  /* starts muted grey (Figma); SVG paths use currentColor */
  color: var(--color-neutral-muted);
  transform: translate(-50%, 0) scale(1);
  transform-origin: center center;
  opacity: 0;
  transition:
    top var(--dur-splash) var(--ease-out),
    transform var(--dur-splash) var(--ease-out),
    opacity var(--dur-fade) var(--ease-out),
    color var(--dur-fade) var(--ease-out);
}

.site-logo .logo_img { display: block; width: 100%; height: auto; }

/* Splash state: centred + enlarged (≈360px) until the site has loaded */
body:not(.is-loaded) .site-logo {
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--logo-splash-scale));
}

/* Entrance + colour shift, in step with the reveal sequence */
.is-revealing .site-logo,
.is-loaded .site-logo { opacity: 1; }
/* Logo turns white as the video fades in */
.is-video .site-logo { color: var(--color-white); }

/* ---- Global nav (fixed to viewport bottom, used once) ---- */
.site-nav {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 50;
  width: 100%;
  padding: var(--padding-footer-block) var(--padding-global);
  /* fades in after the splash reveal */
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--dur-fade) var(--ease-out),
    transform var(--dur-fade) var(--ease-out);
}

/* Soft scrim + fading backdrop-blur behind the nav. It's 1.5x taller than
   the nav box and masked at the top, so the gradient AND the blur fade out
   with no hard line — content passing behind appears to blur/fade in. */
.site-nav::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 175%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(23, 27, 26, 0.85) 0%,
    rgba(23, 27, 26, 0.55) 38%,
    rgba(23, 27, 26, 0) 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 10%, rgba(0, 0, 0, 0) 100%);
          mask-image: linear-gradient(to top, #000 0%, #000 10%, rgba(0, 0, 0, 0) 100%);
  opacity: 1;
  transition: opacity var(--dur-fade) var(--ease-out);
}

/* No nav scrim on the Showreel section */
body[data-section="showreel"] .site-nav::before { opacity: 0; }

.site-nav-inner {
  display: flex;
  align-items: center;
  gap: var(--gap-footer-nav);
}

.footer_copyright,
.footer_social { flex: 1 0 0; min-width: 0; }

.footer_copyright,
.footer_nav,
.footer_social {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-micro);
  line-height: 1.7;
  color: var(--color-neutral-muted);
}

.footer_nav {
  display: flex;
  align-items: center;
  gap: var(--gap-footer-nav);
}

.footer_link {
  font-weight: 700;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-neutral-muted);
  transition: color 240ms var(--ease-out);
}

.footer_link:hover,
.footer_link:focus-visible { color: var(--color-white); }

.footer_social {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-xs);
  white-space: nowrap;
}

.footer_social-handle { color: var(--color-white); }

/* Active nav state */
.footer_link.is-active { color: var(--color-white); }


/* ---- Button (primary) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-micro);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out), border-color 240ms var(--ease-out);
}

/* Pill (Showreel "Enquire") */
.btn--pill {
  padding: 0.9rem 1.75rem;
  border-radius: 360px;
  color: #1c1c1c;
  background-color: #e5e5e5;
  border: 1px solid #e5e5e5;
}
.btn--pill:hover,
.btn--pill:focus-visible {
  background-color: var(--color-white);
  border-color: var(--color-white);
}

/* Pill, inverted (modal "Submit") */
.btn--pill-invert {
  padding: 0.9rem 1.75rem;
  border-radius: 360px;
  color: var(--color-white);
  background-color: var(--color-neutral-muted);
  border: 1px solid var(--color-neutral-muted);
}
.btn--pill-invert:hover,
.btn--pill-invert:focus-visible {
  background-color: #6c7268;
  border-color: #6c7268;
}


/* =========================================================================
   COMPONENT: ABOUT
   ========================================================================= */
.section_about {
  width: 100%;
  background-color: var(--color-neutral-darkest);
  overflow: hidden;
}

/* Portrait fills the slide */
.about_bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.about_bg-image {
  position: absolute;
  inset: 0;
  background-color: var(--color-neutral-dark);
  background-image:
    /* faint vignette + moody fallback shown until the photo is added */
    radial-gradient(75% 80% at 68% 38%, rgba(120, 120, 120, 0.30) 0%, transparent 62%),
    image-set(url("../assets/images/stuart-portrait.jpg") 1x);
  background-image:
    radial-gradient(75% 80% at 68% 38%, rgba(120, 120, 120, 0.30) 0%, transparent 62%),
    url("../assets/images/stuart-portrait.jpg");
  background-size: cover, cover;
  background-position: center, center top;
  background-repeat: no-repeat;
  filter: grayscale(100%);
}

/* Fixed legibility gradient behind the scrolling text (left 70% → 0% over ~50vw) */
.about_gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg,
    rgba(23, 27, 26, 0.70) 0%,
    rgba(23, 27, 26, 0) 50%);
}

/* Inner scroll area — content scrolls within the section (no visible scrollbar) */
.about_content {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.about_content::-webkit-scrollbar { width: 0; height: 0; }

/* Text column within the scroller */
.about_panel {
  min-height: 100%;
  display: flex;
  align-items: center;
  width: min(50vw, 100%);
  padding: clamp(9rem, 21vh, 13.5rem) clamp(2rem, 5vw, 5rem) clamp(9rem, 21vh, 13.5rem) var(--padding-global);
}

.about_panel-inner {
  width: 100%;
  max-width: 34rem;
}

.about_heading {
  margin: 0 0 var(--spacing-lg);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.875rem, 3.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-neutral-muted);
}

.about_intro { display: flex; flex-direction: column; gap: var(--spacing-md); }

.about_intro p,
.accordion_panel-inner p {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  line-height: 1.8;
  letter-spacing: -0.32px;
  color: var(--color-text-body);
}

/* ---- Accordion ---- */
.accordion { margin-top: var(--spacing-lg); }

.accordion_item { border-top: 1px solid var(--color-divider); }

.accordion_header { margin: 0; }

.accordion_trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  line-height: 1;
  color: var(--color-neutral-muted);
  transition: color 240ms var(--ease-out);
}
.accordion_trigger:hover,
.accordion_trigger:focus-visible { color: var(--color-text-body); }

.accordion_icon {
  flex-shrink: 0;
  transition: transform 320ms var(--ease-out);
}
.accordion_trigger[aria-expanded="true"] .accordion_icon { transform: rotate(180deg); }

.accordion_panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 380ms var(--ease-out);
}

.accordion_panel-inner {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding-bottom: var(--spacing-md);
}

.accordion_panel-inner strong {
  font-weight: 700;
  color: var(--color-white);
}

.accordion_clients { line-height: 2; }
.accordion_clients .client-dot {
  color: var(--color-neutral-muted);
  padding: 0 0.2em;
}

.about_enquire {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: var(--spacing-xl) auto 0;
}


/* =========================================================================
   COMPONENT: SHOWREEL
   ========================================================================= */
.section_showreel {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-neutral-darkest);
  /* top clears the fixed logo, bottom clears the fixed nav */
  padding: 7rem clamp(1.25rem, 7.5vw, 108px) 7.5rem;
}

.showreel_inner {
  width: 100%;
  max-width: 1224px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.showreel_heading {
  position: relative;
  z-index: 2;
  margin: 0 0 -0.5em;                 /* overlaps the top edge of the video */
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 4.5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: 0.2em;
  text-indent: 0.2em;                 /* optical centring vs. tracking */
  text-transform: uppercase;
  text-align: center;
  color: var(--color-neutral-muted);
}

.showreel_video-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 74svh;
}

.showreel_video-frame {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000;
}

.showreel_video {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* show the full frame; controls visible */
  background-color: #000;
  display: block;
}

/* Pill button straddling the bottom edge of the video */
.showreel_enquire {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
  z-index: 3;
  white-space: nowrap;
}


/* =========================================================================
   COMPONENT: MODAL (enquiry)
   ========================================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 320ms var(--ease-out), visibility 0s linear 320ms;
}
.modal.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 320ms var(--ease-out);
}

.modal_overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(23, 27, 26, 0.70);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.modal_close {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--padding-global);
  z-index: 2;
  display: inline-flex;
  padding: 0.5rem;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--color-text-body);
  transition: color 240ms var(--ease-out);
}
.modal_close:hover,
.modal_close:focus-visible { color: var(--color-white); }

/* Split card */
.modal_card {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(640px, 100%);
  max-width: 980px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #b7beb2;
  /* entrance */
  transform: translateY(14px) scale(0.985);
  transition: transform 360ms var(--ease-out);
}
.modal.is-open .modal_card { transform: none; }

.modal_media {
  flex: 1 1 0;
  align-self: stretch;
  min-height: 360px;
  background-color: #666;
  /* Optional: drop a photo at assets/images/modal-image.jpg */
  background-image: url("../assets/images/modal-image.jpg");
  background-size: cover;
  background-position: center;
}

.modal_content {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.75rem, 3vw, 2.5rem);
  text-align: center;
}

.modal_title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-neutral-darkest);
}

.modal_text {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.8;
  letter-spacing: -0.32px;
  color: var(--color-neutral-darkest);
}

.modal_form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
}

.modal_input {
  width: 100%;
  height: 42px;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: 100px;
  background-color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-neutral-darkest);
}
.modal_input::placeholder { color: #8f8f8f; }
.modal_input:focus-visible {
  outline: none;
  border-color: var(--color-neutral-muted);
}

.modal_success {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-neutral-darkest);
}


/* =========================================================================
   5. MOTION — reveal states
   ========================================================================= */

/* Splash grey fades away to reveal the video (overlay still dimming it) */
.is-video .splash_cover { opacity: 0; pointer-events: none; }

/* Global nav fades in last */
.is-loaded .site-nav { opacity: 1; transform: translateY(0); }

/* Showreel: scroll-triggered entrance from the About section */
.showreel_heading,
.showreel_video-wrap {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.section_showreel.is-inview .showreel_heading { opacity: 1; transform: none; }
.section_showreel.is-inview .showreel_video-wrap {
  opacity: 1;
  transform: none;
  transition-delay: 120ms;
}


/* =========================================================================
   RESPONSIVE — footer behaviour
   ========================================================================= */
@media (max-width: 991px) {
  /* About (narrow): portrait is a TOP BANNER fading to dark; the heading,
     bio, accordions and Enquire scroll within the section beneath it. */
  .about_bg { inset: 0 0 auto 0; height: 60%; }
  .about_gradient {
    background: linear-gradient(180deg,
      rgba(23, 27, 26, 0) 0%,
      rgba(23, 27, 26, 0.15) 26%,
      rgba(23, 27, 26, 0.75) 58%,
      var(--color-neutral-darkest) 78%);
  }
  .about_panel {
    width: 100%;
    align-items: flex-start;
    padding: 42vh var(--padding-global) 8rem;
  }
  .about_panel-inner { max-width: 100%; }

  /* Smaller pill on mobile so the full label stays on one line */
  .about_enquire {
    font-size: 0.5625rem;       /* 9px */
    letter-spacing: 1.5px;
    padding: 0.8rem 1.4rem;
  }
}

@media (max-width: 767px) {
  /* Footer: nav links across the top row, copyright + social on the row below */
  .site-nav-inner {
    flex-wrap: wrap;
    gap: 0.75rem 0.5rem;
  }
  .footer_nav {
    order: -1;
    flex: 1 0 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .footer_copyright { flex: 1 1 auto; order: 1; }
  .footer_social { flex: 0 0 auto; order: 2; justify-content: flex-end; }

  /* Showreel: portrait video on mobile */
  .showreel_video-wrap {
    width: min(318px, 100%);
    aspect-ratio: 318 / 500;
    max-height: 62svh;
  }
  .showreel_enquire { max-width: calc(100vw - 1.5rem); }

  /* Modal: stack image above content, taller image */
  .modal_card { flex-direction: column; }
  .modal_media { min-height: 240px; width: 100%; }
}


/* =========================================================================
   ACCESSIBILITY — reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .splash_cover,
  .site-logo,
  .hero_overlay,
  .site-nav,
  .modal,
  .modal_card,
  .fullpage .slide { transition-duration: 1ms; }
}
