:root {
  --red: #EF3B33;
  /* logo red — used for accents */
  --red-deep: #C22420;
  --blue: #2E63EF;
  --navy-dark: #050D38;
  /* extrusion / shadows */
  --white: #FFFFFF;
  --off: #E7EEFF;
  --nav-h: 76px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Barlow', sans-serif;
  background: linear-gradient(115deg, #101E4A 0%, #0C1637 60%, #080F28 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================= NAVBAR (white, logo centered) ================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  box-shadow: 0 4px 24px rgba(4, 12, 60, .18);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo img {
  height: 62px;
  /* bigger logo — navbar height unchanged (76px) */
  width: auto;
  display: block;
}

.logo-fallback {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  line-height: .9;
  color: var(--red);
  text-transform: uppercase;
  transform: skewX(-4deg);
  text-shadow: 1.5px 1.5px 0 var(--navy-dark);
  display: none;
  /* only shows if the logo image fails to load */
}

/* ================= HERO (full page) ================= */
.hero {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 40px) 48px 60px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 8px;
  /* small gap so text sits close to the image */
  overflow: hidden;
}

.bg-word {
  position: absolute;
  left: 2%;
  bottom: 4%;
  /* fully inside the hero — no letters cut off */
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(160px, 26vw, 340px);
  line-height: .8;
  color: rgba(255, 255, 255, .06);
  letter-spacing: -.02em;
  user-select: none;
  pointer-events: none;
}

.stripe {
  position: absolute;
  top: -15%;
  right: 10%;
  width: 28%;
  height: 140%;
  background: linear-gradient(180deg, #EF3B33, #C22420);
  /* red stripe on dark bg */
  transform: skewX(-16deg);
  opacity: .95;
}

.stripe-word {
  position: absolute;
  top: 0;
  right: 3%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* keeps LINE centered so no letter gets cut */
  writing-mode: vertical-rl;
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(64px, 9.5vw, 120px);
  color: rgba(255, 255, 255, .09);
  letter-spacing: .08em;
  user-select: none;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 5;
  justify-self: end;
  /* slides the text block toward the image */
  max-width: 560px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--off);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--off);
}

h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(38px, 4.8vw, 62px);
  line-height: .98;
  text-transform: uppercase;
  color: var(--white);
  transform: skewX(-4deg);
  text-shadow: 2px 2px 0 var(--navy-dark), 4px 4px 0 var(--navy-dark),
    6px 6px 0 var(--navy-dark), 8px 8px 0 rgba(8, 18, 80, .85);
  margin-bottom: 20px;
  animation: rise .7s ease both;
}

/* highlighted last line of the headline — red like the stripe */
h1 .hl {
  color: var(--red);
  text-shadow: 2px 2px 0 var(--white), 4px 4px 0 rgba(8, 18, 80, .85);
}

.sub {
  font-size: 17px;
  font-weight: 500;
  color: rgba(233, 238, 255, .8);
  max-width: 46ch;
  line-height: 1.55;
  margin-bottom: 34px;
  animation: riseFlat .7s .12s ease both;
}

/* ---------- BEEHIIV SUBSCRIBE FORM ---------- */
.beehiiv-wrap {
  /* A definite width, NOT fit-content: shrink-wrapping the wrapper squeezes the
     Beehiiv form and wraps its button onto two lines. */
  width: 100%;
  max-width: 480px;
  animation: riseFlat .7s .22s ease both;
  /* stand-in and real form share one cell, so the box never jumps or empties */
  display: grid;
  position: relative;
}

/* Once Beehiiv has built a real form, fade the stand-in out and take it out of
   the layout so the wrapper sizes to Beehiiv alone and nothing peeks out from
   underneath. Driven purely by :has() — no script, no timers, so it can only
   ever trigger when a real input genuinely exists. */
.beehiiv-wrap:has(>*:not(.fake-form) input) .fake-form {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  inset: 0;
}

