/**
 * LandLords: Epos — Landing Page Layout
 * Layout-specific styles only. Components come from ui-kit.
 * Tokens come from design-tokens.css.
 */

/* === Reset (layer: reset — must lose to ui-kit components) === */
@layer reset {
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
}

/* === Layout (layer: layout — loses to ui-kit components) === */
@layer layout {
body {
  /* World-map backdrop: scrim on top of the art so hero/feature text keeps contrast. */
  background:
    linear-gradient(180deg, rgba(10,9,6,0.45) 0%, rgba(10,9,6,0.72) 45%, rgba(10,9,6,0.9) 100%),
    url('/assets/bg/world-map-1280.webp') center / cover no-repeat fixed,
    var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-18);
  line-height: var(--leading-normal);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Parchment texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139,69,19,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,215,0,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(205,133,63,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Game-icons SVG (gi-icons.ts via fillGi) — sizes to the surrounding font,
   adopts the theme colour. Mirrors the canonical rule in pages/ladder.css. */
.om-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
  fill: currentcolor;
}

/* === Skip Link (a11y) === */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 8px 16px;
  background: var(--color-primary);
  color: var(--color-accent);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: var(--text-14);
  z-index: var(--z-modal-overlay);
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* === Navigation (layout) === */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  background: rgba(26,26,26,0.95);
  backdrop-filter: blur(10px);
  border-bottom: var(--border-gold);
  padding: 0 var(--spacing-40);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-32);
}

.landing-nav__brand {
  font-family: var(--font-heading);
  font-size: var(--text-20);
  font-weight: var(--font-bold);
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
}

.landing-logo-img {
  height: 20px;
  width: auto;
  display: block;
}

.landing-nav__links {
  display: flex;
  gap: var(--spacing-32);
  list-style: none;
  margin-right: auto;
}

.landing-nav__links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: var(--text-14);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color var(--transition-normal);
}

.landing-nav__links a:hover { color: var(--color-accent); }

/* Nav login button — secondary: gold is reserved for the hero CTA. */
.landing-nav .btn {
  height: 32px;
  font-size: var(--text-11);
}

/* (Locale switcher overrides live in @layer components below —
   @layer layout loses to the ui-kit .seg component) */

/* === Hero Section (layout) === */
.landing-hero {
  position: relative;
  z-index: var(--z-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px var(--spacing-20) 80px;
}

/* Soft vignette behind the copy — the terraced relief is busy right behind the
   letters, so the text needs its own dark pocket. */
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 62% 58% at 50% 46%,
    rgba(10, 9, 6, 0.78) 0%,
    rgba(10, 9, 6, 0.45) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

.landing-hero > * {
  position: relative;
  z-index: 1;
}

.landing-hero__title {
  font-family: var(--font-brand);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: var(--font-bold);
  color: var(--color-text-light);
  letter-spacing: 6px;
  text-transform: uppercase;
  line-height: var(--leading-none);
  margin-bottom: var(--spacing-8);
}

.landing-hero__subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-16);
  font-size: 0.35em;
  color: var(--color-accent);
  letter-spacing: 12px;
  /* letter-spacing also trails the last glyph — re-centre the word optically */
  padding-left: 12px;
  margin-top: var(--spacing-12);
}

/* Heraldic whiskers: ── E P O S ── */
.landing-hero__subtitle::before,
.landing-hero__subtitle::after {
  content: '';
  width: clamp(40px, 8vw, 90px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0.5;
}

.landing-hero__desc {
  font-family: var(--font-body);
  font-size: clamp(19px, 2.2vw, 26px);
  color: var(--color-text);
  max-width: 640px;
  margin: var(--spacing-24) auto var(--spacing-40);
  line-height: var(--leading-relaxed);
  /* The relief behind the copy is busy — the shadow keeps the serifs crisp. */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Primary action — the CTA is the visual centre, not a card. */
.landing-hero__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-20);
}

/* Note + build stamp read as one compact block. */
.landing-hero__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-4);
}

.landing-hero__note {
  font-size: var(--text-14);
  color: rgba(138, 130, 117, 0.95);
  letter-spacing: 1px;
}

/* Build stamp — technical, quiet, under the CTA. */
.landing-hero__build {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  color: rgba(138, 130, 117, 0.8);
  letter-spacing: 1px;
}

/* === Features Section (layout) === */
.landing-features {
  position: relative;
  z-index: var(--z-base);
  padding: 80px var(--spacing-20);
  max-width: 1100px;
  margin: 0 auto;
}

.landing-features__title {
  font-family: var(--font-heading);
  font-size: var(--text-32);
  text-align: center;
  color: var(--color-accent);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: var(--spacing-16);
}

.landing-features__subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 60px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.landing-features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-32);
}

