/* ===========================
   Fonts
============================ */
@font-face {
  font-family: "Gelica";
  src: url("../assets/Fonts/Gelica-Extra-Light.woff2") format("woff2"),
       url("../assets/Fonts/Gelica-Extra-Light.woff") format("woff"),
       url("../assets/Fonts/Gelica-Extra-Light.otf")  format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gelica";
  src: url("../assets/Fonts/Gelica-Light.woff2") format("woff2"),
       url("../assets/Fonts/Gelica-Light.woff") format("woff"),
       url("../assets/Fonts/Gelica-Light.otf")  format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gelica";
  src: url("../assets/Fonts/Gelica-Regular.woff2") format("woff2"),
       url("../assets/Fonts/Gelica-Regular.woff") format("woff"),
       url("../assets/Fonts/Gelica-Regular.otf")  format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gelica";
  src: url("../assets/Fonts/Gelica-Italic.woff2") format("woff2"),
       url("../assets/Fonts/Gelica-Italic.woff") format("woff"),
       url("../assets/Fonts/Gelica-Italic.otf")  format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Gelica";
  src: url("../assets/Fonts/Gelica-Medium.woff2") format("woff2"),
       url("../assets/Fonts/Gelica-Medium.woff") format("woff"),
       url("../assets/Fonts/Gelica-Medium.otf")  format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gelica";
  /* include both hyphen and underscore variants for safety */
  src: url("../assets/Fonts/Gelica-Semi-Bold.woff2") format("woff2"),
       url("../assets/Fonts/Gelica-Semi-Bold.woff") format("woff"),
       url("../assets/Fonts/Gelica-Semi-Bold.otf")  format("opentype"),
       url("../assets/Fonts/Gelica_Semi_bold.otf")  format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gelica";
  src: url("../assets/Fonts/Gelica-Bold.woff2") format("woff2"),
       url("../assets/Fonts/Gelica-Bold.woff") format("woff"),
       url("../assets/Fonts/Gelica-Bold.otf")  format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gelica";
  src: url("../assets/Fonts/Gelica-Black.woff2") format("woff2"),
       url("../assets/Fonts/Gelica-Black.woff") format("woff"),
       url("../assets/Fonts/Gelica-Black.otf")  format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ===========================
   Design Tokens
============================ */
:root {
  --stage-w: 100vw;
  --bg-ar: 0.5625;

  --zoom: 1;
  --bg-max-w: 1100px;
  --bg-width: var(--bg-max-w);
  --grad-width: var(--stage-w);
  --bg-height: calc(var(--bg-width) * var(--bg-ar));
  --stage-h: min(var(--page-max-h), max(100vh, var(--bg-height)));
  --page-max-h: 900px;

  --bg-shift: calc(-0.10 * var(--stage-h));

  --logo-x: 0.50;
  --logo-vis-w: 142px;
  --logo-ar: 0.50;
  --logo-fixed-top: 138px;

  --bg-left:   calc((var(--stage-w) - var(--bg-width)) / 2);
  --logo-vis-h: calc(var(--logo-vis-w) * var(--logo-ar));
  --logo-left: calc(var(--bg-left) + var(--bg-width) * var(--logo-x));
  --logo-top:  calc(var(--logo-fixed-top) + (var(--logo-vis-h) / 2));

  /* widths for text blocks */
  --tag-w:  92%;
  --lead-w: 64ch;
  --sub-w:  56ch;

  /* icons + footer */
  --icon-size: 17px;
  --icon-gap: 17px;
  --footer-w: min(36%, calc(var(--stage-w) * 0.90));
  --footer-size: 8px; /* always 8px */

  /* mouse-pan */
  --bg-pan-range: 10px;
  --bg-pan-x: 0px;
  --bg-pan-y: 0px;

  /* fixed anchor for #stack */
  --stack-top: 405px;

  /* Absolute anchors (screen Y positions) */
  --event-top: 600px; /* ****WAS 535PX!!**** */
  --cta-top:   725px; /* ****WAS 625PX!!**** */
  --icons-top: 720px;  /* adjust to taste */
  --footer-top: 750px; /* adjust to taste */
  --lead-sub-gap: 25px; /* gap between “great epics” and the sub line ****WAS 15PX!!**** */
}

/* =========================================
   Spacing controls (edit these only)
   Desktop default, then <=800px, then <=500px
========================================= */
:root {
  /* gaps between stacked sections inside #stack */
  --gap-tag-to-event: 30px;   /* Tagline -> Event */
  --gap-event-to-cta: 40px;   /* Event -> CTAs ****WAS 20PX!!**** */
  --gap-cta-to-social: 60px;  /* CTAs -> Social icons (icons hidden <=800px) */
  --gap-prev-to-footer: 20px; /* Previous section -> Footer */
}

@media (max-width: 800px) {
  :root {
    --gap-tag-to-event: 30px;
    --gap-event-to-cta: 40px; /* ****WAS 20PX!!**** */
    --gap-cta-to-social: 20px;     /* icons hidden; not used here */
    --gap-prev-to-footer: 40px;   /* CTAs -> Footer */
  }
}

@media (max-width: 500px) {
  :root {
    --gap-tag-to-event: 20px;  /* tune small-screen spacing here */
    --gap-event-to-cta: 30px;  /* your +7px row-gap remains in effect ****WAS 20PX!!**** */
    --gap-cta-to-social: 0px;  /* icons hidden; not used here */
    --gap-prev-to-footer: 40px;
  }
}

.u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --bg-pan-range: 0px; }
}

