/* ============================================================
   VIBEDECK // web
   Brutalist + cyberpunk. Mirrors the app's DesignSystem.
   ============================================================ */

/* --- Brand fonts (self-hosted, match the iOS app exactly) --- */
@font-face {
  font-family: "ClashDisplay";
  src: url("fonts/ClashDisplay-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "ClashDisplay";
  src: url("fonts/ClashDisplay-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrainsMono";
  src: url("fonts/JetBrainsMono-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrainsMono";
  src: url("fonts/JetBrainsMono-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

/* --- Palette (from DesignSystem.swift) --- */
:root {
  --void-black: #050505;
  --electric-lime: #ccff00;
  --hyper-violet: #7f00ff;
  --bittersweet: #ff453a;
  --off-white: #f2f2f7;
  --smoke: rgba(242, 242, 247, 0.55);
  --hairline: rgba(242, 242, 247, 0.12);
  --surface: #101012;

  --display: "ClashDisplay", "Arial Black", sans-serif;
  --mono: "JetBrainsMono", "SFMono-Regular", ui-monospace, "Menlo", monospace;

  --gutter: clamp(20px, 5vw, 48px);
  --maxw: 980px;

  /* ClashDisplay-Bold ships tight default spacing. BRAND.md compensates with a
     literal double-space between words; word-spacing does the same job without
     mangling the copy for screen readers, search, or copy-paste. */
  --display-word-space: 0.22em;

  /* Chromatic split — the logo's lime/violet misregistration (GlitchBootLogoView) */
  --split: 3px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void-black);
  color: var(--off-white);
  font-family: var(--mono);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient mesh glow behind everything (echoes AmbientMeshBackground) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(127, 0, 255, 0.16), transparent 60%),
    radial-gradient(55% 45% at 85% 8%, rgba(204, 255, 0, 0.1), transparent 55%),
    radial-gradient(70% 60% at 50% 110%, rgba(127, 0, 255, 0.12), transparent 60%);
  pointer-events: none;
}

a {
  color: var(--electric-lime);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Type helpers --- */
.mono-label {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--smoke);
}

.terminal {
  color: var(--electric-lime);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.98;
  word-spacing: var(--display-word-space);
  margin: 0;
}

/* Headings set in the mono utility face keep normal spacing — the monospace
   already enforces uniform glyph width, and double-spacing it reads as a typo. */
.step .body h3,
.legal h2 {
  word-spacing: normal;
}

/* --- Focus ---------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--electric-lime);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px var(--gutter);
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
/* Shared wordmark — used in the top bar and the footer. */
.mark {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--off-white);
  isolation: isolate;
}
.mark:hover {
  text-decoration: none;
}
/* The app's mark is white; its character comes from the lime/violet channel
   split, not from a colored word. Keeping lime out of the logo also keeps it
   meaning exactly one thing on this site: the action color. */
.mark::before,
.mark::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.mark::before {
  color: var(--hyper-violet);
  transform: translateX(-0.5px);
}
.mark::after {
  color: var(--electric-lime);
  transform: translateX(0.5px);
}
.topbar nav {
  display: flex;
  align-items: center;
}
/* The app holds a 44pt floor on tap targets (LandingView's settings button is
   explicitly sized for it). The nav links now clear the same bar. */
.topbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  margin-left: 4px;
  color: var(--smoke);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.topbar nav a:hover {
  color: var(--electric-lime);
  text-decoration: none;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  text-align: center;
  padding: clamp(56px, 12vh, 120px) var(--gutter) clamp(40px, 8vh, 80px);
}

/* Living equalizer — mirrors VibeEqualizerGraphic: 32 bars grown from a
   centerline (not bottom-anchored), a center-weighted envelope, and a soft
   implied kick around 90 BPM. Bar heights/phases ride in on --h / --d. */
/* The app layers these in a ZStack — spectrum behind, wordmark in front, the
   logo carrying a heavy shadow so it lifts off the bars. Same arrangement. */
.hero-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}
.eq {
  position: absolute;
  inset: 0 0;
  width: min(560px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  z-index: 0;
  /* No centering transform here — `kick` owns transform on this element. */
  animation: kick 2.667s linear infinite, eq-glitch 9s steps(1, end) infinite;
}
.eq span {
  flex: 1 1 0;
  min-width: 0;
  max-width: 9px;
  height: calc(var(--h, 0.5) * 100%);
  border-radius: 1px;
  background: var(--electric-lime);
  opacity: 0.62;
  transform-origin: center;
  animation: sway 2.6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

/* Bars breathe around the midline rather than pumping off the floor. */
@keyframes sway {
  0%,
  100% {
    transform: scaleY(0.6);
  }
  50% {
    transform: scaleY(1);
  }
}

/* Implied kick: four beats, the downbeat landing hardest. */
@keyframes kick {
  0%   { transform: scaleY(1.05); }
  22%  { transform: scaleY(1); }
  25%  { transform: scaleY(1.03); }
  47%  { transform: scaleY(1); }
  50%  { transform: scaleY(1.03); }
  72%  { transform: scaleY(1); }
  75%  { transform: scaleY(1.03); }
  100% { transform: scaleY(1); }
}

/* The rare shared hiccup — chromatic ghosts fire only here, in sync with the
   wordmark, then everything settles crisp again. */
@keyframes eq-glitch {
  0%, 94% {
    filter: none;
  }
  95% {
    filter: drop-shadow(-9px -2px var(--hyper-violet))
      drop-shadow(9px 2px var(--electric-lime));
  }
  97% {
    filter: drop-shadow(6px 2px var(--hyper-violet))
      drop-shadow(-6px -2px var(--electric-lime));
  }
  99%, 100% {
    filter: none;
  }
}

/* Wordmark — the app stacks VIBE / DECK in white at tight tracking and gets its
   identity from the lime/violet channel split (GlitchBootLogoView), not from a
   colored word. Matched here. */
.hero .logo {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Lifts the mark off the spectrum behind it (LandingView's logo shadow).
     Kept tight — a broad dark cloud desaturates the lime bars to olive. */
  text-shadow: 0 10px 20px rgba(5, 5, 5, 0.95), 0 0 10px rgba(5, 5, 5, 0.85);
  font-size: clamp(3.4rem, 15vw, 7.5rem);
  letter-spacing: -0.024em;
  line-height: 0.82;
  word-spacing: normal;
  color: var(--off-white);
}
.hero .logo .line {
  position: relative;
  display: block;
  isolation: isolate;
}
.hero .logo .line::before,
.hero .logo .line::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero .logo .line::before {
  color: var(--hyper-violet);
  opacity: 0;
  animation: chroma-violet 9s steps(1, end) infinite;
}
.hero .logo .line::after {
  color: var(--electric-lime);
  opacity: 0;
  animation: chroma-lime 9s steps(1, end) infinite;
}

/* At rest the ghosts sit just off-register; on the shared 9s hiccup they tear
   apart for two frames and snap back. */
@keyframes chroma-violet {
  0%, 94%   { transform: translate(0, 0); opacity: 0; }
  95%       { transform: translate(calc(var(--split) * -3.6), -3px); opacity: 1; }
  97%       { transform: translate(calc(var(--split) * 2.4), 2px); opacity: 1; }
  99%, 100% { transform: translate(0, 0); opacity: 0; }
}
@keyframes chroma-lime {
  0%, 94%   { transform: translate(0, 0); opacity: 0; }
  95%       { transform: translate(calc(var(--split) * 3.6), 3px); opacity: 1; }
  97%       { transform: translate(calc(var(--split) * -2.4), -2px); opacity: 1; }
  99%, 100% { transform: translate(0, 0); opacity: 0; }
}
.hero .tagline {
  margin-top: 20px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(0.8rem, 2.4vw, 1rem);
  letter-spacing: 0.28em;
  color: var(--smoke);
  text-transform: uppercase;
}
.hero .sub {
  max-width: 560px;
  margin: 26px auto 0;
  color: var(--smoke);
  font-size: 0.98rem;
}

/* Primary action — the app's signature filled-lime button (LandingView's
   JOIN PARTY: 60pt tall, voidBlack label, 16pt radius, breathing glow). The
   outlined treatment is the app's *secondary* button, so the site shouldn't
   lead with it. */
.actions {
  margin-top: 38px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 34px;
  border-radius: 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  word-spacing: var(--display-word-space);
  text-transform: uppercase;
}
.btn-primary {
  background: var(--electric-lime);
  color: var(--void-black);
  box-shadow: 0 0 8px rgba(204, 255, 0, 0.15);
  animation: breathe 2s ease-in-out infinite alternate;
}
.btn-primary:hover {
  text-decoration: none;
  box-shadow: 0 0 22px rgba(204, 255, 0, 0.45);
}
@keyframes breathe {
  from {
    box-shadow: 0 0 8px rgba(204, 255, 0, 0.15);
  }
  to {
    box-shadow: 0 0 16px rgba(204, 255, 0, 0.4);
  }
}

/* Launch status — system framing, per BRAND.md's pre-launch pattern. */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 26px 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--electric-lime);
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--electric-lime);
  box-shadow: 0 0 12px var(--electric-lime);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.status-sub {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--smoke);
}

/* ============================================================
   SECTIONS
   ============================================================ */
section {
  padding: clamp(48px, 10vh, 96px) 0;
  border-top: 1px solid var(--hairline);
}
.section-head {
  margin-bottom: 40px;
}
.section-head .mono-label {
  display: block;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 6vw, 3rem);
}
.section-head p {
  margin-top: 14px;
  max-width: 560px;
  color: var(--smoke);
}

