/* Retaliation DayZ — landing page
   Design language: dark, muted, military-survival.
   No external dependencies. System font stack so it renders
   identically without web-font load delay. */

:root {
  --bg:        #0b0d0a;
  --bg-soft:   #14171211;
  --ink:       #e9e6dd;
  --ink-mute:  #8a8678;
  --gold:      #c2a878;
  --gold-soft: #c2a87820;
  --discord:   #5865f2;
  --discord-h: #4752c4;
  --max-w:     720px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  position: relative;
}

/* ── Rotating background ──────────────────────────────────
   Two fixed full-viewport layers, each cross-fading on a
   20s loop offset by 10s. Pure CSS — no JS, no flicker on
   first paint (images are preloaded via <link rel="preload">).
   Image 1: visible 0–8s, fading 8–10s → handing off to image 2.
   Image 2: fading in 8–10s (offset start), visible 10–18s,
   fading 18–20s → hands back to image 1. */
.bg-layer {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -2;
  opacity: 0;
  will-change: opacity;
  animation: bgFade 20s ease-in-out infinite;
  /* Slight zoom helps when an image is letterboxed on ultra-wide
     screens — keeps subject framed. Tweak if needed. */
}
.bg-layer-1 {
  background-image: url('/assets/dayzbackground.png');
  animation-delay: 0s;
}
.bg-layer-2 {
  background-image: url('/assets/dayzbackground1.png');
  animation-delay: 10s;
}
@keyframes bgFade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }   /* 2s fade-in */
  50%  { opacity: 1; }   /* 8s hold */
  60%  { opacity: 0; }   /* 2s fade-out */
  100% { opacity: 0; }
}

/* Dark gradient overlay for text contrast. Stronger toward the
   bottom where countdown / Discord button sit. Top kept lighter
   so the image's atmosphere reads through. */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.65) 50%,
    rgba(0, 0, 0, 0.82) 100%
  );
}

/* If user prefers reduced motion, freeze on image 1 (no cycling). */
@media (prefers-reduced-motion: reduce) {
  .bg-layer { animation: none; }
  .bg-layer-1 { opacity: 1; }
  .bg-layer-2 { opacity: 0; }
}

/* On narrow screens, framing matters more — keep the top of the
   image (typically the silhouette/horizon line) in view. */
@media (max-width: 640px) {
  .bg-layer {
    background-position: center 30%;
  }
}

.stage {
  position: relative;       /* sit above .bg-layer/.bg-overlay (z-index: -2/-1) */
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  /* Padding/gap kept loose on mobile, tighter on desktop so everything
     fits in viewport without scrolling on a typical 1080p / 720p screen. */
  padding: clamp(24px, 4vw, 36px) clamp(20px, 5vw, 40px);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.5vw, 24px);
}

/* ── Brand row ─────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand__mark svg { display: block; }
.brand__network {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.brand__title {
  margin: 2px 0 0;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand__title span { color: var(--gold); }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 14px);
}
.hero__kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero__headline {
  margin: 0;
  font-size: clamp(28px, 4.2vw, 36px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.hero__lead {
  margin: 0;
  font-size: clamp(14px, 1.6vw, 15px);
  line-height: 1.5;
  color: var(--ink-mute);
  max-width: 56ch;
}

/* ── Countdown ─────────────────────────────────────────── */
.countdown {
  padding: clamp(16px, 2.5vw, 20px) clamp(18px, 3vw, 24px);
  border: 1px solid #20231d;
  border-radius: 8px;
  background: linear-gradient(180deg, #11140fE6, #0c0e0aE6);
}
.countdown__label {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.countdown__grid {
  display: flex;
  align-items: flex-end;
  gap: clamp(6px, 1.5vw, 14px);
  flex-wrap: wrap;
}
.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}
.cd-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-size: clamp(26px, 4.5vw, 34px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.cd-lbl {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.cd-sep {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 300;
  color: var(--ink-mute);
  line-height: 1;
  padding-bottom: 14px;
}
.countdown__date {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-mute);
}

/* ── CTA ───────────────────────────────────────────────── */
.cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 6px;
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
  will-change: transform;
}
.btn:active { transform: translateY(1px); }
.btn--discord {
  background: var(--discord);
  color: #fff;
  box-shadow: 0 8px 24px -10px var(--discord);
}
.btn--discord:hover { background: var(--discord-h); }
.cta__hint {
  margin: 0;
  font-size: 13px;
  color: var(--ink-mute);
}

/* ── Footer ────────────────────────────────────────────── */
.foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #181b15;
  font-size: 12px;
  color: var(--ink-mute);
}
.foot a {
  color: var(--ink-mute);
  text-decoration: none;
  border-bottom: 1px dotted #2a2d24;
  transition: color .12s;
}
.foot a:hover { color: var(--gold); }
.foot .dot { opacity: .4; }

/* ── Reduce motion preference ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* ── Narrow mobile (≤375px): keep countdown on one row by
       shrinking separators and labels. */
@media (max-width: 380px) {
  .cd-unit { min-width: 48px; }
  .cd-sep { padding-bottom: 14px; }
  .cd-lbl { font-size: 9px; letter-spacing: 0.16em; }
}

/* ── Short desktop viewports (typical 1366×768 laptops, browser chrome
   leaves ~640-680px usable height). Tighten further so everything
   stays above the fold without scrolling. Mobile portrait is taller
   than 720px so this rule only fires on wide+short combinations. */
@media (min-width: 768px) and (max-height: 760px) {
  .stage {
    padding: 22px clamp(20px, 5vw, 40px);
    gap: 16px;
  }
  .hero { gap: 8px; }
  .hero__headline { font-size: 30px; }
  .hero__lead { font-size: 14px; }
  .countdown { padding: 14px 18px; }
  .countdown__label { margin-bottom: 8px; }
  .cd-num { font-size: 28px; }
  .countdown__date { margin-top: 8px; font-size: 11px; }
  .foot { padding-top: 10px; }
}