/* The shadow lives on the form itself so it hugs whichever one is showing.
   Scoped to containers that actually hold a form — otherwise the empty
   container Beehiiv inserts paints a stray shadow box with nothing in it. */
.fake-form,
.beehiiv-wrap iframe,
.beehiiv-wrap>*:has(input) {
  /* soft shadow + a hint of the hard offset used across the design */
  box-shadow: 0 14px 34px rgba(4, 12, 60, .45), 6px 6px 0 rgba(5, 13, 56, .55);
}

.beehiiv-wrap>* {
  grid-area: 1 / 1;
}

.beehiiv-wrap iframe,
.beehiiv-wrap>div {
  border-radius: 10px;
  overflow: hidden;
  display: block;
  width: 100%;
}

/* Beehiiv renders ON TOP of the stand-in, in the same grid cell */
.beehiiv-wrap>*:not(.fake-form) {
  position: relative;
  z-index: 2;
}

/* Once Beehiiv has actually built a form, give it an opaque background so it
   hides the stand-in underneath. :has(input) is the key — an empty container
   Beehiiv inserts before rendering gets no background, so the stand-in stays
   visible through it instead of being covered by a blank white box. */
.beehiiv-wrap>*:has(input) {
  background: var(--white);
  border-radius: 8px;
}

/* ---------- STAND-IN FORM (holds the space while Beehiiv loads) ---------- */
.fake-form {
  position: relative;
  z-index: 1;
  /* fades out once Beehiiv's real form exists — see the :has() rule above */
  transition: opacity .22s ease, visibility 0s linear .22s;
  display: flex;
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--red);
  border-radius: 8px;
  overflow: hidden;
  /* sized by its contents — the wrapper keeps its own full width for Beehiiv */
  width: fit-content;
  max-width: 100%;
  height: fit-content;
}

.fake-form input {
  min-width: 0;
  border: none;
  outline: none;
  background: var(--white);
  font-family: 'PT Serif', serif;
  font-size: 16px;
  font-weight: 400;
  color: #101A3A;
  padding: 11px 16px;
  /* a little extra room than the input's default intrinsic width */
  min-width: 250px;
}

.fake-form input::placeholder {
  color: #A8AEBD;
  opacity: 1;
}

.fake-form button {
  flex: none;
  border: none;
  cursor: default;
  background: var(--red);
  color: var(--white);
  font-family: 'PT Serif', serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  padding: 11px 20px;
  white-space: nowrap;
}



.btn {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  border: none;
  cursor: pointer;
  padding: 16px 34px;
  border-radius: 6px;
  box-shadow: 5px 5px 0 var(--navy-dark);
  transform: skewX(-4deg);
  transition: transform .16s ease, box-shadow .16s ease;
  text-decoration: none;
  display: inline-block;
}

.btn span {
  display: inline-block;
  transform: skewX(4deg);
}

.btn:hover {
  transform: skewX(-4deg) translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--navy-dark);
}

.btn:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

.free-note {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
  font-style: italic;
  color: var(--off);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: riseFlat .7s .3s ease both;
}

.free-note::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  flex: none;
}

/* ---------- HERO IMAGE (right side) ---------- */
.visual {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  /* image hugs the text side */
  height: 100%;
  min-height: 420px;
  justify-self: start;
}

.photo-frame {
  position: relative;
  width: min(440px, 100%);
  height: min(560px, 78vh);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#heroPhoto {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(18px 22px 0 rgba(8, 18, 80, .75));
  animation: riseFlat .6s ease both;
}

/* ---------- STATS STRIP ---------- */
.stats {
  position: absolute;
  bottom: 30px;
  right: 48px;
  z-index: 6;
  display: flex;
  gap: 36px;
}

.stat {
  text-align: right;
}

