/* ============================================================
   Rhapsody — main.css
   Design: Clyde-inspired dark aurora aesthetic
   Fonts: Bricolage Grotesque (display) · Instrument Sans (body) · JetBrains Mono
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  --paper:    #0A0612;
  --paper-2:  #140C26;
  --card:     #160E2A;

  --ink:      #F4EFFB;
  --ink-2:    #B9AED2;
  --ink-3:    #857A9E;

  --line:     rgba(255,255,255,.10);
  --line-2:   rgba(255,255,255,.06);

  --violet:       #8B3FF0;
  --violet-ink:   #C9A3FF;
  --violet-2:     #B26BFF;
  --violet-soft:  rgba(178,107,255,.12);
  --violet-soft-2:rgba(178,107,255,.30);

  /* section accent tints */
  --mint:   rgba(20,150,110,.16);
  --peach:  rgba(200,120,40,.16);
  --sky:    rgba(90,120,235,.18);
  --lilac:  rgba(139,63,240,.22);
  --butter: rgba(200,165,70,.14);

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body:    'Instrument Sans',    system-ui, sans-serif;
  --mono:    'JetBrains Mono',     monospace;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  background: var(--paper);
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--violet-soft-2); color: var(--violet-ink); }

/* ---- Aurora background ---- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora b {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: .5;
}
.aurora .am1 {
  width: 640px; height: 640px;
  background: radial-gradient(circle, #E255B0, transparent 66%);
  left: -8%; top: 3%;
  animation: adrift 26s ease-in-out infinite;
}
.aurora .am2 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, #F59E3C, transparent 64%);
  right: -6%; top: 18%;
  animation: adrift 31s ease-in-out infinite reverse;
}
.aurora .am3 {
  width: 720px; height: 720px;
  background: radial-gradient(circle, #8B3FF0, transparent 67%);
  left: 26%; top: 58%;
  animation: adrift 35s ease-in-out infinite;
}
.aurora .am4 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #C24BD6, transparent 66%);
  right: 14%; top: 122%;
  animation: adrift 29s ease-in-out infinite reverse;
}
@keyframes adrift { 50% { transform: translate(48px, 38px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .aurora b { animation: none; } }

/* Content layers: above aurora (0) and canvas (1), nav always on top */
header, section, main, footer { position: relative; z-index: 2; }
nav { position: relative; z-index: 100; }

/* ---- Scroll reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .9s cubic-bezier(.16,1,.3,1);
}
[data-reveal].in { opacity: 1; transform: none; }

/* Line-by-line reveal wrapper */
.rl { display: block; overflow: hidden; padding-bottom: .05em; }
.rl > span[data-reveal] { transform: translateY(116%); }

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 22px 40px;
  transform: translateY(0);
  transition:
    transform .55s cubic-bezier(.16,1,.3,1),
    background .4s,
    backdrop-filter .4s,
    padding .4s,
    box-shadow .4s;
}
.nav.scrolled {
  background: rgba(10,6,18,.7);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line);
  padding: 14px 40px;
}
.nav.hide { transform: translateY(-118%); }

/* Centered wordmark */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
}
.mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--violet);
  display: grid;
  place-items: center;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.brand:hover .mark { transform: rotate(-8deg) scale(1.06); }
.nav .brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 600;
  font-size: 18px;
}
.nav .btn-g { margin-left: auto; }

/* Nav links */
.nav-links { flex: 0; display: flex; gap: 6px; }
.nav-links a {
  position: relative;
  font-size: 14.5px;
  color: var(--ink-2);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 10px;
  overflow: hidden;
  white-space: nowrap;
  height: 36px;
  display: inline-flex;
  align-items: center;
  transition: color .25s, background .25s;
}
.nav-links a .lbl {
  position: relative;
  display: block;
  white-space: nowrap;
  transition: transform .42s cubic-bezier(.16,1,.3,1);
}
.nav-links a .lbl::after {
  content: attr(data-t);
  position: absolute;
  left: 0; top: 100%;
  padding-top: 6px;
}
.nav-links a:hover { color: var(--ink); background: var(--violet-soft); }
.nav-links a:hover .lbl { transform: translateY(calc(-100% - 6px)); }

/* Scroll-progress hairline */
.navprog {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  background: var(--violet);
  opacity: 0;
  transition: opacity .4s;
}
.nav.scrolled .navprog { opacity: 1; }

/* ---- Buttons ---- */
.btn {
  font-family: var(--body);
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .18s, background .2s, box-shadow .25s, border-color .2s;
  border-radius: 40px;
}
.btn:hover { transform: translateY(-1px); }

.btn-p {
  background: var(--violet);
  color: #fff;
  padding: 11px 20px;
  font-size: 14.5px;
  box-shadow: 0 8px 22px -8px rgba(109,40,217,.5);
}
.btn-p:hover { background: var(--violet-ink); }

.btn-g {
  color: var(--ink-2);
  font-size: 14.5px;
  padding: 11px 12px;
}
.btn-g:hover { color: var(--ink); }

