/* Page-specific: not part of the shared stylesheet - everything below is
   scoped to body[data-page="home"] so it can't leak into other pages. */

html, body { overflow-x: hidden; }

/* No-scroll fit-to-viewport, home page only. Scoped via :has() so every
   other route keeps normal scrolling behavior. */
html:has(body[data-page="home"]) {
  height: 100%;
  overflow: hidden;
}
body[data-page="home"] {
  height: 100vh;
  overflow: hidden;
}

body[data-page="home"] .page {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 64px;
  padding-bottom: 64px;
}

/* Desktop layout lives further down, near the two-column hero rules,
   so all desktop-only overrides for .page are in one place. */

/* Mobile-first: single stacked column, same as before. At wider viewports
   this becomes a real two-column hero (copy | media) instead of one
   centered strip of content floating in the middle of the screen. */
.home-title {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 8px;
}
.home-title-icon { display: none; width: 92px; height: 92px; }
.home-title-icon svg { display: block; width: 100%; height: 100%; }

.home-hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 8px;
}

.home-label {
  font-family: var(--mono);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 14px;
}

.home-h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 2.6rem;
  letter-spacing: -.01em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 18px;
}
.home-h1 span { color: var(--accent); }

.home-hook {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 22px;
}
.home-hook p + p { margin-top: 10px; }
.home-hook strong { color: var(--text); font-weight: 600; }
.home-hook .hi { color: var(--accent); font-weight: 600; }

.home-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 20px;
}
.home-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.home-tag svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--accent);
}

.home-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 260px;
  margin: 0 auto 26px;
}
.home-divider::before, .home-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.home-divider-icon {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: 3px;
  color: var(--muted2);
}

.home-group-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 22px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin: 0 auto 24px;
}
/* Wider box once the buttons sit side by side (see .home-btn-row below) -
   340px is kept as the single-column mobile width, this only kicks in once
   there's room for two columns. */
@media (min-width: 641px) {
  .home-group-box { max-width: 440px; }
}
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--r);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .86rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
.home-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Discord is the primary CTA now: full-width, taller, with a live member
   count beneath the label. Steam drops to a smaller secondary text-link
   underneath rather than competing side by side. */
.home-btn-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.home-btn-discord {
  background: #5865F2;
  color: #fff;
  border-color: rgba(88,101,242,.5);
  padding: 20px 24px;
  font-size: 1.02rem;
  flex-direction: column;
  gap: 4px;
}
.home-btn-discord:hover { background: #4752c4; border-color: #7289da; transform: translateY(-1px); }
.home-btn-discord-top { display: inline-flex; align-items: center; gap: 10px; }
.home-btn-discord svg { width: 22px; height: 22px; }
.home-btn-discord-count {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 400;
  color: rgba(255,255,255,.8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-btn-discord-count .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #6fcf97;
  box-shadow: 0 0 0 3px rgba(111,207,151,.2);
  flex-shrink: 0;
}
.home-btn-discord-count { position: relative; }
/* Loading state: keep the (screen-reader-visible) text so the chip keeps its
   final size and nothing jumps, but paint a shimmer bar over it. */
.home-btn-discord-count.is-loading { color: transparent; }
.home-btn-discord-count.is-loading .dot { visibility: hidden; }
.home-btn-discord-count.is-loading::before {
  content: '';
  position: absolute;
  inset: 1px 0;
  border-radius: 999px;
  background-color: rgba(255,255,255,.14);
  background-image: linear-gradient(100deg,
    transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.6s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .home-btn-discord-count.is-loading::before { animation: none; background-image: none; }
}

.home-btn-steam-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.home-btn-steam-secondary svg { width: 15px; height: 15px; flex-shrink: 0; }
.home-btn-steam-secondary:hover { color: #6ea8cf; border-color: rgba(20,75,126,.6); background: rgba(20,75,126,.18); }


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

/* Honeypot field - invisible to real users, only bots fill it in. */
.hp-field { opacity: 0; position: absolute; top: 0; left: 0; height: 0; width: 0; z-index: -1; overflow: hidden; }

.hero-carousel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  aspect-ratio: 16 / 7.2;
  border-radius: 0;
  overflow: hidden;
  margin: 4px auto 26px;
  background-color: var(--bg);
  /* Skeleton: shimmer until the first image has loaded (.is-loaded is added
     by home.js). The images fade in over it. */
  background-image: var(--skel-gradient);
  background-size: 200% 100%;
  animation: skel-shimmer 1.6s linear infinite;
  border: 1px solid var(--border);
}
.hero-carousel.is-loaded { background-image: none; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-carousel { background-image: none; animation: none; }
}
.hero-carousel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: 0;
  filter: contrast(1.12) saturate(1.08) brightness(.96);
  transition: opacity 1.2s ease;
}
.hero-carousel-img.active { opacity: 1; }
.hero-carousel-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 26%, rgba(0,0,0,0) 58%, rgba(0,0,0,.7) 100%),
    linear-gradient(90deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 75%, rgba(0,0,0,.5) 100%),
    radial-gradient(110% 85% at 50% 45%, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%);
}

