/* ==========================================================================
   STATE WARS — menu.css
   The title lockup and the three main menu buttons.
   ========================================================================== */

/* ---------- 1. Screen layout for the menu ------------------------------- */

.screen--menu {
  flex-direction: column;
  justify-content: center;
  gap: clamp(2rem, 6vh, 4.5rem);
  padding-block: clamp(4rem, 12vh, 8rem);
}


/* ---------- 2. Title lockup --------------------------------------------- */

.brand {
  text-align: center;
  transform: translate3d(calc(var(--px) * -10px), calc(var(--py) * -7px), 0);
  transition: transform 700ms var(--ease-soft);
}

.reduce-motion .brand { transform: none; transition: none; }

/* 2a. Eyebrow */
.brand__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9em;
  margin-bottom: clamp(.7rem, 1.6vh, 1.15rem);
  font-family: var(--font-mono);
  font-size: clamp(.6rem, 1.35vw, .78rem);
  letter-spacing: .52em;
  text-indent: .52em;
  text-transform: uppercase;
  color: var(--c-ice);
  opacity: .78;
  animation: fade-down 900ms var(--ease-out) both;
}

.brand__eyebrow .tick {
  width: clamp(1.5rem, 5vw, 3.25rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127,216,255,.7));
}
.brand__eyebrow .tick:last-child {
  background: linear-gradient(90deg, rgba(127,216,255,.7), transparent);
}

/* 2b. STATE WARS */
.brand__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: clamp(.45rem, 1.8vw, 1.5rem);

  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: condensed;
  font-size: clamp(3.8rem, 13vw, 10rem);
  line-height: .88;
  letter-spacing: clamp(.01em, .35vw, .05em);
  text-transform: uppercase;
}

.brand__word {
  display: inline-block;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-size: 220% 100%;
  animation: sheen-slide 9s ease-in-out infinite;
}

/* "STATE" — brushed steel */
.brand__word--state {
  background-image: linear-gradient(174deg,
    #ffffff 0%, #dbe9ff 26%, #8ba9cf 46%, #ffffff 54%,
    #9fb9d9 70%, #e6f0ff 100%);
  filter:
    drop-shadow(0 2px 0 rgba(4,7,14,.65))
    drop-shadow(0 0 calc(26px * var(--fx)) rgba(127,216,255,.34));
}

/* "WARS" — hot gold */
.brand__word--wars {
  background-image: linear-gradient(174deg,
    #fff3d6 0%, #ffd27a 24%, #d98d17 46%, #fff6e0 54%,
    #e8a52c 72%, #ffe6b0 100%);
  filter:
    drop-shadow(0 2px 0 rgba(4,7,14,.65))
    drop-shadow(0 0 calc(30px * var(--fx)) rgba(255,150,40,.42));
  animation-delay: .9s;
}

@keyframes sheen-slide {
  0%, 100% { background-position: 0%   50%; }
  50%      { background-position: 100% 50%; }
}

.reduce-motion .brand__word { animation: none; }

/* 2c. Divider rule under the title */
.brand__rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: min(30rem, 76vw);
  margin: clamp(1rem, 2.4vh, 1.6rem) auto clamp(.75rem, 1.6vh, 1.1rem);
  animation: fade-up 900ms 180ms var(--ease-out) both;
}

.brand__rule i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,194,92,.55), transparent);
}

.brand__rule b {
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--c-gold);
  transform: rotate(45deg);
  box-shadow: 0 0 calc(14px * var(--fx)) rgba(255,194,92,.85);
}

/* 2d. Tagline */
.brand__tagline {
  font-size: clamp(.82rem, 1.9vw, 1.05rem);
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: var(--c-dim);
  animation: fade-up 900ms 280ms var(--ease-out) both;
}


/* ---------- 3. Menu column ---------------------------------------------- */

.menu {
  display: flex;
  flex-direction: column;
  gap: clamp(.7rem, 1.6vh, 1.05rem);
  width: min(30rem, 88vw);
  margin-inline: auto;
  transform: translate3d(calc(var(--px) * 6px), calc(var(--py) * 4px), 0);
  transition: transform 700ms var(--ease-soft);
}

.reduce-motion .menu { transform: none; transition: none; }

.menu .btn:nth-child(1) { animation: rise 620ms 380ms var(--ease-out) both; }
.menu .btn:nth-child(2) { animation: rise 620ms 470ms var(--ease-out) both; }
.menu .btn:nth-child(3) { animation: rise 620ms 560ms var(--ease-out) both; }


/* ---------- 4. Buttons --------------------------------------------------
   Structure:
     .btn > .btn__edge   left accent bar
          > .btn__sheen  hover light sweep + click flash
          > .btn__text   label + sublabel
          > .btn__chev   arrow
   ------------------------------------------------------------------------ */

.btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: clamp(3.9rem, 8.2vh, 4.9rem);
  padding: .9rem clamp(1.1rem, 3vw, 1.7rem) .9rem clamp(1.4rem, 3.4vw, 2rem);

  overflow: hidden;
  border: 1px solid rgba(127,216,255,.22);
  border-radius: 4px;
  background:
    linear-gradient(100deg, rgba(15,30,53,.92) 0%, rgba(11,21,38,.78) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 10px 26px -14px rgba(0,0,0,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  text-align: left;
  transition:
    transform    var(--t-mid) var(--ease-out),
    border-color var(--t-mid) var(--ease-out),
    box-shadow   var(--t-mid) var(--ease-out),
    background   var(--t-mid) var(--ease-out);
  will-change: transform;
}

/* Clipped corner, top-right — reads as a HUD plate */
.btn {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

/* 4a. Left accent bar */
.btn__edge {
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 34%;
  background: var(--c-ice);
  box-shadow: 0 0 calc(12px * var(--fx)) rgba(127,216,255,.7);
  transform: translateY(-50%) scaleY(1);
  transform-origin: center;
  opacity: .55;
  transition: height var(--t-mid) var(--ease-out),
              opacity var(--t-mid) var(--ease-out);
}

.btn--primary .btn__edge {
  background: var(--c-gold);
  box-shadow: 0 0 calc(14px * var(--fx)) rgba(255,194,92,.8);
  opacity: .8;
}

/* 4b. Sheen — a soft light that sweeps left to right on hover */
.btn__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg,
    transparent 30%, rgba(180,225,255,.16) 48%, transparent 66%);
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 760ms var(--ease-out), opacity 220ms linear;
}

