/* ==========================================================================
   Back Fence Games: Erg Edition — static one-pager
   Rebuilt from https://bfg-erg-edition.webflow.io/ (95% fidelity target)
   ========================================================================== */

:root {
  /* Colors */
  --color-background: #0a0d03;
  --color-foreground: #0f140a;
  --color-text: #d1d5dc;
  --color-heading: #ffffff;
  --color-accent: #9ae600;
  --color-border: #99a1af;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-overlay-dark: rgba(0, 0, 0, 0.5);
  --color-overlay-darker: rgba(0, 0, 0, 0.4);
  --color-cta-tint: rgba(10, 13, 3, 0.7);

  /* Typography */
  --font-heading: "Barlow Condensed", sans-serif;
  --font-body: "Space Mono", monospace;

  --size-h1: 6.5rem;
  --size-h2: 6rem;
  --size-h3: 2.5rem;
  --size-h4: 2rem;
  --size-medium: 1.125rem;
  --size-regular: 1rem;
  --size-tiny: 0.75rem;

  /* Spacing scale */
  --space-tiny: 0.25rem;
  --space-xsmall: 1rem;
  --space-small: 1.5rem;
  --space-medium: 2rem;
  --space-large: 3rem;
  --space-xlarge: 4rem;
  --space-xxlarge: 5rem;

  --section-padding: 7rem;
  --container-max: 80rem;
  --radius: 0px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration-fast: 0.2s;
  --duration-medium: 0.5s;
  --duration-slow: 0.8s;
}

/* ---------- Reset & base ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--size-regular);
  line-height: 1.5;
}

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

a {
  color: inherit;
}

ul {
  margin: var(--space-xsmall) 0;
  padding-left: 1.25rem;
}

li {
  margin: 0.25rem 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: var(--color-background);
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0;
}

/* The 5% gutter lives on each section-level wrapper (.section, .hero,
   .footer, .navbar), not on .container itself. Percentage padding resolves
   against the PARENT's width, so putting it on .container (which itself
   caps at --container-max) meant the gutter kept growing with the
   viewport even after the 1280px cap engaged - content shrank on wide
   screens instead of settling at a true 1280px. Keeping .container as a
   pure max-width + center wrapper lets it actually reach --container-max. */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.section {
  padding: var(--section-padding) 5%;
}

.divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
  margin: var(--space-medium) 0;
}

.accent {
  color: var(--color-accent);
}

.tagline {
  color: var(--color-accent);
  letter-spacing: 0.25rem;
  text-transform: uppercase;
  font-size: var(--size-tiny);
  font-weight: 600;
  margin: 0 0 var(--space-xsmall);
}

.text-medium {
  font-size: var(--size-medium);
}
.text-tiny {
  font-size: var(--size-tiny);
}

/* ---------- Headings ---------- */
.h1,
.h2,
.h3,
.h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 700;
  margin: 0;
}

.h1 {
  text-transform: uppercase;
  font-size: var(--size-h1);
  line-height: 1.2;
  margin-bottom: var(--space-small);
}

.h2 {
  text-transform: uppercase;
  font-size: var(--size-h2);
  line-height: 1;
  margin-bottom: var(--space-small);
}

.h3 {
  font-size: var(--size-h3);
  line-height: 1.2;
  margin-bottom: var(--space-xsmall);
}

.h4 {
  font-size: var(--size-h4);
  line-height: 1.3;
  margin-bottom: var(--space-xsmall);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  border: 1px solid var(--color-background);
  border-radius: var(--radius);
  background-color: var(--color-accent);
  color: var(--color-background);
  text-align: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease);
}

.button:hover {
  border-color: var(--color-accent);
  background-color: var(--color-foreground);
  color: var(--color-accent);
  transform: translateY(-2px);
}

.button--large {
  margin-top: var(--space-medium);
  padding: 1rem 2rem;
}

.button--full {
  width: 100%;
  margin: var(--space-medium) 0;
}

.button--navbar {
  padding: 0.5rem 1.25rem;
}