/* How it works — terminal steps */
.steps {
  display: grid;
  gap: 14px;
  counter-reset: step;
}
.step {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--electric-lime);
  border-radius: 10px;
}
.step .num {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--electric-lime);
  font-size: 0.85rem;
  white-space: nowrap;
}
.step .body h3 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--electric-lime);
  text-transform: uppercase;
}
.step .body p {
  margin: 8px 0 0;
  color: var(--smoke);
  font-size: 0.92rem;
}

/* Feature cards */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.card.violet {
  border-color: rgba(127, 0, 255, 0.4);
}
.card h3 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}
.card.violet h3 {
  color: var(--hyper-violet);
}
.card.lime h3 {
  color: var(--electric-lime);
}
.card p {
  margin: 0;
  color: var(--smoke);
  font-size: 0.92rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--hairline);
  padding: 40px var(--gutter);
  text-align: center;
}
footer .links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
footer .links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--smoke);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
footer .links a:hover {
  color: var(--electric-lime);
  text-decoration: none;
}
footer .copy {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--smoke);
}

/* ============================================================
   LEGAL (privacy) — brutalist chrome, readable body
   ============================================================ */
/* Long-form prose stays in the mono utility face, so the measure has to carry
   the readability: ~68 characters, not the ~85 that 760px produced. */