/* 4c. Text block */
.btn__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .18em;
  min-width: 0;
}

.btn__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: semi-condensed;
  font-size: clamp(1.3rem, 3.4vw, 1.85rem);
  line-height: 1;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--c-text);
  transition: color var(--t-mid) var(--ease-out),
              text-shadow var(--t-mid) var(--ease-out);
}

.btn__sub {
  font-family: var(--font-mono);
  font-size: clamp(.56rem, 1.3vw, .68rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-muted);
  transition: color var(--t-mid) var(--ease-out);
}

/* 4d. Chevron */
.btn__chev {
  flex: none;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--c-ice-soft);
  border-right: 2px solid var(--c-ice-soft);
  transform: rotate(45deg) translate(0, 0);
  opacity: .6;
  transition: transform var(--t-mid) var(--ease-out),
              opacity var(--t-mid) var(--ease-out),
              border-color var(--t-mid) var(--ease-out);
}


/* ---------- 5. Hover / focus states ------------------------------------- */

@media (hover: hover) {
  .btn:hover { transform: translateY(-2px) scale(1.022); }
}

.btn:hover,
.btn.is-focus {
  border-color: rgba(127,216,255,.5);
  background: linear-gradient(100deg, rgba(22,42,72,.95) 0%, rgba(14,27,48,.86) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.09),
    0 0 0 1px rgba(127,216,255,.1),
    0 calc(18px * var(--fx)) calc(40px * var(--fx)) -18px rgba(127,216,255,.6),
    0 14px 30px -16px rgba(0,0,0,.95);
}

.btn.is-focus { transform: translateY(-2px) scale(1.022); }

.btn:hover .btn__edge,
.btn.is-focus .btn__edge { height: 74%; opacity: 1; }

.btn:hover .btn__sheen,
.btn.is-focus .btn__sheen { transform: translateX(120%); opacity: 1; }

.btn:hover .btn__label,
.btn.is-focus .btn__label {
  color: #fff;
  text-shadow: 0 0 calc(20px * var(--fx)) rgba(127,216,255,.6);
}

.btn:hover .btn__sub,
.btn.is-focus .btn__sub { color: var(--c-dim); }

.btn:hover .btn__chev,
.btn.is-focus .btn__chev {
  transform: rotate(45deg) translate(3px, -3px);
  opacity: 1;
  border-color: var(--c-ice);
}

/* Primary button leans gold on hover */
.btn--primary:hover,
.btn--primary.is-focus {
  border-color: rgba(255,194,92,.55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    0 calc(18px * var(--fx)) calc(44px * var(--fx)) -18px rgba(255,168,50,.65),
    0 14px 30px -16px rgba(0,0,0,.95);
}
.btn--primary:hover .btn__label,
.btn--primary.is-focus .btn__label {
  text-shadow: 0 0 calc(22px * var(--fx)) rgba(255,194,92,.65);
}
.btn--primary:hover .btn__chev,
.btn--primary.is-focus .btn__chev { border-color: var(--c-gold); }


/* ---------- 6. Press animation ------------------------------------------
   JS adds `.is-pressed` on pointerdown and `.is-firing` on activation.      */

.btn.is-pressed {
  transform: translateY(0) scale(.975);
  transition-duration: 90ms;
}

.btn.is-firing { animation: btn-fire 340ms var(--ease-out); }

@keyframes btn-fire {
  0%   { transform: translateY(0) scale(.975); }
  38%  { transform: translateY(-3px) scale(1.035); }
  100% { transform: translateY(-2px) scale(1.022); }
}

/* Flash that races across the plate when the button is activated */
.btn.is-firing .btn__sheen {
  animation: btn-flash 420ms var(--ease-out);
}

@keyframes btn-flash {
  0%   { transform: translateX(-120%); opacity: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%); }
  10%  { opacity: 1; }
  100% { transform: translateX(120%);  opacity: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%); }
}

/* Expanding ring, drawn on a pseudo element so it never affects layout */
.btn.is-firing::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.75);
  animation: btn-ring 460ms var(--ease-out) forwards;
  pointer-events: none;
}

@keyframes btn-ring {
  0%   { opacity: .85; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.035); }
}

.reduce-motion .btn.is-firing,
.reduce-motion .btn.is-firing::after,
.reduce-motion .btn.is-firing .btn__sheen { animation-duration: 140ms; }


/* ---------- 7. Entrance keyframes --------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: .78; transform: translateY(0); }
}


/* ---------- 8. Small screens -------------------------------------------- */

@media (max-width: 420px) {
  .btn { padding-inline: 1.05rem 1rem; gap: .6rem; }
  .btn__sub { letter-spacing: .14em; }
}

/* Short landscape windows: tighten the vertical rhythm */
@media (max-height: 560px) {
  .screen--menu { gap: 1.5rem; padding-block: 2.5rem; }
  .brand__title { font-size: clamp(2.6rem, 9vw, 5rem); }
  .brand__rule  { margin-block: .6rem .4rem; }
  .btn { min-height: 3.4rem; }
  .btn__sub { display: none; }
}