/* ---------- Navbar ---------- */
.navbar {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  z-index: 100;
  padding: 0 5%;
}

.navbar__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0;
}

.navbar__logo {
  height: 2rem;
  display: block;
}

@media (max-width: 767px) {
  .navbar__logo {
    max-height: 1.5rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  max-height: 60rem;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
}

.hero__bg-tint {
  position: absolute;
  inset: 0;
  background-color: var(--color-overlay-darker);
  z-index: 1;
}

.hero__video {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-xxlarge) 0;
}

/* ---------- Section head ---------- */
.section-head {
  max-width: 48rem;
  margin-bottom: var(--space-xxlarge);
}

@media (max-width: 767px) {
  .section-head {
    margin-bottom: var(--space-large);
  }
}

/* ---------- Concept cards ---------- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem 2rem;
  align-items: start;
}

.concept-card__icon {
  width: 3rem;
  height: 3rem;
  color: var(--color-accent);
  margin-bottom: var(--space-small);
}

.concept-card__icon svg {
  width: 100%;
  height: 100%;
}

/* ---------- Timeline / "How it works" step-scroll ---------- */
.timeline__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8rem;
  align-items: start;
  position: relative;
}

.timeline__intro {
  position: sticky;
  top: 5rem;
  padding-right: var(--space-xsmall);
}

/* .timeline__stages wraps .timeline__progress + .timeline__steps so the
   line's containing block is exactly the steps list - not the whole
   .timeline__grid, whose own height includes .timeline__intro too and
   (on mobile, where the grid collapses to one column and intro/steps
   stack instead of sharing a row) would otherwise stretch the line up
   through the intro heading as well.

   .timeline__progress is intentionally NOT a grid item of the OUTER grid
   (it used to carry explicit grid-column/grid-row there, which made Grid
   auto-placement treat that cell as taken and shove .timeline__intro into
   column 2 instead — the "intro goes missing" bug from an earlier fix). */
.timeline__stages {
  position: relative;
}

/* left: -4rem matches .timeline__dot's own offset (see below) exactly, so
   the line and every dot share one anchor point instead of two formulas
   (e.g. "50% of the grid" vs "-4rem from the step") that only happened to
   agree by coincidence of equal column widths. */
.timeline__progress {
  position: absolute;
  left: -4rem;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
}

.timeline__progress-track,
.timeline__progress-fill {
  position: absolute;
  inset: 0;
  width: 100%;
}

/* Fades the hard top edge of the line into the page background instead of
   a harsh solid cutoff, via an alpha mask so it always matches whatever
   sits behind it (no color to keep in sync with --color-background). */
.timeline__progress-track,
.timeline__progress-fill {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 4rem);
  mask-image: linear-gradient(to bottom, transparent, #000 4rem);
}

.timeline__progress-track {
  background-color: var(--color-text);
  opacity: 0.2;
}

.timeline__progress-fill {
  height: var(--timeline-progress, 0%);
  background-color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
  .timeline__progress-fill {
    height: 100%;
  }
}

.timeline__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5rem;
}

/* Content stacks above its photo (matches the reference layout). A literal
   "max-content 1fr" side-by-side track here previously forced the content
   column to the width of its longest unwrapped line of text, which blew
   out this column's width in the outer .timeline__grid and squeezed
   .timeline__intro down to a sliver. */
.timeline__step {
  position: relative;
  display: grid;
  gap: var(--space-large);
}

/* transform: translateX(-50%) centers the dot's own midpoint on the line's
   x-position, rather than its left edge - the line sits at -4rem but a
   15px-wide dot anchored there by its edge would sit ~7px off-center.

   The box-shadow is a fixed-size halo in the page background color - not a
   second ring, just a gap - so the dot reads as cleanly separated from the
   line it sits on instead of visually fusing with it. It doesn't change
   between states; only the dot's own fill color does. z-index keeps that
   halo painting over the line regardless of DOM order. */