/* Feature cards — layout overrides for ui-kit .card */
.landing-features .card {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

/* Forged plate: quilted gambeson lattice + corner rivets + inner bronze line.
   Texture stays at ~5% so the copy keeps priority over the ornament. */
.landing-features .card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 215, 0, 0.05) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(255, 215, 0, 0.05) 0 1px, transparent 1px 14px);
}

.landing-features .card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 11px 11px, rgba(255, 215, 0, 0.5) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 11px) 11px, rgba(255, 215, 0, 0.5) 0 2px, transparent 2.5px),
    radial-gradient(circle at 11px calc(100% - 11px), rgba(255, 215, 0, 0.5) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 11px) calc(100% - 11px), rgba(255, 215, 0, 0.5) 0 2px, transparent 2.5px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 215, 0, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.landing-features .card > * {
  position: relative;
  z-index: 1;
}

.landing-features .card:hover {
  border-color: var(--color-gold-accent-line);
  box-shadow: 0 0 20px rgba(255,215,0,0.06);
}

/* Icon + title on one line — game-icons glyph sized by font-size. */
.landing-features__head {
  display: flex;
  align-items: center;
  gap: var(--spacing-12);
  margin-bottom: var(--spacing-12);
}

.landing-features__icon {
  font-size: var(--text-28);
  line-height: 1;
  color: var(--color-accent);
  flex-shrink: 0;
}

.landing-features .card h3 {
  font-family: var(--font-heading);
  font-size: var(--text-18);
  color: var(--color-accent);
  letter-spacing: 1px;
  margin-bottom: 0;
}

.landing-features .card p {
  color: var(--color-text-muted);
  font-size: var(--text-16);
  line-height: var(--leading-normal);
}

/* === Footer (layout) === */
.landing-footer {
  position: relative;
  z-index: var(--z-base);
  text-align: center;
  padding: var(--spacing-40) var(--spacing-20);
  border-top: var(--border-gold);
  color: var(--color-text-muted);
  font-size: var(--text-14);
}

.landing-footer__brand {
  font-family: var(--font-brand);
  color: var(--color-secondary);
  font-size: var(--text-16);
  letter-spacing: 2px;
  margin-bottom: var(--spacing-8);
}

.landing-footer__status {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-8);
  margin-top: var(--spacing-12);
  padding: var(--spacing-4) var(--spacing-16);
  background: var(--color-surface);
  border-radius: 20px;
  font-size: var(--text-13);
}

.landing-footer__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Responsive === */
@media (width <= 768px) {
  /* Mobile: smaller art, no fixed attachment (iOS Safari repaints it badly). */
  body {
    background:
      linear-gradient(180deg, rgba(10,9,6,0.45) 0%, rgba(10,9,6,0.72) 45%, rgba(10,9,6,0.9) 100%),
      url('/assets/bg/world-map-768.webp') center / cover no-repeat scroll,
      var(--color-bg);
  }

  .landing-nav { padding: 0 var(--spacing-20); }
  .landing-nav__links { display: none; }
  .landing-hero { padding: 100px var(--spacing-16) 60px; }
  .landing-features { padding: 60px var(--spacing-16); }
  .landing-features__grid { grid-template-columns: 1fr; }
}

@media (width <= 480px) {
  .landing-hero__title { letter-spacing: 3px; }
}
} /* end @layer layout */

/* === Component overrides (layer: components) ===
   design-tokens layer order: reset, tokens, layout, components, utilities.
   components beats layout — page overrides for ui-kit components (.btn/.panel)
   MUST live here, not in @layer layout. landing.css loads after ui-kit.css,
   so within the same layer it wins by source order + higher specificity. */
@layer components {
  /* Locale switcher — strict text control (RU | EN), not a mobile pill.
     Restyles the shared .seg kit control for the landing header only. */
  .header-locale .seg {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .header-locale .seg button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 var(--spacing-8);
    background: none;
    border: 0;
    border-radius: 0;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: var(--text-12);
    /* the kit's .is-on bumps weight to 600 — that shifts the active label
       off the baseline of its neighbour, so both stay 400 here */
    font-weight: var(--font-normal);
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--transition-normal);
  }

  .header-locale .seg button + button {
    border-left: 1px solid rgba(255, 215, 0, 0.1);
  }

  .header-locale .seg button:hover { color: var(--color-text-light); }
  .header-locale .seg button.is-on { color: var(--color-accent); }

  /* Hero CTA — the single gold action on the page, with a soft gold halo. */
  .landing-hero__cta {
    height: 60px;
    padding: 0 var(--spacing-40);
    font-size: var(--text-20);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    box-shadow:
      0 0 25px rgba(212, 160, 44, 0.35),
      0 4px 12px rgba(0, 0, 0, 0.6);
  }

  .landing-hero__cta:hover,
  .landing-hero__cta:focus-visible {
    box-shadow:
      0 0 34px rgba(212, 160, 44, 0.5),
      0 4px 12px rgba(0, 0, 0, 0.6);
  }
}