/* ===========================
   Resets & Base
============================ */
html, body {
  margin: 0;
  min-height: 0;                  /* allow shorter than viewport */
  height: var(--stage-h);         /* page height = capped stage */
  background: #000;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

/* Site-wide font default (prevents fallback to system fonts) */
body { font-family: "Gelica", serif; font-weight: 400; font-synthesis: none; }
/* Ensure UI controls use the same font */
button, input, select, textarea { font: inherit; }
/* Prevent layout shift when scrollbar appears */
html { scrollbar-gutter: stable both-edges; }

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
img, svg, video, iframe { max-width: 100%; height: auto; display: block; }

#stack, #tagline, .event, .cta-row, .social-row, .footer-copy {
  max-width: 100%;
  min-width: 0;
}

/* ===========================
   Hero & Layers
============================ */
#hero {
  position: relative;
  width: var(--stage-w);
  height: var(--stage-h);
  margin: 0 auto;
  z-index: 1;
  overflow: hidden;               /* clip bg beyond 900px */
}
#base, #overlay, #scrim, #gradients { position: absolute; inset: 0; pointer-events: none; }

#base {
  background-color: #000;       /* set color only */
  background-repeat: no-repeat; /* image added via media queries below */
  background-position: calc(50% + var(--bg-pan-x)) calc(var(--bg-shift) + var(--bg-pan-y));
  background-size: var(--bg-width) auto;
  z-index: 0;
}
#overlay {
  background-repeat: no-repeat; /* image added via media queries below */
  background-position: calc(50% + var(--bg-pan-x)) calc(var(--bg-shift) + var(--bg-pan-y));
  background-size: var(--bg-width) auto;
  opacity: 0;
  transition: opacity 1s linear;
  will-change: opacity;
  z-index: 1;
}

/* Width-aware background sources (serve 1 file only) */
@media (max-width: 750px) {
  #base    { background-image: url("../assets/dark-chamber-optimised-smallest-XS.webp"); }
  #overlay { background-image: url("../assets/flooded-chamber-optimised-smallest-XS.webp"); }
}
@media (min-width: 751px) and (max-width: 1400px) {
  #base    { background-image: url("../assets/dark-chamber-optimised-smallest.webp"); }
  #overlay { background-image: url("../assets/flooded-chamber-optimised-smallest.webp"); }
}
@media (min-width: 1401px) {
  #base    { background-image: url("../assets/dark-chamber-optimised-smallest.webp"); }
  #overlay { background-image: url("../assets/flooded-chamber-optimised-smallest.webp"); }
}

#scrim {
  background: #000;
  opacity: 0.50;         /* ****WAS 55%!!**** */
  z-index: 2;            /* same as #gradients; comes before it in DOM so it’s beneath */
}

#gradients::before {
  content: "";
  position: absolute;
  inset: -24px;
  background: url("../assets/3440-gradients-l&rcolour.svg") center calc(var(--bg-shift)) no-repeat;
  background-size: calc(var(--grad-width) + 48px) auto; /* fill full width */
  filter: blur(3px);
  will-change: filter;
}
#gradients {
  z-index: 2;
  opacity: 0.60 !important;   /* fixed, no scroll/time changes */
  transition: none;           /* don’t animate */
  will-change: auto;
}

/* Logo pinned to image-space */
#logo {
  position: absolute;
  top: var(--logo-top);
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--logo-vis-w);
  height: auto;
  pointer-events: none;
  z-index: 3;
}

/* Intro wrapper */
#intro { position: relative; height: auto; }

/* Stack sits just below the logo inside the hero */
#stack {
  position: absolute;
  top: var(--stack-top);
  left: 50%;
  transform: translateX(-50%);
  width: var(--tag-w);
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  z-index: 3; /* above gradients */
  pointer-events: auto;
}