.btn-lg { padding: 16px 30px; font-size: 16px; }

.btn-out {
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
}
.btn-out:hover { background: var(--ink); color: var(--paper); }

/* ---- Shared section utilities ---- */
section { position: relative; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }

.idx {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--violet);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.idx::before { content: ""; width: 34px; height: 1.5px; background: var(--violet); }

h2.big {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(33px, 5vw, 62px);
  letter-spacing: -.005em;
  line-height: 1.06;
  margin: 0;
}

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 60ch;
  margin: 24px 0 0;
}

/* ---- Placeholder cards (for content we don't have yet) ---- */
.ph {
  position: relative;
  border-radius: 24px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--ink-3);
}
.ph.tint-lilac { background: var(--lilac); }
.ph.tint-mint  { background: var(--mint);  }
.ph.tint-peach { background: var(--peach); }
.ph.tint-sky   { background: var(--sky);   }
.ph.tint-butter{ background: var(--butter);}

/* Diagonal hatch texture */
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,.03) 0 2px,
    transparent 2px 16px
  );
  pointer-events: none;
}
.ph .pic {
  width: 54px; height: 54px;
  border-radius: 15px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--violet-2);
  box-shadow: 0 8px 18px -10px rgba(0,0,0,.6);
}
.ph .pt { font-family: var(--body); font-weight: 600; font-size: 15px; color: var(--ink); }
.ph .ps { font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em; max-width: 30ch; line-height: 1.5; }
.ph .tag {
  position: absolute;
  top: 14px; left: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
}

/* ---- Hero ---- */
.hero { padding: 170px 0 80px; }
.hero .wrap { position: relative; }

/* Dark veil behind the headline text — sits above canvas, below text content */
.hero .wrap::before {
  content: "";
  position: absolute;
  top: 0; left: -60px; right: -60px;
  height: 420px;
  background: linear-gradient(
    to bottom,
    rgba(10,6,18,.58) 0%,
    rgba(10,6,18,.35) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;  /* behind text, above canvas (canvas is outside this stacking ctx) */
}
/* Readability shadows when cube face fills the background */
.hero h1 {
  text-shadow: 0 0 80px rgba(10,6,18,.85), 0 4px 32px rgba(10,6,18,.8);
}
.hero .hero-sub {
  text-shadow: 0 2px 20px rgba(10,6,18,.75);
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--violet-ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 8px 16px;
  margin-bottom: 30px;
}
.hero .eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--violet);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 118px);
  line-height: 1.0;
  letter-spacing: -.01em;
  margin: 0;
}
.hero h1 .it {
  font-style: italic;
  font-weight: 600;
  color: var(--violet);
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-top: 34px;
  flex-wrap: wrap;
}
.hero-sub {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 46ch;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero product placeholder cluster */
.hero-gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
  margin-top: 64px;
  height: 380px;
}
.hero-gallery .ph { height: 100%; }
.hero-gallery .g2 { display: grid; grid-template-rows: 1fr 1fr; gap: 18px; }
.hero-gallery .g2 .ph { height: 100%; }

/* ---- Marquee ---- */
.marquee-band {
  overflow: hidden;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  margin-top: 30px;
}
.marquee { display: flex; overflow: hidden; }
.mq-track {
  display: flex;
  align-items: center;
  gap: 42px;
  white-space: nowrap;
  will-change: transform;
}
.mq-track .w {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 38px);
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--ink);
}
.mq-track .w.out {
  color: transparent;
  -webkit-text-stroke: 1.3px rgba(178,107,255,.6);
}
.mq-track .ast { color: var(--violet-2); font-size: clamp(16px, 2.2vw, 26px); }

/* ---- Problem section ---- */
.problem { padding: 120px 0; }
.prob-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 60px;
}
.prob-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px;
}
.prob-card .pn { font-family: var(--mono); font-size: 13px; color: var(--violet); margin-bottom: 24px; }
.prob-card h3 { font-family: var(--body); font-weight: 600; font-size: 20px; letter-spacing: -.005em; margin: 0 0 10px; }
.prob-card p  { font-size: 15px; color: var(--ink-2); line-height: 1.55; margin: 0; }

/* ---- How it works (pinned gallery) ---- */
.how { padding: 120px 0; }
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  margin-top: 64px;
  align-items: start;
}

/* Sticky product-preview card */
.how-pin { position: sticky; top: 14vh; height: 72vh; }
.how-pin .stagecard {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.how-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .5s ease, transform .6s cubic-bezier(.16,1,.3,1);
}
.how-panel.show { opacity: 1; transform: none; }
.how-panel .ph { width: 100%; height: 100%; border-radius: 0; border: none; }

/* Progress dots */
.how-prog {
  position: absolute;
  left: 24px; right: 24px; bottom: 22px;
  display: flex;
  gap: 8px;
  z-index: 3;
}
.how-prog .seg {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
}
.how-prog .seg.on { background: var(--violet); }

