/* ==========================================================================
   BFI Info Capture Page — Lander CSS Foundation
   Adapted from BFI Mailchimp event promo design system (042426)
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */
:root {
  /* Color palette — black/white with muted greys + BFI red accent */
  --bfi-bg:           #000000;
  --bfi-bg-elevated: #0a0a0a;
  --bfi-fg:           #ffffff;
  --bfi-fg-muted:     #b8b8b8;
  --bfi-fg-faint:     #888888;
  --bfi-divider:      #2a2a2a;
  --bfi-accent:       #b22222;
  --bfi-cta-bg:       #ffffff;
  --bfi-cta-fg:       #000000;
  --bfi-cta-bg-hover: #e5e5e5;

  /* Typography */
  --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-body:    'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Type scale */
  --fs-h1:        clamp(2.75rem, 8vw, 5.25rem);
  --fs-h2:        clamp(1.75rem, 4vw, 2.75rem);
  --fs-h3:        clamp(1.25rem, 2.25vw, 1.5rem);
  --fs-eyebrow:   0.875rem;
  --fs-body:      1rem;
  --fs-small:     0.8125rem;
  --fs-footer:    0.6875rem;

  /* Letter spacing — Cinzel uppercase needs generous tracking */
  --ls-display:   0.06em;
  --ls-eyebrow:   0.2em;
  --ls-cta:       0.15em;

  /* Line heights */
  --lh-tight:     1.15;
  --lh-snug:      1.3;
  --lh-normal:    1.55;

  /* Spacing scale */
  --space-1:      0.25rem;
  --space-2:      0.5rem;
  --space-3:      0.75rem;
  --space-4:      1rem;
  --space-6:      1.5rem;
  --space-8:      2rem;
  --space-12:     3rem;
  --space-16:     4rem;
  --space-20:     5rem;
  --space-24:     6rem;

  /* Layout */
  --container-max: 1280px;
  --container-narrow: 720px;
  --container-pad: clamp(1.25rem, 4vw, 3rem);

  /* Motion */
  --transition-base: 200ms ease;
}

/* --- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Stop any element from causing horizontal page scroll. Catches edge bleeds
   from the merch carousel negative margins, parallax bg overshoot, etc. */
html, body { overflow-x: hidden; max-width: 100vw; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--bfi-fg);
  background: var(--bfi-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, video, picture, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a { color: inherit; text-decoration: none; }
/* Keep tel/email links atomic — never break mid-number or mid-domain */
a[href^="tel:"], a[href^="mailto:"] { white-space: nowrap; }
button { border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; }

input, select, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
}

ul, ol { list-style: none; }

/* --- Typography classes -------------------------------------------------- */
.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
}

.h-1 { font-size: var(--fs-h1); }
.h-2 { font-size: var(--fs-h2); }
.h-3 { font-size: var(--fs-h3); }

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--bfi-fg-muted);
}

.lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--bfi-fg);
  max-width: 60ch;
}

.muted { color: var(--bfi-fg-muted); }
.faint { color: var(--bfi-fg-faint); }

.standout {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Layout primitives --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: clamp(3rem, 8vw, 6rem);
}

.section--tight {
  padding-block: clamp(2rem, 5vw, 4rem);
}

.divider {
  height: 1px;
  background: var(--bfi-divider);
  border: 0;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-cta);
  padding: 1.125rem 2.25rem;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
  white-space: nowrap;
}

.btn--primary {
  background: var(--bfi-cta-bg);
  color: var(--bfi-cta-fg);
  border-color: var(--bfi-cta-bg);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--bfi-cta-bg-hover);
  border-color: var(--bfi-cta-bg-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--bfi-fg);
  border-color: var(--bfi-fg);
}
.btn--ghost:hover, .btn--ghost:focus-visible {
  background: var(--bfi-fg);
  color: var(--bfi-bg);
}

.btn--accent {
  background: var(--bfi-accent);
  color: var(--bfi-fg);
  border-color: var(--bfi-accent);
}
.btn--accent:hover, .btn--accent:focus-visible {
  background: #8b1a1a;
  border-color: #8b1a1a;
}

.btn--block { display: block; width: 100%; }

/* --- Mobile responsive base tweaks ----------------------------------- */
@media (max-width: 480px) {
  /* Tighter button padding, but keep touch target ≥44px via min-height */
  .btn {
    padding: 0.95rem 1.25rem;
    min-height: 2.875rem;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    /* Allow text to wrap so long CTAs don't overflow on narrow screens */
    white-space: normal;
    line-height: 1.25;
  }
  /* Make form labels/eyebrows a touch smaller for better balance */
  .label { font-size: 0.8125rem; }
}