/* ===========================
   Copy
============================ */
#tagline .lead {
  font-family: "Gelica-Regular", serif;
  /*font-weight: 400;   /* Regular */
  font-size: 16px;    /* fixed */
  line-height: 1.25;
  letter-spacing: 0.01em;
  max-width: var(--lead-w);
  margin-inline: auto;
}

#tagline .sub {
  position: static;
  top: auto; left: auto; transform: none;
  margin-top: var(--lead-sub-gap);
  width: auto;
  font-family: "Gelica-Light", serif;
  font-size: 15px;
  line-height: 1.35;
  opacity: 0.95;
  max-width: var(--sub-w);
  margin-inline: auto;
}

/* First two words bold */
#tagline .sub .brand { font-weight: 700; }

.event {
  position: static;
  top: auto; left: auto;
  transform: none;
  width: var(--tag-w);
  margin: var(--gap-tag-to-event) auto 0;
  text-align: center;
}

/* Event title typography + rectangle plate */
.event .event-title {
  margin: 0;
  display: inline-block;
  position: relative;
}
.event .event-title a {
  position: relative;
  display: inline-block;
  font-family: "Gelica", serif;
  font-weight: 400;          /* Regular */
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  z-index: 0;
}
.event .event-title a::before {
  content: "";
  position: absolute;
  width: 270px;
  height: 80px;
  left: 50%;
  top: -7px;  /* text sits 7px from top of rectangle */
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Event meta information (date, location) */
.event .event-meta {
  font-family: "Gelica-Extra-Light", serif;
  font-weight: 100;         /* Light */
  font-style: italic;
  font-size: 9px;           /* 2 sizes smaller */
  line-height: 1.4;
  opacity: 0.95;
  margin-top: 10px;         /* ~5px lower */
}
.event .event-meta .loc,
.event .event-meta .time { font-size: inherit; }

/* CTA row at 625px from the top */
.cta-row {
  position: static;
  top: auto; left: auto;
  transform: none;
  width: var(--tag-w);
  margin: var(--gap-event-to-cta) auto 0;
  display: grid;
  grid-template-columns: repeat(4, auto);
  column-gap: 70px;                  /* 100px between CTA items */
  row-gap: clamp(16px, 2.5vw, 28px);  /* if the row wraps */
  justify-content: center;
  text-align: center;
}

/* CTA typography + rectangle plate */
.cta-row a.cta {
  position: relative;
  display: inline-block;
  font-family: "Gelica", serif;
  font-weight: 400;          /* Regular */
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  z-index: 0;
}
.cta-row a.cta::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 65px;
  left: 50%;
  top: -7px;  /* text sits 7px from top of rectangle */
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Subtle grow effect for CTA buttons */
.cta-row .cta {
  transform-origin: center center;
  transition: transform 150ms ease, box-shadow 150ms ease;
  will-change: transform;
}

.cta-row .cta:hover,
.cta-row .cta:focus-visible {
  transform: scale(1.04);
}

/* Mobile keeps one-per-row; plates still apply */
@media (max-width: 800px) {
  .cta-row {
  grid-template-columns: repeat(2, auto); /* two columns */
  column-gap: 100px;                     /* horizontal space between the two columns */
  row-gap: clamp(18px, 5vw, 28px);       /* space between the two rows */
  }
.social-row { display: none !important; }
  :root {
  --icons-top: 780px;
   --footer-top: 790px;
   --footer-w: min(72%, calc(var(--stage-w) * 0.96));
 }
}

/* Mini mobile adjustments (<=500px) */
@media (max-width: 500px) {
  :root {
    /* Move headline + sub up 10px */
    --stack-top: calc(405px - 30px);

    /* Push everything below down 30px */
    --event-top: calc(535px + 40px);
    --cta-top:   calc(625px + 40px);

    /* These are overridden at <=800px, so add 30px to those values */
    --icons-top:  calc(780px + 40px); /* 810px */
    --footer-top: calc(770px + 20px); /* 800px */
  }
  .cta-row {
    row-gap: calc(clamp(18px, 5vw, 28px) + 7px);
  }
}

/* =========================================
   Flow layout for #stack children
   Keeps logo pinned from top; sections below are spaced by margins.
========================================= */
#tagline { margin-top: 0; }

/* Social icons flow after CTAs on desktop (hidden <=800px already) */
.social-row {
  position: static;
  top: auto; left: auto;
  transform: none;
  width: var(--tag-w);
  margin: var(--gap-cta-to-social) auto 0;
  display: flex;                 /* row layout */
  justify-content: center;       /* center the row */
  gap: var(--icon-gap);          /* spacing between icons */
  flex-wrap: nowrap;             /* keep single row on wide screens */
}
.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.social-row img {
  height: var(--icon-size);
  width: auto;
  display: block;
}

/* Footer flows after previous section (icons if shown, else CTAs) */
.footer-copy {
  position: static;
  top: auto; left: auto;
  transform: none;
  width: var(--footer-w);
  margin: var(--gap-prev-to-footer) auto 0;

  /* restore typography */
  font-family: "Gelica-Light", serif;   /* use the Gelica family */
  font-weight: 100;               /* Light */
  font-size: var(--footer-size);  /* 8px */
  line-height: 1.35;
  color: #fff;
  opacity: 0.95;
  text-align: center;
}

.footer-copy a {
  color: inherit;
  font-weight: inherit;           /* keep links light by default */
  text-decoration: underline;     /* default: underlined */
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* Keep mail links bold and not underlined */
.footer-copy a[href^="mailto:info@" i],
.footer-copy a[href^="mailto:collab@" i] {
  font-weight: 700;
  text-decoration: none;
}

/* ===========================
   Video Modal
============================ */
#video-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
}
#video-modal.open { display: flex; }
#video-modal .modal-frame {
  width: 100vw;
  max-height: 90vh;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
#video-modal iframe { width: 100%; height: 100%; border: 0; display: block; }
#video-modal .close-btn {
  position: fixed;
  top: 14px; right: 18px;
  background: transparent; border: 0; color: #fff;
  font-size: 56px; line-height: 1; cursor: pointer;
}
#video-modal .close-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* Lock the page when the video modal is open */
html.video-open {
  overflow: hidden;   /* hide root scrollbars */
  --stage-h: 100vh;   /* force stage height to viewport to avoid page scroll */
}
html.video-open body {
  overflow: hidden;   /* iOS/Safari belt-and-braces */
  height: 100vh;      /* override height: var(--stage-h) if needed */
}