/* Scene list */
.how-scenes { display: flex; flex-direction: column; }
.how-scene {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity .4s;
}
.how-scene .sn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--violet-soft);
  color: var(--violet);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 24px;
}
.how-scene h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -.02em;
  margin: 0 0 14px;
  line-height: 1.08;
}
.how-scene p {
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 42ch;
  margin: 0;
}

/* ---- Use cases ---- */
.uses { padding: 120px 0; }
.use-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 60px;
}
.use {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}
.use:hover { transform: translateY(-5px); box-shadow: 0 28px 50px -30px rgba(21,18,26,.35); }
.use .ph { height: 190px; }

.use .uq .by {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.use .uq .qt {
  font-family: var(--display);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: -.005em;
  line-height: 1.2;
}
.use .uq .ret {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--violet-ink);
  background: var(--violet-soft);
  border-radius: 30px;
  padding: 7px 13px;
}

/* ---- Trust & Security ---- */
.trust { padding: 120px 0; }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 60px;
}
.tcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px;
}
.tcard .lk {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: var(--violet-soft);
  color: var(--violet);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}
.tcard h3 { font-family: var(--body); font-weight: 600; font-size: 19px; margin: 0 0 10px; letter-spacing: -.005em; }
.tcard p  { font-size: 15px; color: var(--ink-2); line-height: 1.55; margin: 0; }

.provisional { margin-top: 26px; font-family: var(--mono); font-size: 12.5px; color: var(--violet); }

/* ---- Social proof ---- */
.proof { padding: 110px 0; }
.logos {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin-top: 46px;
}
.logo-ph {
  width: 150px; height: 60px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.quote { max-width: 1000px; margin: 70px auto 0; text-align: center; }
.quote p {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(26px, 3.6vw, 44px);
  letter-spacing: -.02em;
  line-height: 1.18;
  margin: 0;
}
.quote .qby { margin-top: 26px; font-family: var(--mono); font-size: 13px; color: var(--ink-3); }

/* ---- CTA section ---- */
.cta { padding: 130px 0 140px; }
.cta-card {
  background:
    radial-gradient(120% 150% at 18%  8%,   #E255B0 0%, transparent 50%),
    radial-gradient(120% 150% at 92% 26%,   #F59E3C 0%, transparent 46%),
    radial-gradient(130% 170% at 50% 122%,  #8B3FF0 0%, transparent 56%),
    #1A1030;
  color: #fff;
  border-radius: 36px;
  padding: 104px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-card h2 {
  position: relative;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 66px);
  letter-spacing: -.005em;
  line-height: 1.04;
  margin: 0 auto;
  max-width: 18ch;
}
.cta-card h2 .it { font-style: italic; color: var(--violet-2); }
.cta-card .btn   { position: relative; margin-top: 38px; }
.cta-card .btn-p { background: #fff; color: #160E2A; }
.cta-card .btn-p:hover { background: var(--violet-2); color: #fff; }

/* ---- Footer ---- */
footer { padding: 60px 0 48px; border-top: 1px solid var(--line); }
.foot { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot-col h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.foot-col a { display: block; font-size: 14.5px; color: var(--ink-2); margin-bottom: 10px; }
.foot-col a:hover { color: var(--violet-ink); }
.foot-links { display: flex; gap: 60px; flex-wrap: wrap; }
.foot-bottom {
  max-width: 1240px;
  margin: 42px auto 0;
  padding: 24px 40px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-3);
}

/* ---- Responsive ---- */
@media (max-width: 920px) {
  .nav-links { display: none; }

  .hero-gallery {
    grid-template-columns: 1fr;
    height: auto;
  }
  .hero-gallery .ph { height: 200px; }
  .hero-gallery .g2 { grid-template-rows: none; }

  .prob-grid,
  .trust-grid,
  .use-grid,
  .how-grid { grid-template-columns: 1fr; }

  /* On mobile, the sticky panel becomes static and all steps show */
  .how-pin { position: static; height: auto; }
  .how-panel { position: relative; opacity: 1; transform: none; }
  .how-pin .stagecard { height: auto; }
  .how-panel .ph { height: 240px; }

  .wrap { padding: 0 22px; }

  .cta-card { padding: 60px 28px; }
}

@media (max-width: 600px) {
  .hero { padding: 130px 0 60px; }
  .hero h1 { font-size: clamp(40px, 12vw, 72px); }
  .hero-row { flex-direction: column; align-items: flex-start; }

  .foot { flex-direction: column; }
  .foot-links { gap: 32px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   v2 — Content veil
   Each content section gets a narrow dark gradient behind its text column.
   This prevents the transparent-background sections from letting the cube
   bleed through headline copy. The cube remains visible in the margins.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.problem .wrap,
.how .wrap,
.uses .wrap,
.trust .wrap,
.proof .wrap {
  position: relative;
}
.problem .wrap::before,
.how .wrap::before,
.uses .wrap::before,
.trust .wrap::before,
.proof .wrap::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -20px; right: -20px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(10,6,18,.78) 8%,
    rgba(10,6,18,.88) 20%,
    rgba(10,6,18,.88) 80%,
    rgba(10,6,18,.78) 92%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}