/* --- Form controls ------------------------------------------------------- */
.form-group { margin-bottom: var(--space-6); }

.label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--bfi-fg-muted);
  margin-bottom: var(--space-2);
}

.input, .select, .textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  min-height: 2.875rem; /* 46px — meets WCAG touch-target on mobile */
  background: var(--bfi-bg-elevated);
  border: 1px solid var(--bfi-divider);
  color: var(--bfi-fg);
  font-size: 1rem; /* 16px prevents iOS auto-zoom on focus */
  font-family: var(--font-body);
  transition: border-color var(--transition-base);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--bfi-fg);
}

.textarea { min-height: 7rem; resize: vertical; }

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23ffffff' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* --- Cards (for service grid, etc.) ------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--bfi-bg-elevated);
  border: 1px solid var(--bfi-divider);
  text-align: left;
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.card:hover {
  border-color: var(--bfi-fg);
  transform: translateY(-2px);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.25;
}

.card__body {
  font-size: var(--fs-small);
  color: var(--bfi-fg-muted);
  line-height: 1.5;
}

/* --- Scroll-driven reveal animations -------------------------------------- */
/* Pronounced fade-up + scale + blur reveal — clearly visible on scroll */
.reveal {
  opacity: 0;
  transform: translateY(64px) scale(0.94);
  filter: blur(10px);
  transition:
    opacity 950ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 950ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 700ms ease-out;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Card hover enhancement layer */
.lift {
  position: relative;
  overflow: hidden;
  transition:
    transform 320ms cubic-bezier(0.2, 0.65, 0.3, 1),
    border-color 320ms ease,
    background-color 320ms ease,
    box-shadow 320ms ease;
}
.lift::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(178, 34, 34, 0.18) 0%, transparent 55%),
    linear-gradient(225deg, rgba(255, 255, 255, 0.05) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 380ms ease;
  pointer-events: none;
  z-index: 0;
}
.lift::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 320ms ease, box-shadow 320ms ease;
  z-index: 0;
}
.lift > * { position: relative; z-index: 1; }
.lift:hover {
  transform: translateY(-5px);
  border-color: var(--bfi-accent);
  background: rgba(178, 34, 34, 0.04);
  box-shadow:
    0 18px 44px -14px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
}
.lift:hover::before { opacity: 1; }
.lift:hover::after {
  box-shadow: 0 0 0 1px rgba(178, 34, 34, 0.35) inset;
}

/* --- Parallax photo divider banners --------------------------------------- */
/* Fixed-position photo strip with dark overlay between content sections. */
.banner-fixed {
  position: relative;
  height: clamp(280px, 40vh, 460px);
  overflow: hidden;
  background: #000 center / cover no-repeat;
  isolation: isolate;
}
.banner-fixed::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.92) 100%);
  pointer-events: none;
  z-index: 0;
}
.banner-fixed__inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--container-pad);
}
.banner-fixed__copy {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bfi-fg);
  text-shadow: 0 2px 24px rgba(0,0,0,0.75);
  max-width: 30ch;
}
@media (max-width: 480px) {
  .banner-fixed { height: clamp(220px, 32vh, 340px); }
  .banner-fixed__copy {
    font-size: 1.0625rem;
    letter-spacing: 0.14em;
    max-width: 18ch;
  }
}
/* Parallax effect — only on desktop with a mouse pointer (iOS issues with fixed bg) */
@media (min-width: 720px) and (hover: hover) {
  .banner-fixed { background-attachment: fixed; }
}

/* Touch devices don't fire :hover — use :active for tap feedback */
@media (hover: none) {
  .lift:active {
    transform: translateY(-2px) scale(0.99);
    border-color: var(--bfi-accent);
    box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.85);
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  }
  .lift:active::before {
    opacity: 1;
    transition: opacity 120ms ease;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .lift { transition: none; }
  .lift:hover { transform: none; }
  .banner-fixed { background-attachment: scroll; }
}

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

.center-text { text-align: center; }
.flow > * + * { margin-top: 1em; }
.stack-tight > * + * { margin-top: var(--space-3); }
.stack > * + * { margin-top: var(--space-6); }
.stack-loose > * + * { margin-top: var(--space-12); }