@media (max-width: 640px) {
  /* Bigger, edge-to-edge hero on phones. Breaks out of .page's side
     padding (12px, see .page mobile rule in styles.css) using negative
     margins equal to that padding so the image runs full width instead
     of sitting in a narrow centered column. Taller aspect ratio (4/3
     instead of 16/9) gives it more visual weight on a vertical screen. */
  .home-media { width: 100vw; margin-left: calc(50% - 50vw); }
  .hero-carousel {
    aspect-ratio: 16 / 11;
    margin-bottom: 20px;
    border-left: none;
    border-right: none;
  }
  .home-h1 { font-size: 1.9rem; }
  body[data-page="home"] .page { padding-top: 40px; padding-bottom: 40px; }
  .home-btn-row { flex-direction: column; }

  /* Tiny partyhat watermark, bottom-right corner of the hero - same idea
     as the desktop version further down, just smaller since phones are
     smaller. .hero-carousel is position:relative up in the base rules,
     so this just needs position/size/placement to stop it rendering at
     full natural image size (the only rule it had before was scoped to
     the desktop media query). */
  .hero-watermark {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 20px;
    height: auto;
    z-index: 2;
    opacity: .85;
    pointer-events: none;
    user-select: none;
  }

  /* The desktop "no-scroll, fits in one screen" treatment (100vh + hidden
     overflow, set further up) doesn't hold up on phones - stacking the
     nav, hero copy, carousel, and CTA box is reliably taller than one
     small screen. With overflow hidden, anything past 100vh (often the
     bottom of the footer) was getting silently clipped and unreachable
     instead of just requiring a scroll. Below this breakpoint, fall back
     to normal document flow/scrolling like every other page on the site. */
  html:has(body[data-page="home"]) { height: auto; overflow: visible; }
  body[data-page="home"] {
    height: auto;
    overflow: visible;
    /* Also drop the site-wide "min-height: 100vh" (set in the shared
       stylesheet, meant to pin the footer to the bottom of short pages).
       On mobile the hero content is usually shorter than a full screen,
       so that min-height was stretching .page (flex: 1 1 auto below) to
       fill the remaining space, shoving the footer down and leaving a
       big blank gap above it. Sizing to actual content puts the footer
       right after the content instead. */
    min-height: 0;
  }
}

/* The graffiti decal is only ever positioned/sized by JS + the desktop
   media query below (position:fixed, viewport-anchored placement). Below
   900px that JS placement is skipped (see isDesktopLayout() check in the
   placement script), so without this rule the <img> falls back to being a
   plain in-flow element at its natural full-resolution size inside
   .home-media - blowing out the whole hero on phones. Hide it outright on
   mobile; the desktop block re-shows it. */
.graff-decal { display: none; }

/* Desktop hero: stacked layout — paragraph, then image, then CTA box,
   each full-width and centered. Simpler single-column flow replaces the
   old two-column split, so .page can go back to the shared 1060px width
   used on every other route (no more navbar/content width mismatch). */
@media (min-width: 900px) {
  body[data-page="home"] .page {
    max-width: 1060px;
    justify-content: flex-start;
    padding-top: 24px;
    padding-bottom: 16px;
    padding-right: 24px;
    padding-left: 24px;
    gap: 10px;
    min-height: 0;
  }
  .home-title { flex-direction: row; align-items: center; justify-content: center; text-align: left; max-width: 1150px; margin: 0 auto 6px; gap: 10px; flex-shrink: 0; }
  .home-title-icon { display: block; flex-shrink: 0; width: 72px; height: 72px; }
  .home-h1 { font-size: 3rem; margin-bottom: 0; }
  .home-hero-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
  }
  .home-label { margin-bottom: 10px; font-size: .82rem; }
  .home-hook { max-width: 900px; margin-top: 0; margin-bottom: 0; font-size: 1.08rem; line-height: 1.5; flex-shrink: 0; }
  .home-hook--intro { max-width: 980px; font-size: 1.05rem; }
  .home-tags { justify-content: center; margin-bottom: 0; }
  .home-divider { margin-bottom: 0; }
  .home-media {
    width: 100%;
    padding-bottom: 0;
    margin-bottom: 0;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
  }
  .graff-decal {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform;
    transform: translate3d(-9999px, -9999px, 0); /* hidden until JS places it */
  }
  .graff-decal--ants-back {
    width: 150px;
    z-index: 0;
    opacity: 1;
    filter: brightness(1.5) contrast(1.15);
  }
  .graff-decal--ants-front {
    width: 130px;
    z-index: 0;
    opacity: 1;
    filter: brightness(1.5) contrast(1.15);
  }
  .graff-decal--fu { width: 240px; z-index: 4; }
  .hero-watermark {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 28px;
    height: auto;
    z-index: 2;
    opacity: .85;
    pointer-events: none;
    user-select: none;
  }
  .hero-carousel {
    max-width: none;
    width: 100%;
    height: auto;
    aspect-ratio: 2.35 / 1;
    margin: 0;
  }
  .home-group-box {
    max-width: 580px;
    margin-bottom: 0;
    padding: 10px 18px;
    flex-shrink: 0;
  }
  .home-btn-row {
    flex-direction: row;
    align-items: stretch;
  }
  .home-btn-discord {
    flex: 2 1 0%;
    padding: 9px 18px;
    font-size: .86rem;
  }
  .home-btn-discord svg { width: 17px; height: 17px; }
  .home-btn-discord-count { font-size: .66rem; }
  .home-btn-steam-secondary {
    flex: 1 1 0%;
    font-size: .76rem;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--r);
  }
}