/* Prevent scroll/bounce inside the modal from propagating */
#video-modal {
  overscroll-behavior: contain;
}

/* Boot cover (initial black screen, fades out in 3s) */
#boot-cover {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 2147483647;
  opacity: 1;
  transition: opacity 2s ease-in;
}
html.boot-done #boot-cover {
  opacity: 0;
  pointer-events: none;
}

/* Disable these transitions until we reveal to avoid first-frame jank */
html:not(.boot-done) #overlay,
html:not(.boot-done) #gradients {
  transition: none !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #overlay, #gradients { transition: none !important; }
}

/* Hamburger menu button (shown at <=800px) */
.menu-btn {
  position: fixed;
  top: 14px; right: 18px;
  width: 40px; height: 40px;
  background: transparent; border: 0; padding: 0;
  color: #fff; cursor: pointer;
  display: none;                 /* hidden by default */
  z-index: 10000;                /* above hero */
}
.menu-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
/* three bars */
.menu-btn::before,
.menu-btn::after,
.menu-btn > span {
  content: "";
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.menu-btn::before { top: 12px; }
.menu-btn > span { top: 19px; }
.menu-btn::after  { top: 26px; }

@media (max-width: 800px) {
  .menu-btn { display: inline-flex; }
}

/* Social Menu Modal */
#menu-modal {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.90); /* was 0.96: a little more see-through */
  z-index: 10001;
}
#menu-modal.open { display: flex; }
#menu-modal .menu-grid {
  width: min(480px, 90vw);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
  justify-items: center;
}
#menu-modal .menu-grid a {
  width: 64px;  /* was 80px: 20% smaller */
  height: 64px; /* was 80px */
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.95;
  transition: opacity 160ms ease, transform 160ms ease;
}
#menu-modal .menu-grid a:hover,
#menu-modal .menu-grid a:focus-visible {
  opacity: 1; transform: translateY(-1px);
}
#menu-modal .menu-grid img { width: 100%; height: 100%; display: block; }
#menu-modal .close-btn {
  position: fixed;
  top: 14px; right: 18px;
  background: transparent; border: 0; color: #fff;
  font-size: 56px; line-height: 1; cursor: pointer;
}
#menu-modal .close-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* Narrow screens: drop the icon grid 80px lower */
@media (max-width: 800px) {
  #menu-modal .menu-grid {
    transform: translateY(80px);
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #menu-modal .menu-grid a { transition: none; }
}

/* Hide the hamburger while the video modal is open */
html.video-open .menu-btn {
  display: none !important;
}
