/* Brawl Online landing page. No external requests: everything is served from this folder. */

@font-face {
  font-family: "Barlow Condensed";
  font-style: italic;
  font-weight: 900;
  font-display: block;
  src: url("assets/fonts/barlow-condensed-900-italic.woff2") format("woff2");
}

:root {
  --bg: #08080b;
  --fg: #f1f1f4;
  --dim: rgba(241, 241, 244, 0.42);
  --video-opacity: 0.16;

  /* Menu-button frame colours: a hand-made take on Project M's green menu buttons (see README.md). */
  --pm-rim: #03190a;        /* dark outer stroke */
  --pm-edge: #b9f59a;       /* light inner border */
  --pm-hi: #74de55;         /* face, top */
  --pm-mid: #2c9d34;        /* face, middle */
  --pm-lo: #0f5f20;         /* face, bottom */
  --pm-glow: rgba(116, 222, 85, 0.35);
  --pm-skew: -11deg;        /* the slant of the frame, in step with the italic lettering */

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background gameplay video: full-bleed, very dim. With no video file the page is plain dark. */
.bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: var(--video-opacity);
  pointer-events: none;
  z-index: 0;
}

/* Darkens the edges so the logo and button read over any footage. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 1;
}

/* The logo and the button sit together in the middle of the screen. */
main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vh, 52px);
  padding:
    max(32px, calc(env(safe-area-inset-top) + 24px))
    max(16px, env(safe-area-inset-right))
    max(72px, calc(env(safe-area-inset-bottom) + 56px))
    max(16px, env(safe-area-inset-left));
  text-align: center;
}

/* ---- Menu-button frame ------------------------------------------------------
   Drawn entirely in CSS, after the menu buttons of Brawl / Project M: a slanted,
   rounded plate with a dark rim, a thin light inner border, a green gradient face,
   a glossy upper half and a bevel (lighter top edge, darker bottom edge).
   Everything is in em, so the frame scales with the element's font-size. */
.plate {
  position: relative;
  isolation: isolate;
}

.plate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: skewX(var(--pm-skew));
  border: 0.16em solid var(--pm-rim);
  border-radius: 0.5em 0.22em 0.5em 0.22em;
  background:
    /* gloss: a soft light band over the top half */
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 46%, rgba(255, 255, 255, 0) 47%) padding-box,
    linear-gradient(180deg, var(--pm-hi) 0%, var(--pm-mid) 52%, var(--pm-lo) 100%) padding-box,
    var(--pm-rim);
  box-shadow:
    inset 0 0 0 0.06em var(--pm-edge),              /* light inner border */
    inset 0 0.14em 0.12em rgba(255, 255, 255, 0.28),/* bevel: lit top edge */
    inset 0 -0.22em 0.24em rgba(0, 20, 6, 0.45),    /* bevel: shaded bottom edge */
    0 0 0 0.04em rgba(150, 235, 130, 0.28),         /* hairline so the dark rim reads on a dark page */
    0 0.3em 1.2em rgba(0, 0, 0, 0.6);               /* drop shadow */
  transition: filter 0.15s, box-shadow 0.15s;
}

/* Logo */
.logo {
  margin: 0;
  max-width: 100%;
  font: inherit;
  line-height: 1;
}

.logo.plate {
  /* Size of the whole logo: the frame and the lettering follow it. */
  font-size: clamp(2rem, min(14vw, 12vh), 5.25rem);
  padding: 0.2em 0.62em 0.24em 0.56em;
}

.wordmark {
  display: block;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-synthesis: none;
  font-size: 1em;
  line-height: 0.86;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: left;
  color: #fff;
  /* Smash menu lettering: white with a heavy dark outline. */
  -webkit-text-stroke: 0.1em var(--pm-rim);
  paint-order: stroke fill;
  text-shadow: 0 0.05em 0 var(--pm-rim), 0 0.06em 0.18em rgba(0, 0, 0, 0.45);
}

/* "BRAWL" top left, "ONLINE" bottom right, offset. */
.wordmark .w1,
.wordmark .w2 {
  display: block;
}

.wordmark .w2 {
  padding-left: 1.55em;
}

.logo img {
  display: block;
  width: min(560px, 100%);
  height: auto;
  max-height: 30vh;
  object-fit: contain;
}

/* Download button and the other-OS list */
.get {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.dl.plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px; /* sizes the frame */
  width: 7em;
  height: 3em;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}

.dl svg {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 1px var(--pm-rim)) drop-shadow(0 2px 0 var(--pm-rim));
}

.dl:hover {
  transform: translateY(-1px);
}

.dl:hover::before,
.dl:focus-visible::before {
  filter: brightness(1.14) saturate(1.05);
  box-shadow:
    inset 0 0 0 0.06em #e2ffd0,
    inset 0 0.14em 0.12em rgba(255, 255, 255, 0.34),
    inset 0 -0.22em 0.24em rgba(0, 20, 6, 0.4),
    0 0 0 0.06em rgba(190, 255, 170, 0.55),
    0 0 1.1em var(--pm-glow),
    0 0.3em 1.2em rgba(0, 0, 0, 0.6);
}

.dl:active {
  transform: translateY(1px);
}

.dl:active::before {
  filter: brightness(0.95);
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.dl:focus-visible {
  outline-offset: 7px;
}

.more {
  font-size: 12px;
  color: var(--dim);
}

.more summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  user-select: none;
}

.more summary::-webkit-details-marker {
  display: none;
}

.more summary:hover,
.more[open] summary {
  color: var(--fg);
}

.more summary:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The list hangs below the toggle, so opening it does not move the logo or the button. */
.more ul {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.more ul a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.more ul a:hover {
  opacity: 1;
}

.more ul svg {
  height: 18px;
  width: auto;
}

@media (prefers-reduced-motion: reduce) {
  .dl,
  .plate::before {
    transition: none;
  }
  .dl:hover,
  .dl:active {
    transform: none;
  }
}
