/* MoneyVoice.com — single-page site
   Breakpoints: <640 mobile, 640–899 mid, ≥900 desktop */

/* ---------- Fonts (self-hosted, latin subsets) ---------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* The ↗ glyph sits outside the latin subset; this is a 736-byte one-glyph file. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-arrow.woff2') format('woff2');
  unicode-range: U+2197;
}
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/syne-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --navy: #0c1440;
  --slab-top: #182463;
  --slab-bottom: #101a49;
  --ink: #f1f0f7;
  --ink-muted: rgba(241, 240, 247, .62);
  --pink: #c533ca;
  --pink-light: #e06be4;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-display: 'Syne', 'Space Grotesk', system-ui, sans-serif;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--navy); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img, video { max-width: 100%; }
::selection { background: rgba(197, 51, 202, .5); color: #fff; }
:focus-visible { outline: 2px solid var(--pink-light); outline-offset: 3px; }
.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;
}

/* ---------- Page root ---------- */
.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy);
  color: var(--ink);
}

/* ---------- 0. Atmosphere layer ---------- */
.atmos {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.atmos-video {
  /* Desktop only (>=900px): on phones and tablets it is too small to read as anything, so it is
     hidden here and never loaded (see site.js). 110% wide, vertically centred on the hero
     (its height is 61.875vw vs the hero's 56.25vw), horizontally centred then shifted 15px right
     (the design's 10px leftward nudge, plus 125px, minus 100px). */
  display: none;
  position: absolute;
  top: -2.8125vw;
  left: calc(-5% + 15px);
  width: 110%;
  max-width: none;             /* the global img/video max-width:100% would otherwise cap this at 100% */
  height: auto;
  opacity: .3;
}
@media (min-width: 900px) {
  .atmos-video { display: block; }
}
.blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}
.blob-a {
  left: -20vw; top: -10vh; width: 70vw; height: 80vh;
  background: radial-gradient(closest-side, rgba(255, 140, 80, .66), rgba(255, 90, 140, .27) 55%, transparent);
  filter: blur(30px);
  animation: mvDriftA 17s ease-in-out infinite, mvBreathe 11s ease-in-out infinite;
}
.blob-b {
  right: -20vw; top: -5vh; width: 70vw; height: 90vh;
  background: radial-gradient(closest-side, rgba(110, 70, 255, .72), rgba(197, 51, 202, .3) 55%, transparent);
  filter: blur(30px);
  animation: mvDriftB 23s ease-in-out infinite, mvBreathe 13s ease-in-out infinite;
  animation-delay: -9s, -5s;
}
.blob-c {
  left: 25vw; bottom: -30vh; width: 60vw; height: 60vh;
  background: radial-gradient(closest-side, rgba(197, 51, 202, .48), transparent 70%);
  filter: blur(40px);
  animation: mvDriftC 29s ease-in-out infinite, mvBreathe 9s ease-in-out infinite;
  animation-delay: -14s, -3s;
}
.sheen {
  position: absolute;
  top: 0; bottom: 0; left: 0; width: 22vw;
  background: linear-gradient(90deg, transparent, rgba(241, 240, 247, .07), transparent);
  animation: mvSheen 19s linear infinite;
  animation-delay: -6s;
}
@keyframes mvDriftA{0%{transform:translate(0,0) scale(1)}25%{transform:translate(22vw,14vh) scale(1.2)}50%{transform:translate(30vw,-6vh) scale(.9)}75%{transform:translate(8vw,24vh) scale(1.1)}100%{transform:translate(0,0) scale(1)}}
@keyframes mvDriftB{0%{transform:translate(0,0) scale(1)}30%{transform:translate(-26vw,16vh) scale(1.25)}55%{transform:translate(-10vw,-12vh) scale(.85)}80%{transform:translate(-32vw,6vh) scale(1.05)}100%{transform:translate(0,0) scale(1)}}
@keyframes mvDriftC{0%{transform:translate(0,0) scale(1)}35%{transform:translate(18vw,-28vh) scale(1.3)}70%{transform:translate(-16vw,-14vh) scale(.9)}100%{transform:translate(0,0) scale(1)}}
@keyframes mvBreathe{0%,100%{opacity:.55}50%{opacity:1}}
@keyframes mvSheen{0%{transform:translateX(-120%) skewX(-18deg)}100%{transform:translateX(220%) skewX(-18deg)}}