.timeline__dot {
  position: absolute;
  left: -4rem;
  top: 2rem;
  transform: translateX(-50%);
  z-index: 1;
  width: 0.9375rem;
  height: 0.9375rem;
  border-radius: 100%;
  background-color: var(--color-text);
  box-shadow: 0 0 0 5px var(--color-background);
  transition: background-color var(--duration-medium) var(--ease);
}

.timeline__step.is-active .timeline__dot {
  background-color: var(--color-accent);
}

.timeline__content ul,
.timeline__content p {
  font-size: var(--size-regular);
}

.timeline__image {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
}

.timeline__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Pricing / divisions ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.pricing-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-foreground);
  padding: var(--space-small);
}

.pricing-card__title {
  font-size: clamp(2rem, 1.5rem + 1.25vw, 2.5rem);
  margin: 0 !important;
}

.pricing-card__features {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  display: grid;
  gap: var(--space-xsmall);
}

.pricing-card__features li {
  display: flex;
  align-items: flex-start;
  margin: 0;
}

.pricing-card__features .check {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: var(--space-xsmall);
  color: var(--color-accent);
  fill: currentColor;
  stroke: currentColor;
}

/* ---------- Final CTA ---------- */
.cta {
  position: relative;
}

.cta__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cta__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}

.cta__bg-tint {
  position: absolute;
  inset: 0;
  background-color: var(--color-cta-tint);
  z-index: 1;
}

.cta__content {
  position: relative;
  z-index: 2;
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
  color: var(--color-white);
}

.cta__form {
  max-width: 30rem;
  margin: var(--space-medium) auto 0;
}

.cta__form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: var(--space-xsmall);
}

.input {
  flex: 1;
  border: 1px solid var(--color-white);
  border-radius: var(--radius);
  background-color: transparent;
  color: var(--color-white);
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--size-regular);
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.cta__message {
  max-width: 30rem;
  margin: var(--space-xsmall) auto 0;
  padding: 1rem 1.5rem;
  font-weight: 600;
}

.cta__message--success {
  color: #027a48;
  background-color: #ecfdf3;
}

.cta__message--error {
  color: #b42318;
  background-color: #fef3f2;
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-xxlarge) 5%;
}

.footer__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer__logo {
  height: 2rem;
  margin-bottom: var(--space-medium);
}

.footer__links {
  display: flex;
  gap: var(--space-small);
  flex-wrap: wrap;
  justify-content: center;
}

.footer__link {
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

.footer__link:hover {
  color: var(--color-accent);
}

.footer__bottom {
  padding-top: var(--space-small);
  text-align: center;
}

.footer__credit {
  font-size: 0.875rem;
  margin: 0;
}

/* ==========================================================================
   Scroll-reveal micro-interactions (max ~5% enhancement)
   ========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-slow) var(--ease),
    transform var(--duration-slow) var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .button:hover {
    transform: none;
  }
}

/* ==========================================================================
   Responsive breakpoints (match Webflow's 991 / 767 / 479 steps)
   ========================================================================== */
@media screen and (max-width: 991px) {
  :root {
    --size-h1: 5.5rem;
    --size-h2: 4rem;
    --size-h3: 2.25rem;
    --size-h4: 1.75rem;
    --section-padding: 6rem;
  }

  .concept-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 767px) {
  :root {
    --size-h1: 4.5rem;
    --size-h2: 2.75rem;
    --size-h3: 2rem;
    --size-h4: 1.5rem;
    --section-padding: 4rem;
  }

  .concept-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .timeline__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .timeline__intro {
    position: static;
    padding-right: 0;
  }

  /* Dots move to the step's own left edge in the single-column mobile
     layout (see .timeline__dot below) - match the line to the same x. */
  .timeline__progress {
    left: 0;
  }

  .timeline__step {
    padding-left: 2rem;
  }

  .timeline__dot {
    left: 0;
    top: 0.25rem;
  }

  .cta__form-row {
    flex-direction: column;
  }

  .footer__links {
    flex-direction: column;
    gap: var(--space-small);
  }
}

@media screen and (max-width: 479px) {
  :root {
    --size-h1: 3rem;
  }

  .navbar__container {
    min-height: 4rem;
  }
}