.stat .n {
  font-family: 'Archivo Black', sans-serif;
  font-size: 24px;
  color: var(--white);
  text-shadow: 2px 2px 0 var(--navy-dark);
  transform: skewX(-4deg);
  display: block;
}

.stat .l {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(233, 238, 255, .65);
}

/* ================= FOOTER (red) ================= */
footer {
  position: relative;
  z-index: 5;
  background: linear-gradient(115deg, #EF3B33 0%, #C22420 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 48px;
  flex-wrap: wrap;
}

.footer-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.footer-logo img {
  height: 30px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  /* shows the logo in white on the red bar */
}

.footer-logo .logo-fallback {
  font-size: 15px;
  color: var(--white);
  text-shadow: none;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.footer-links a {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 236, 234, .9);
  text-decoration: none;
  transition: color .18s ease;
}

.footer-links a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-links a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-socials a {
  color: rgba(255, 236, 234, .9);
  display: flex;
  transition: color .18s ease, transform .18s ease;
}

.footer-socials a:hover {
  color: var(--white);
  transform: translateY(-2px);
}

.footer-socials a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 4px;
}

.footer-socials svg {
  width: 18px;
  height: 18px;
}

.copyright {
  font-size: 12px;
  color: rgba(255, 236, 234, .75);
}

/* ---------- ANIMATIONS ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: skewX(-4deg) translateY(24px);
  }

  to {
    opacity: 1;
    transform: skewX(-4deg) translateY(0);
  }
}

@keyframes riseFlat {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ================= RESPONSIVE ================= */
@media (max-width: 920px) {
  header {
    padding: 0 16px;
  }

  .logo img {
    height: 52px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: calc(var(--nav-h) + 34px) 22px 150px;
    gap: 26px;
  }

  /* --- text first, left-aligned & compact --- */
  .hero-copy {
    justify-self: stretch;
    max-width: none;
    text-align: left;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: .28em;
  }

  h1 {
    font-size: clamp(28px, 8vw, 40px);
    line-height: 1.04;
  }

  .sub {
    font-size: 15px;
    line-height: 1.6;
    max-width: 46ch;
    margin-bottom: 26px;
  }

  .beehiiv-wrap {
    margin: 0;
  }

  /* On mobile the Beehiiv form goes full width and its button wraps onto two
     lines, so the stand-in matches that shape rather than the desktop one. */
  .fake-form {
    width: 100%;
  }

  .fake-form input {
    flex: 1;
    min-width: 0;
    padding: 8px 14px;
  }

  /* wide enough for "Join the huddle" to stay on one line, and short */
  .fake-form button {
    text-align: center;
    line-height: 1;
    padding: 8px 18px;
  }

  .free-note {
    justify-content: flex-start;
    font-size: 13px;
  }

  /* --- image below the text, centered --- */
  .visual {
    order: 0;
    /* image comes AFTER the text on mobile */
    min-height: 0;
    justify-content: center;
    justify-self: stretch;
  }

  .photo-frame {
    width: min(300px, 80%);
    height: min(340px, 46vh);
  }

  #heroPhoto {
    filter: drop-shadow(10px 12px 0 rgba(8, 18, 80, .6));
    /* lighter shadow, cleaner */
  }

  /* --- stats centered at the bottom --- */
  .stats {
    left: 0;
    right: 0;
    bottom: 26px;
    justify-content: center;
    gap: 30px;
  }

  .stat {
    text-align: center;
  }

  .stat .n {
    font-size: 18px;
  }

  .stat .l {
    font-size: 10px;
  }

  /* quieter decorations for a clean look */
  .bg-word {
    font-size: clamp(110px, 34vw, 180px);
    left: 0;
    right: 0;
    text-align: center;
    bottom: 2%;
  }

  .stripe {
    right: -30%;
    opacity: .5;
  }

  .stripe-word {
    display: none;
  }

  footer {
    flex-direction: column;
    padding: 22px;
    text-align: center;
    gap: 14px;
  }
}