/* ---------- 1. Hero video ---------- */
.hero {
  position: relative;
  z-index: 1;
  width: 100%;
}
.hero-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; /* reserves space before metadata arrives, so the copy below never jumps */
}

/* ---------- 2. Copy ---------- */
.copy {
  position: relative;
  z-index: 2;
  box-sizing: content-box;
  max-width: 500px;
  margin: -150px auto 0;
  padding: 0 24px;
  text-align: center;
  font: 400 13px/1.7 var(--font-mono);
  color: var(--ink-muted);
  text-wrap: pretty;
}
.copy p { margin: 0; }
.copy p + p { margin-top: 14px; }
.copy a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(197, 51, 202, .8);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color .2s, text-decoration-color .2s;
}
.copy a:hover { color: var(--pink-light); text-decoration-color: var(--pink-light); }

/* ---------- 3. Diagram (desktop grid; mobile overrides further down) ---------- */
.diagram {
  position: relative;
  z-index: 1;
  box-sizing: content-box;
  max-width: 1160px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}
.apps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin: 0;
  padding: 0;
  list-style: none;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tile: <a> for live apps, <button> for upcoming apps, <div> for "and more…" */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 20px 12px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 0 rgba(197, 51, 202, 0);
  transition: border-color .35s, background-color .35s, box-shadow .35s;
}
.app--live .tile {
  background: rgba(241, 240, 247, .06);
  border-color: rgba(197, 51, 202, .7);
}
.app--later .tile,
.app--more .tile {
  border-style: dashed;
  border-color: rgba(241, 240, 247, .25);
}
.app--more .tile { cursor: default; }

.stem {
  width: 2px;
  height: 44px;
  background: rgba(197, 51, 202, .35);
  transition: background-color .35s;
}

.logo {
  display: block;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .35s;
}
.app--later .logo { filter: grayscale(1) contrast(.9) opacity(.85); }
.logo--more {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(241, 240, 247, .35);
  font: 800 40px/1 var(--font-display);
  color: rgba(241, 240, 247, .5);
}

.text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}
.name {
  display: flex;               /* fixed two-line box so every tile in the row is the same height */
  align-items: center;
  justify-content: center;
  min-height: calc(2 * 1.2em);
  font: 600 17px/1.2 var(--font-sans);
  letter-spacing: -.01em;
  text-align: center;
  text-wrap: balance;
}
.status {
  display: block;
  min-height: 10px;
  font: 400 10px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(241, 240, 247, .5);
  transition: color .35s;
}
.app--live .status { color: var(--pink-light); }

.glyph {
  position: absolute;
  top: 8px;
  right: 10px;
  font: 500 13px/1 var(--font-mono);
  color: rgba(241, 240, 247, .55);
}
.app--live .glyph { color: var(--pink-light); }

/* Hover (pointer devices) and keyboard focus share the same "lit" state. No looping animation. */
@media (hover: hover) {
  .app:not(.app--more):hover .tile {
    border-color: var(--pink);
    background: rgba(197, 51, 202, .12);
    box-shadow: 0 0 40px 2px rgba(197, 51, 202, .45);
  }
  .app:not(.app--more):hover .stem { background: var(--pink); }
  .app:not(.app--more):hover .logo { transform: scale(1.14); filter: none; }
  .app:not(.app--more):hover .status { color: var(--pink-light); }
}
.app:has(.tile:focus-visible) .tile {
  border-color: var(--pink);
  background: rgba(197, 51, 202, .12);
  box-shadow: 0 0 40px 2px rgba(197, 51, 202, .45);
}
.app:has(.tile:focus-visible) .stem { background: var(--pink); }
.app:has(.tile:focus-visible) .logo { transform: scale(1.14); filter: none; }
.app:has(.tile:focus-visible) .status { color: var(--pink-light); }

