/* ─── Layout ─────────────────────────────────────────────────────────────────── */

.landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
}

/* ─── Stage (zoom canvas) ─────────────────────────────────────────────────────── */

/* A square board layer that scales/pans as one unit. Lamps are pinned to it by
   percentage so they travel with the board through every zoom. */
.landing__stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 100vh);
  height: max(100vw, 100vh);
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  z-index: 0;
}

.landing__map {
  position: absolute;
  inset: 0;
  background-image: url("/assets/brass-board-landing.jpg");
  background-size: cover;
  background-position: center;
}

/* Per-target zoom states. Transform math (origin = stage centre, board fraction p):
   translate(D%) = -Z * (p - 0.5) * 100, applied before scale so percentages stay
   independent of the live stage size. Z = 1.9 throughout. */
.landing__stage[data-zoom="splash"] {
  transform: translate(-50%, -50%) scale(1);
}

/* New Game / Join Game → top of board, centred horizontally (target 50%, 26%). */
.landing__stage[data-zoom="top"] {
  transform: translate(-50%, -50%) translate(0%, 45.6%) scale(1.9);
}

/* Settings → lower-left, keeps lamp B in view (target 28%, 82%). */
.landing__stage[data-zoom="lower-left"] {
  transform: translate(-50%, -50%) translate(41.8%, -60.8%) scale(1.9);
}

/* Rules → lower-right. Symmetric counterpart of the lower-left zoom so the
   viewport actually frames the board's bottom-right corner; the now-translucent
   cheat-section boxes let lamp C glow through. */
.landing__stage[data-zoom="lower-right"] {
  transform: translate(-50%, -50%) translate(-41.8%, -60.8%) scale(1.9);
}

/* Profile → top-right corner of the board. */
.landing__stage[data-zoom="top-right"] {
  transform: translate(-50%, -50%) translate(-41.8%, 60.8%) scale(1.9);
}

/* Friends → mid-left edge of the board (sub-panel of Profile). */
.landing__stage[data-zoom="mid-left"] {
  transform: translate(-50%, -50%) translate(41.8%, 0%) scale(1.9);
}

/* Games → mid-right edge of the board (sub-panel of Profile). */
.landing__stage[data-zoom="mid-right"] {
  transform: translate(-50%, -50%) translate(-41.8%, 0%) scale(1.9);
}

/* ─── Glowing lamps ──────────────────────────────────────────────────────────── */

/* Lamp selectors + @keyframes live in the shared brass-lamps.css module so the
   landing page and the in-game board surfaces paint identical lamps from one
   source. Loaded via <link> in index.html before this file. */

/* ─── Dark overlay (always covers the viewport, independent of zoom) ──────────── */

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(160deg, rgba(20, 12, 4, 0.72) 0%, rgba(30, 18, 6, 0.62) 50%, rgba(18, 28, 8, 0.68) 100%);
  pointer-events: none;
}

/* ─── Center overlay (splash + panel share one centred cell) ─────────────────── */

/* A viewport-filling grid whose single cell is centred on both axes. The splash
   menu and the function panel are both placed in that cell so they overlap and
   stay centred; one slides out as the other slides in. */
.landing__overlay {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-areas: "stack";
  place-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 1.5rem;
  box-sizing: border-box;
  pointer-events: none;
}

.landing__overlay > * {
  grid-area: stack;
}

/* ─── Splash content ─────────────────────────────────────────────────────────── */

.landing__content {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  max-width: 780px;
  width: 100%;
  pointer-events: auto;
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.5s ease;
}

/* When a function panel is open, the splash slides up-and-left and fades out. */
.landing.is-panel-open .landing__content {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-7%, -10%);
}

/* ─── Wordmark ───────────────────────────────────────────────────────────────── */

.landing__title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass-gold-soft); /* oxidised gold */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.8),
    0 0 18px rgba(184, 134, 30, 0.55),
    2px 2px 4px rgba(0, 0, 0, 0.6);
  margin: 0 0 0.5rem;
  line-height: 1.1;
}

/* ─── Greeting ───────────────────────────────────────────────────────────────── */

.landing__greeting {
  font-size: 1.05rem;
  color: var(--brass-gold-light);
  margin: 0 0 1.8rem;
  letter-spacing: 0.02em;
}

/* ─── Button grid ────────────────────────────────────────────────────────────── */

.landing__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

@media (max-width: 540px) {
  .landing__buttons {
    grid-template-columns: 1fr;
  }
}

/* ─── Entry buttons ──────────────────────────────────────────────────────────── */

.landing-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 0.85rem 1.2rem;
  border: 1.5px solid rgba(184, 134, 30, 0.55);
  border-radius: 6px;
  background: rgba(42, 24, 8, 0.72);
  color: var(--brass-gold-bright);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.12s;
  gap: 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.landing-btn:hover,
.landing-btn:focus-visible {
  background: rgba(80, 48, 12, 0.88);
  border-color: rgba(220, 170, 50, 0.85);
  outline: none;
  transform: translateY(-2px);
}

.landing-btn:active {
  transform: translateY(0);
}

/* Sign-in CTA variant — subdued style to signal action required */
.landing-btn--signin {
  border-color: rgba(130, 96, 22, 0.5);
  background: rgba(28, 18, 6, 0.68);
  color: var(--brass-gold-mid);
}

.landing-btn--signin:hover,
.landing-btn--signin:focus-visible {
  border-color: rgba(180, 130, 36, 0.8);
  background: rgba(56, 36, 8, 0.82);
}

.landing-btn__label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.landing-btn__desc {
  font-size: 0.78rem;
  color: var(--brass-gold-darker);
  letter-spacing: 0.02em;
  font-style: italic;
}

.landing-btn--signin .landing-btn__desc {
  color: var(--brass-gold-earth);
}
