/* -----------------------------------------------------------------------------
   VALEON — base
   Reset, page frame, navigation, footer, and shared components.
   Every element in this file is subject to §9: the UI is an instrument panel,
   not part of the spectacle.
   -------------------------------------------------------------------------- */

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--ink-hi);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: var(--track-tight);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  /* Subtle vertical gradient only — §2.1 */
  background:
    radial-gradient(ellipse at 50% -10%, rgba(153, 77, 255, 0.08), transparent 55%),
    radial-gradient(ellipse at 50% 110%, rgba(51, 230, 255, 0.06), transparent 55%),
    linear-gradient(180deg, var(--void) 0%, var(--void-lift) 100%);
  background-attachment: fixed;
}

a {
  color: var(--ink-hi);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease-out);
}
a:hover { color: var(--cryo); }

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--track-wide);
  margin: 0 0 var(--space-4);
}

h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.15rem; letter-spacing: var(--track-huge); text-transform: uppercase; color: var(--ink-mid); }
p  { margin: 0 0 var(--space-4); color: var(--ink-mid); }

/* ----- Page frame ------------------------------------------------------ */
/* z-index: 1 so flow content paints on top of the fixed field canvases
   below. Deliberately NOT creating a stacking-context-breaking isolation:
   the wordmark's SVG luminance filter + mix-blend-mode do not need to see
   through .page — they operate on the element itself. */
.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ----- Navigation ------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  background: linear-gradient(180deg, rgba(5, 8, 18, 0.78), rgba(5, 8, 18, 0.35));
  border-bottom: 1px solid var(--grid-line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--track-huge);
  font-size: 0.95rem;
  color: var(--ink-hi);
  height: 100%;
}
.nav-brand svg { width: 22px; height: 22px; }

/* Same three-layer black-key + optional WebGL upgrade as the hero (see
   landing.css and wordmark.js). Sized to nearly fill the nav row. */
.nav-brand-wordmark {
  display: block;
  height: 60px;
  width: auto;
  user-select: none;
  -webkit-user-drag: none;
  filter: url(#luminance-alpha)
          drop-shadow(0 0 12px rgba(51, 230, 255, 0.25))
          drop-shadow(0 0 32px rgba(153, 77, 255, 0.16));
  mix-blend-mode: screen;
  transition: transform var(--dur-2) var(--ease-out);
}
.nav-brand:hover .nav-brand-wordmark { transform: scale(1.03); }
/* When wordmark.js upgrades the img to a live canvas, the shader already
   outputs correct alpha — drop the CSS luminance filter and blend mode. */
canvas.nav-brand-wordmark {
  filter: drop-shadow(0 0 12px rgba(51, 230, 255, 0.25))
          drop-shadow(0 0 32px rgba(153, 77, 255, 0.16));
  mix-blend-mode: normal;
}

/* Narrow viewports: shrink so it doesn't crowd the nav links. */
@media (max-width: 720px) {
  .nav-brand-wordmark { height: 44px; }
}
@media (max-width: 480px) {
  .nav-brand-wordmark { height: 36px; }
}
.nav-links {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  list-style: none;
  padding: 0; margin: 0;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: var(--track-huge);
  text-transform: uppercase;
}
.nav-links a {
  color: var(--ink-mid);
  padding: var(--space-2) 0;
  border-bottom: 1px solid transparent;
}
.nav-links a[aria-current="page"] {
  color: var(--ink-hi);
  border-bottom-color: var(--cryo);
}
.nav-links a:hover { color: var(--ink-hi); }

@media (max-width: 640px) {
  .nav-links { gap: var(--space-4); font-size: 0.72rem; }
}

/* ----- Footer ---------------------------------------------------------- */
.footer {
  margin-top: auto;
  padding: var(--space-8) 0 var(--space-6);
  border-top: 1px solid var(--grid-line);
  color: var(--ink-lo);
  font-size: 0.86rem;
  letter-spacing: var(--track-tight);
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  justify-content: space-between;
  align-items: center;
}
.footer a { color: var(--ink-mid); }
.footer a:hover { color: var(--ink-hi); }

/* ----- Buttons — §9: only two things may use family colour ------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: var(--track-huge);
  text-transform: uppercase;
  color: var(--ink-hi);
  background: transparent;
  border: 1px solid var(--ink-dim);
  border-radius: var(--radius-2);
  cursor: pointer;
  transition:
    border-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out),
    background var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn:hover {
  color: var(--void);
  background: var(--ink-hi);
  border-color: var(--ink-hi);
  transform: translateY(-1px);
}
.btn-primary {
  border-color: var(--cryo);
  color: var(--cryo);
}
.btn-primary:hover {
  color: var(--void);
  background: var(--cryo);
  border-color: var(--cryo);
  box-shadow: 0 0 24px rgba(51, 230, 255, 0.45);
}
.btn-ghost { border-color: transparent; color: var(--ink-mid); }
.btn-ghost:hover { color: var(--ink-hi); background: rgba(255, 255, 255, 0.04); }

/* ----- Section frame — echoes the icon-overview panel corners ---------- */
.panel {
  position: relative;
  padding: var(--space-6);
  border: 1px solid var(--grid-line);
  background: rgba(14, 22, 38, 0.35);
  border-radius: var(--radius-3);
}
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--ink-mid);
  opacity: 0.6;
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ----- Eyebrow (tiny label, spaced) ------------------------------------ */
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: var(--track-huge);
  text-transform: uppercase;
  color: var(--ink-lo);
  margin-bottom: var(--space-3);
}