/* Slab */
.platform {
  display: flex;
  justify-content: center;
  padding: 24px 28px;
  border: 1px solid rgba(197, 51, 202, .5);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom));
}
.platform-label {
  font: 700 22px/1 var(--font-sans);
  letter-spacing: -.01em;
}

/* ---------- 5. Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;               /* flex + auto margins keeps a tall card scrollable instead of clipped */
  overflow-y: auto;
  padding: 24px 32px;
  background: rgba(6, 10, 32, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: mvFadeIn .18s ease-out;
}
.modal-card {
  position: relative;
  width: min(480px, 100%);
  margin: auto;
  box-sizing: border-box;
  padding: 28px 28px 26px;
  border: 1px solid rgba(197, 51, 202, .5);
  border-radius: 18px;
  background: var(--slab-bottom);
  color: var(--ink);
  box-shadow: 0 0 60px rgba(197, 51, 202, .25);
  animation: mvRise .22s cubic-bezier(.2, .8, .2, 1);
}
.modal-card:focus { outline: none; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(241, 240, 247, .2);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: 400 18px/1 var(--font-mono);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color .2s, border-color .2s;
}
.modal-close:hover { background: rgba(241, 240, 247, .1); }
.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-right: 32px; /* keeps a wrapping title clear of the close button */
}
.modal-logo {
  display: block;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
}
.modal-title {
  margin: 0;
  font: 700 20px/1.2 var(--font-sans);
  letter-spacing: -.01em;
}
.modal-status {
  margin-top: 4px;
  font: 400 10px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pink-light);
}
.modal-body {
  margin: 0;
  font: 400 14px/1.65 var(--font-mono);
  color: rgba(241, 240, 247, .85);
  text-wrap: pretty;
}
@keyframes mvFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes mvRise { from { transform: translateY(8px) scale(.98) } to { transform: none } }

/* ---------- Breakpoints ---------- */

/* Tablet and up: copy width tracks the clear centre of the hero image */
@media (min-width: 640px) {
  .copy { max-width: min(500px, 40vw); }
}

/* Mid: 640–899 */
@media (min-width: 640px) and (max-width: 899.98px) {
  .copy { margin-top: -60px; }
}

/* Mobile: <640 — spine on the left, apps hang off it to the right */
@media (max-width: 639.98px) {
  .hero { padding-top: 72px; overflow: hidden; }
  .hero-video {                /* 110% wide, centred: crops 5% off each side so the shape reads larger */
    width: 110%;
    max-width: none;
    margin-left: -5%;
  }
  .copy { margin-top: 28px; }

  .diagram { padding: 48px 16px 64px; }
  .diagram-inner { display: flex; align-items: stretch; }

  .platform {
    order: -1;
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    padding: 0;
  }
  .platform-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 17px;
    white-space: nowrap;
  }

  .apps {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;      /* overrides the desktop grid's align-items: end */
    gap: 12px;
    min-width: 0;
    padding: 8px 0;
  }
  .app { flex-direction: row; align-items: center; }
  .stem {
    order: -1;
    flex: none;
    width: 16px;
    height: 2px;
    background: rgba(197, 51, 202, .5);
  }
  .tile {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px 12px 12px;
    border-radius: 14px;
    text-align: left;
  }
  .logo { width: 52px; height: 52px; border-radius: 14px; }
  .logo--more { font-size: 28px; }
  .text { display: block; flex: 1; }
  .name { display: block; min-height: 0; font-size: 16px; text-align: left; text-wrap: pretty; }
  .status { margin-top: 5px; min-height: 0; }
  .status:empty { display: none; }
  .glyph {
    position: static;
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 14px;
  }
}

/* ---------- Reduced motion: pause the blobs and sheen; the videos stay (they are the content) ---------- */
@media (prefers-reduced-motion: reduce) {
  .blob, .sheen { animation-play-state: paused; }
  .modal, .modal-card { animation: none; }
  .tile, .stem, .logo, .status, .copy a, .modal-close { transition: none; }
}