.legal {
  max-width: 68ch;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 80px) var(--gutter) 80px;
}
.legal .mono-label {
  display: block;
  margin-bottom: 14px;
}
.legal h1 {
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  margin-bottom: 10px;
}
.legal .updated {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--smoke);
  text-transform: uppercase;
}
.legal h2 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--electric-lime);
  text-transform: uppercase;
  margin: 44px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.legal h2 .idx {
  color: var(--smoke);
  margin-right: 10px;
}
.legal p,
.legal li {
  color: rgba(242, 242, 247, 0.82);
  font-size: 0.98rem;
  line-height: 1.75;
}
.legal ul {
  padding-left: 20px;
}
.legal li {
  margin-bottom: 8px;
}
.legal strong {
  color: var(--off-white);
}
.legal .note {
  margin-top: 40px;
  padding: 18px 20px;
  background: rgba(127, 0, 255, 0.08);
  border: 1px solid rgba(127, 0, 255, 0.35);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--smoke);
}
.legal .back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 40px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ============================================================
   NARROW VIEWPORTS
   ============================================================ */
/* This is an iPhone app's landing page — the phone layout is the main one.
   The nav has to stay on one row at 375px without shrinking tap targets. */
@media (max-width: 600px) {
  .topbar .mark {
    font-size: 0.95rem;
  }
  .hero .logo {
    letter-spacing: -0.018em;
  }
  .topbar nav a {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    padding: 0 6px;
    margin-left: 2px;
  }
  footer .links a {
    padding: 0 10px;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .eq,
  .eq span,
  .status .dot,
  .btn-primary,
  .hero .logo .line::before,
  .hero .logo .line::after {
    animation: none;
  }
  /* Resting state is crisp, so the ghosts simply stay hidden. */
  .hero .logo .line::before,
  .hero .logo .line::after {
    opacity: 0;
  }
  html {
    scroll-behavior: auto;
  }
}