/* ----- Background canvas — under everything ---------------------------- */
/* z-index: 0 on a positioned element paints below any positive-z-index
   content but on top of unpositioned flow. Explicit width/height in addition
   to `inset: 0` is defensive: some browser/scroll combinations shrink
   position:fixed with only inset set. */
.field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ----- Global music player transport (player.js) ---------------------- */
/* One instance per page, docked to the LOWER-LEFT so it never covers the
   centred content. Can collapse to a small circular tray (.minimized). */
.player {
  position: fixed;
  left: var(--space-4);
  bottom: var(--space-4);
  transform: translateY(140%);
  z-index: 30;
  width: min(400px, calc(100% - 2 * var(--space-4)));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: rgba(5, 8, 18, 0.88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--grid-line-warm);
  border-radius: var(--radius-4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(51, 230, 255, 0.08);
  transition: transform var(--dur-3) var(--ease-out),
              width var(--dur-3) var(--ease-out),
              height var(--dur-3) var(--ease-out),
              border-radius var(--dur-3) var(--ease-out),
              padding var(--dur-3) var(--ease-out);
  pointer-events: none;
  overflow: hidden;
}
.player.visible {
  transform: translateY(0);
  pointer-events: auto;
}
.player .transport { display: flex; gap: var(--space-2); align-items: center; }
.player .transport button {
  width: 36px; height: 36px;
  border: 1px solid var(--grid-line-warm);
  background: transparent;
  color: var(--ink-hi);
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: color var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out);
}
.player .transport button:hover { color: var(--cryo); border-color: var(--cryo); }
.player .transport button.primary {
  width: 44px; height: 44px;
  border-color: var(--cryo);
  color: var(--cryo);
}
.player .now { min-width: 0; }
.player .now .t {
  font-family: var(--font-display);
  color: var(--ink-hi);
  letter-spacing: var(--track-wide);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}
.player .now .s {
  font-family: var(--font-mono);
  color: var(--ink-lo);
  font-size: 0.74rem;
}
.player .now .s .shuffled {
  color: var(--cryo);
  letter-spacing: var(--track-huge);
  text-transform: uppercase;
  font-size: 0.66rem;
  padding-left: 0.1rem;
}
.player .minimize {
  width: 28px; height: 28px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-lo);
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: color var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out);
}
.player .minimize:hover { color: var(--ink-hi); border-color: var(--grid-line-warm); }
.player .bar {
  grid-column: 1 / -1;
  height: 4px;
  background: var(--grid-line);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.player .bar .fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--cryo), var(--void-f));
  transition: width var(--dur-1) linear;
}

/* Expand button (the "tray" icon) is only visible when minimized. */
.player .expand {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--cryo);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.player .expand svg { width: 22px; height: 22px; }

/* ----- Minimized (tray) state ----------------------------------------- */
.player.minimized {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  grid-template-columns: 1fr;
  gap: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
              0 0 24px rgba(51, 230, 255, 0.35),
              0 0 0 1px rgba(51, 230, 255, 0.20);
}
.player.minimized .transport,
.player.minimized .now,
.player.minimized .minimize,
.player.minimized .bar { display: none; }
.player.minimized .expand { display: flex; }

/* Cyan pulse behind the tray while playing, so a glance tells you the
   soundtrack is on. */
.player.minimized.playing {
  animation: player-tray-pulse 2.4s var(--ease-out) infinite;
}
@keyframes player-tray-pulse {
  0%, 100% {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
                0 0 22px rgba(51, 230, 255, 0.30),
                0 0 0 1px rgba(51, 230, 255, 0.20);
  }
  50% {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
                0 0 36px rgba(51, 230, 255, 0.55),
                0 0 0 1px rgba(51, 230, 255, 0.45);
  }
}

/* ----- Card tilt (from PlayerAnalytics tilt.js) ----------------------- */
/* When tilt.js wraps a card in .tilt3d, the WRAPPER owns the motion —
   the inner card must stop reacting to :hover with its own transform or
   the two transforms fight. Border colour, shadow, glow etc. still fire.
   Match the reference site's `.tilt3d>.pa-svr-card:hover{transform:none}`
   rule but for Valeon's card classes. */
.tilt3d > .family-card:hover,
.tilt3d > .family-full:hover,
.tilt3d > .pitch-card:hover,
.tilt3d > .fact:hover,
.tilt3d > .shot:hover,
.tilt3d > .store:hover {
  transform: none;
}
/* Make the wrapper take the same grid/flex share the card originally had. */
.family-grid > .tilt3d,
.family-full-grid > .tilt3d,
.pitch-grid > .tilt3d,
.facts > .tilt3d,
.shots > .tilt3d { display: flex; flex-direction: column; }
/* Store button wrappers stay as inline-flex so the hero-stores row keeps
   its layout — .store itself is inline-flex already. */
.hero-stores > .tilt3d { display: inline-flex; }

/* Tilt hue defaults matched to Valeon's palette — cyan → ultraviolet. */
.tilt3d { --pa-c1: var(--cryo); --pa-c2: var(--void-f); }

/* ----- Utility --------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.hide-mobile { display: initial; }
@media (max-width: 640px) { .hide-mobile { display: none; } }
