/* =========================================================
   I Do, For Now — 7 Year Marriage Contracts
   Restyled to the designer style guide:
   cream / brown / red · Germania One + Caudex
   ========================================================= */

:root {
  /* Palette (designer tokens) */
  --colour-cream: #E5D9CF;
  --colour-brown: #382929;
  --colour-red:   #E72D4C;

  /* Rules / dividers (low-opacity per guide) */
  --rule-dark:  rgba(56, 41, 41, 0.16);    /* brown on light */
  --rule-light: rgba(229, 217, 207, 0.15); /* cream 15% on dark */
  --rule-red:   rgba(231, 45, 76, 0.30);   /* red, low opacity */
  --overlay:    rgba(28, 20, 20, 0.94);

  /* Type */
  --font-display: 'Germania One', serif;
  --font-body:    'Caudex', serif;
  --font-utility: 'Caudex', serif;

  /* Scale */
  --text-xl:   clamp(3rem, 8vw, 7rem);
  --text-lg:   clamp(1.5rem, 3vw, 2.5rem);
  --text-base: 1.125rem;

  /* Motion */
  --transition-slow: 0.6s ease;
  --transition-fast: 0.2s ease;

  /* Layout */
  --maxw: 1080px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  /* inline padding that holds content to --maxw while the section bleeds full width */
  --bleed-pad: max(var(--gutter), calc(50vw - var(--maxw) / 2));
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* offset for sticky nav */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  /* Local colour roles — flipped on dark sections below */
  --text: var(--colour-brown);
  --text-soft: rgba(56, 41, 41, 0.66);
  --rule: var(--rule-dark);

  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  color: var(--text);
  background-color: var(--colour-cream);
  /* faint parchment grain, no image dependency */
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(56,41,41,0.010) 3px 4px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

::selection { background: var(--colour-red); color: var(--colour-cream); }

/* Utility label — Caudex caps, per guide */
.eyebrow,
.nav-links a,
.section-index,
.credit-role,
.credit-heading,
.made-by-label {
  font-family: var(--font-utility);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--bleed-pad);
  background: rgba(229, 217, 207, 0.85);
  backdrop-filter: saturate(120%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { color: var(--colour-red); font-size: 0.95rem; transform: translateY(-1px); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 2rem);
}
.nav-links a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.7rem;
  position: relative;
  padding: 0.2rem 0;
  transition: color var(--transition-fast);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: var(--colour-red);
  transition: width var(--transition-slow);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

@media (max-width: 620px) {
  .nav-links { display: none; } /* keep nav minimal on small screens */
}

/* ---------- Shared section scaffolding ---------- */
.section {
  padding: clamp(3.5rem, 9vw, 7rem) var(--bleed-pad);
  border-top: 1px solid var(--rule);
}

.section-head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section-index {
  display: inline-block;
  color: var(--colour-red);
  font-size: 0.72rem;
  margin-bottom: 0.85rem;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  font-size: var(--text-lg);
  margin: 0 0 0.6rem;
  line-height: 1.1;
}
.section-sub {
  max-width: 46ch;
  margin: 0 auto;
  color: var(--text-soft);
  font-style: italic;
  font-size: 1rem;
}

/* ---------- Dark sections (cream on brown) ---------- */
.bts,
.credits-section,
.site-footer {
  background: var(--colour-brown);
  color: var(--colour-cream);
  --text: var(--colour-cream);
  --text-soft: rgba(229, 217, 207, 0.72);
  --rule: var(--rule-light);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(2.5rem, 7vw, 5.5rem) var(--bleed-pad) clamp(3rem, 6vw, 5rem);
  text-align: center;
}
.hero-inner { display: contents; }
.eyebrow {
  font-size: 0.72rem;
  color: var(--colour-red);
  margin: 0 0 1.3rem;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin: 0 0 1rem;
}
.hero-tagline {
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-style: italic;
  color: var(--text);
  margin: 0 auto 1.3rem;
  max-width: 38ch;
}
.hero-logline {
  max-width: 54ch;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  color: var(--text-soft);
  font-size: 1.05rem;
}

/* ---------- Agency wordmark ---------- */
/* Source art is eggplant; brightness(0) tints it to brown-black on light.
   On dark sections it is inverted to cream. */
.agency-logo {
  display: block;
  margin: 0 auto;
  height: auto;
  filter: brightness(0);
}
.hero-logo {
  width: clamp(170px, 34%, 290px);
  margin-bottom: clamp(1.8rem, 4vw, 2.6rem);
}
.made-by .agency-logo { width: clamp(200px, 50%, 400px); }
/* flip to cream where it sits on brown */
.credits-section .agency-logo { filter: brightness(0) invert(1); }

/* ---------- Video frames ---------- */
.video-frame {
  position: relative;
  margin: 0 auto;
  max-width: 920px;
  padding: clamp(0.4rem, 1.2vw, 0.7rem);
  background: var(--colour-brown);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 50px -28px rgba(28, 20, 20, 0.6);
}
/* inner red accent rule — the "altarpiece" frame highlight */
.video-frame::before {
  content: "";
  position: absolute;
  inset: clamp(0.4rem, 1.2vw, 0.7rem);
  border: 1px solid var(--rule-red);
  pointer-events: none;
  z-index: 2;
}
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1212;
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.film-caption {
  text-align: center;
  margin-top: 1.1rem;
  color: var(--text-soft);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* ---------- Scroll cue ---------- */
.scroll-cue {
  display: block;
  width: 2.4rem; height: 2.4rem;
  line-height: 2.4rem;
  margin: clamp(2rem, 5vw, 3rem) auto 0;
  text-align: center;
  text-decoration: none;
  color: var(--text-soft);
  border: 1px solid var(--rule);
  border-radius: 50%; /* circle (seal) — allowed */
  font-size: 1.1rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  animation: bob 2.4s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--colour-red); border-color: var(--colour-red); }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(0.6rem, 1.5vw, 1rem);
}
.gallery-item {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: rgba(56, 41, 41, 0.08);
  border: 1px solid var(--rule);
  aspect-ratio: 4 / 3;
  cursor: pointer;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.gallery-item::after {
  content: "\2295"; /* circled plus — "enlarge" hint */
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--colour-cream);
  background: rgba(56, 41, 41, 0.34);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item:hover::after { opacity: 1; }

/* Graceful state if an image is missing */
.gallery-item img[data-broken] { opacity: 0; }
.gallery-item.is-broken {
  display: grid;
  place-items: center;
}
.gallery-item.is-broken::before {
  content: "Still coming soon";
  position: absolute;
  color: var(--text-soft);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

/* ---------- Credits ---------- */
.credits {
  max-width: 620px;
  margin: 0 auto;
}
.credit-row {
  display: flex;
  align-items: baseline;
  padding: 0.4rem 0;
}
.credit-role {
  flex: 1 1 0;
  text-align: right;
  padding-right: 1.1rem;
  color: var(--text-soft);
  font-size: 0.68rem;
  line-height: 1.5;
}
.credit-name {
  position: relative;
  flex: 1 1 0;
  text-align: left;
  padding-left: 1.1rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
/* red dot pinned to the centre line, aligned to the first line of the name */
.credit-name::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0.75em;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%; /* seal dot — allowed */
  background: var(--colour-red);
}
.credit-block { margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.credit-heading {
  text-align: center;
  font-size: 0.7rem;
  color: var(--colour-red);
  margin: 0 0 1rem;
}
.credit-heading::before,
.credit-heading::after {
  content: "\2014";
  color: var(--rule-red);
  margin: 0 0.6rem;
}

/* ---------- Made-by (agency logo) ---------- */
.made-by {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
}
.made-by-label {
  font-size: 0.7rem;
  color: var(--text-soft);
}

.credits-signoff {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
  font-family: var(--font-display);
}
.signoff-mark { color: var(--colour-red); font-size: 1.5rem; }
.credits-signoff > span:nth-child(2) {
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}
.signoff-fine {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.5rem var(--bleed-pad) 3.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-soft);
  font-size: 0.85rem;
}
.to-top { text-decoration: none; color: var(--text-soft); transition: color var(--transition-fast); }
.to-top:hover { color: var(--colour-red); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: var(--overlay);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }

.lb-stage { margin: 0; max-width: 100%; max-height: 100%; }
.lb-image {
  max-width: min(1100px, 92vw);
  max-height: 84vh;
  width: auto;
  border: 1px solid rgba(229, 217, 207, 0.18);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9);
}

.lb-close, .lb-nav {
  position: fixed;
  background: transparent;
  border: 1px solid rgba(229, 217, 207, 0.3);
  color: var(--colour-cream);
  cursor: pointer;
  border-radius: 50%; /* circle — allowed */
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.lb-close:hover, .lb-nav:hover {
  background: rgba(229, 217, 207, 0.12);
  border-color: var(--colour-cream);
}
.lb-close {
  top: clamp(1rem, 3vw, 1.75rem);
  right: clamp(1rem, 3vw, 1.75rem);
  width: 2.6rem; height: 2.6rem;
  font-size: 1.5rem;
  line-height: 1;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem; height: 3rem;
  font-size: 1.8rem;
  line-height: 1;
}
.lb-prev { left: clamp(0.75rem, 3vw, 2rem); }
.lb-next { right: clamp(0.75rem, 3vw, 2rem); }

@media (max-width: 520px) {
  .lb-nav { width: 2.4rem; height: 2.4rem; font-size: 1.4rem; }
}
