/* ==========================================================================
   Rain — marketing site
   Liquid-glass / water / teal identity, matching the game itself.
   ========================================================================== */

:root {
  --bg:        #0a1420;
  --bg-2:      #0d1b2a;
  --bg-3:      #0f2235;
  --teal:      #0d9488;
  --teal-bri:  #2fe6cf;
  --blue:      #3b82f6;
  --blue-bri:  #60a5fa;
  --ink:       #eaf2fb;
  --ink-soft:  #aebfd2;
  --ink-mute:  #7c92a8;
  --glass:     rgba(255, 255, 255, 0.045);
  --glass-2:   rgba(255, 255, 255, 0.07);
  --stroke:    rgba(255, 255, 255, 0.10);
  --stroke-2:  rgba(255, 255, 255, 0.16);
  --grad:      linear-gradient(120deg, var(--teal-bri), var(--blue) 75%);
  --grad-soft: linear-gradient(120deg, rgba(47,230,207,0.18), rgba(59,130,246,0.18));
  --radius:    18px;
  --radius-lg: 26px;
  --maxw:      1140px;
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(47, 230, 207, 0.28); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1c3247; border-radius: 9px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #25455f; }

.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;
}

.container { width: min(100% - 2.6rem, var(--maxw)); margin-inline: auto; }

/* lift all real content above the decorative .cardscape layer */
main { position: relative; z-index: 1; }

/* ---------- ambient background ---------- */
.ambient {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 50% -10%, #10283f 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
  will-change: transform;
}
.b1 { width: 46vw; height: 46vw; left: -10vw; top: -8vh;
  background: radial-gradient(circle at 30% 30%, rgba(47,230,207,0.55), transparent 65%);
  animation: drift1 26s var(--ease) infinite alternate; }
.b2 { width: 50vw; height: 50vw; right: -14vw; top: 12vh;
  background: radial-gradient(circle at 60% 40%, rgba(59,130,246,0.5), transparent 65%);
  animation: drift2 32s var(--ease) infinite alternate; }
.b3 { width: 40vw; height: 40vw; left: 28vw; bottom: -16vh;
  background: radial-gradient(circle at 50% 50%, rgba(13,148,136,0.5), transparent 65%);
  animation: drift3 30s var(--ease) infinite alternate; }

@keyframes drift1 { to { transform: translate(8vw, 10vh) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-9vw, 8vh) scale(1.08); } }
@keyframes drift3 { to { transform: translate(6vw, -10vh) scale(1.12); } }

.grain {
  position: absolute; inset: 0; opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- buttons ---------- */
.btn {
  --pad: 0.95rem 1.5rem;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: var(--pad);
  font: 600 0.98rem/1 var(--font);
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn--sm { --pad: 0.6rem 1.05rem; font-size: 0.9rem; }
.btn--primary {
  color: #04141a;
  background: var(--grad);
  box-shadow: 0 10px 30px -10px rgba(47,230,207,0.6), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(47,230,207,0.75), inset 0 1px 0 rgba(255,255,255,0.5); }
.btn--ghost {
  color: var(--ink);
  background: var(--glass);
  border-color: var(--stroke-2);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--teal-bri); background: var(--glass-2); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 20, 32, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--stroke);
}
.nav__inner {
  width: min(100% - 2.6rem, var(--maxw)); margin-inline: auto;
  height: 74px; display: flex; align-items: center; gap: 1.2rem;
  transition: height .3s var(--ease);
}
.nav.scrolled .nav__inner { height: 62px; }

.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; }
.brand__drop { width: 22px; height: 26px; fill: var(--grad); }
.brand__drop path { fill: url(#g); }
/* svg gradient fill fallback */
.brand__drop { filter: drop-shadow(0 2px 8px rgba(47,230,207,0.4)); }
.brand__drop path { fill: #2fe6cf; }
.brand__name { font-size: 1.28rem; letter-spacing: -0.02em; }

.nav__links { display: flex; gap: 1.7rem; margin-left: auto; }
.nav__links a {
  color: var(--ink-soft); font-size: 0.96rem; font-weight: 500;
  position: relative; transition: color .2s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad); transition: width .25s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.nav__cta { display: flex; align-items: center; gap: 0.7rem; }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s, opacity .2s; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; display: grid; place-items: center;
  text-align: center; position: relative; padding: 7rem 1.3rem 5rem;
}
.hero__wrap { max-width: 860px; position: relative; z-index: 2; }
.eyebrow, .kicker {
  display: inline-block; font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--teal-bri);
  padding: 0.45rem 0.95rem; border: 1px solid rgba(47,230,207,0.3);
  border-radius: 999px; background: rgba(47,230,207,0.06); margin-bottom: 1.8rem;
}
.wordmark {
  font-size: clamp(5.5rem, 19vw, 13rem); font-weight: 700; line-height: 0.9;
  letter-spacing: -0.05em; margin: 0 0 0.4rem;
  background: linear-gradient(180deg, #ffffff 0%, #bfeee6 55%, var(--teal-bri) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 80px rgba(47,230,207,0.25);
}
.hero__tag {
  font-size: clamp(1.25rem, 3.4vw, 2rem); font-weight: 600;
  color: var(--ink); max-width: 26ch; margin: 0 auto 1.1rem; line-height: 1.25;
}
.hero__sub { color: var(--ink-soft); max-width: 52ch; margin: 0 auto 2.3rem; font-size: 1.08rem; }
.hero__actions { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* floating abstract cards behind hero */
.hero__cards { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fcard {
  position: absolute; border-radius: 16px; border: 1px solid var(--stroke-2);
  background: var(--grad-soft); backdrop-filter: blur(6px);
  box-shadow: 0 30px 60px -25px rgba(0,0,0,0.7);
  opacity: 0.5;
}
.fcard--1 { width: 150px; height: 210px; left: 8%;  top: 26%; transform: rotate(-13deg); animation: float1 9s var(--ease) infinite alternate; }
.fcard--2 { width: 170px; height: 238px; right: 9%; top: 22%; transform: rotate(12deg);  animation: float2 11s var(--ease) infinite alternate; }
.fcard--3 { width: 130px; height: 182px; right: 22%; bottom: 12%; transform: rotate(-6deg); animation: float3 10s var(--ease) infinite alternate; }
@keyframes float1 { to { transform: rotate(-13deg) translateY(-22px); } }
@keyframes float2 { to { transform: rotate(12deg) translateY(-26px); } }
@keyframes float3 { to { transform: rotate(-6deg) translateY(-18px); } }

.scrollcue {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--stroke-2); border-radius: 14px;
  display: grid; place-items: start center; padding-top: 7px;
}
.scrollcue span { width: 4px; height: 8px; background: var(--teal-bri); border-radius: 4px; animation: scrolldot 1.6s var(--ease) infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- marquee ---------- */
/* The track holds one or two equal-width groups. JS grows a single group until
   it spans the viewport, then duplicates it — so translateX(-50%) loops with no
   blank gaps on any screen width. The animation only runs once JS marks it ready,
   so the band degrades to a static row (not a broken scroller) without JS. */
.marquee {
  border-block: 1px solid var(--stroke);
  background: rgba(255,255,255,0.02); overflow: hidden; padding: 1rem 0;
}
.marquee__track {
  display: flex; align-items: center; width: max-content; white-space: nowrap;
}
.marquee__track--ready { animation: scrollx var(--mq-dur, 28s) linear infinite; }
.marquee__group {
  display: flex; align-items: center; gap: 1.6rem; padding-right: 1.6rem;
  flex: none;
}
.marquee__group span { font-weight: 600; font-size: 1.05rem; color: var(--ink-soft); letter-spacing: 0.02em; }
.marquee__group i { color: var(--teal); font-style: normal; }
@keyframes scrollx { to { transform: translateX(-50%); } }

/* ---------- floating cards scattered down the whole page ---------- */
/* Decorative cards behind the content, so the floaty hero cards have company as
   you scroll. Each card's size / place / tilt / opacity comes from inline custom
   properties. `rotate` and the bobbing `translate` are independent properties, so
   the gentle float never fights the tilt — and disabling the animation (reduced
   motion) leaves each card sitting nicely tilted. */
.cardscape {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.cardscape .fcard {
  position: absolute;
  width: var(--w, 120px);
  height: calc(var(--w, 120px) * 1.4);
  top: var(--y, 110vh);
  left: var(--x, 5%);
  rotate: var(--rot, -8deg);
  opacity: var(--op, 0.2);
  backdrop-filter: none;
  animation: bob var(--dur, 9s) var(--ease) infinite alternate;
  animation-delay: var(--delay, 0s);
}
@keyframes bob { to { translate: 0 var(--lift, -16px); } }

/* ---------- sections ---------- */
.section { padding: 6.5rem 0; position: relative; }
.h2 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.kicker { margin-bottom: 1rem; }

.philosophy { text-align: center; }
.bigstatement {
  font-size: clamp(2.2rem, 6.2vw, 4.4rem); font-weight: 700; line-height: 1.04;
  letter-spacing: -0.035em; margin-bottom: 2rem;
}
.bigstatement em {
  font-style: normal;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bigstatement--sm { font-size: clamp(1.9rem, 5vw, 3rem); margin-bottom: 1.6rem; }
.lede { color: var(--ink-soft); max-width: 60ch; margin-inline: auto; font-size: 1.12rem; }
.philosophy .lede + .lede { margin-top: 1.1rem; }

/* pillars */
.pillars__head { text-align: center; margin-bottom: 3.2rem; }
.pillars__head .lede { margin-top: 1rem; }
.grid { display: grid; gap: 1.3rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--radius-lg);
  padding: 2.1rem 1.9rem; backdrop-filter: blur(12px);
  transition: transform .35s var(--ease), border-color .35s, background .35s, box-shadow .35s;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .35s;
}
.card:hover { transform: translateY(-6px); background: var(--glass-2); border-color: var(--stroke-2); box-shadow: 0 24px 50px -28px rgba(47,230,207,0.5); }
.card:hover::before { opacity: 0.6; }
.card__icon {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--stroke); color: var(--teal-bri);
  margin-bottom: 1.3rem;
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.card p { color: var(--ink-soft); font-size: 1rem; }

/* teaser */
.teaser { text-align: center; }
.teaser__inner {
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--radius-lg);
  padding: 4.5rem 2rem; backdrop-filter: blur(14px); position: relative; overflow: hidden;
}
.teaser__inner::after {
  content: ""; position: absolute; width: 60%; height: 200%; top: -50%; left: 20%;
  background: var(--grad); filter: blur(80px); opacity: 0.14; z-index: -1;
}
.teaser .lede { margin-bottom: 2rem; }

/* faq */
.faq__head { text-align: center; margin-bottom: 2.6rem; }
.faq__list { max-width: 760px; margin-inline: auto; display: grid; gap: 0.8rem; }
.faq__item {
  background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--radius);
  padding: 0.2rem 1.3rem; backdrop-filter: blur(10px); transition: border-color .25s, background .25s;
}
.faq__item[open] { border-color: var(--stroke-2); background: var(--glass-2); }
.faq__item summary {
  list-style: none; cursor: pointer; padding: 1.05rem 2rem 1.05rem 0;
  font-weight: 600; font-size: 1.06rem; position: relative;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 50%;
  width: 14px; height: 14px;
  border-right: 2px solid var(--teal-bri); border-bottom: 2px solid var(--teal-bri);
  transform: translateY(-50%) rotate(45deg); transition: transform .25s var(--ease);
}
.faq__item[open] summary::after { transform: translateY(-50%) rotate(-135deg); }
.faq__item p { color: var(--ink-soft); padding: 0 0 1.2rem; max-width: 62ch; }
.faq__item summary em { font-style: normal; color: var(--teal-bri); }

/* cta */
.cta { padding: 6rem 0 5rem; }
.cta__inner { text-align: center; }
.cta__inner .btn { margin-top: 1.2rem; }

/* footer */
.footer { border-top: 1px solid var(--stroke); padding: 3rem 0 3.5rem; position: relative; z-index: 1; }
.footer__inner { text-align: center; display: grid; gap: 0.7rem; justify-items: center; }
.brand--footer { justify-self: center; }
.footer__tag { color: var(--ink-soft); max-width: 40ch; }
.footer__legal { color: var(--ink-mute); font-size: 0.86rem; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .grid--3 { grid-template-columns: 1fr; }
  .cardscape { display: none; }
  .nav__links {
    position: fixed; inset: 62px 0 auto 0; flex-direction: column; gap: 0;
    background: rgba(10,20,32,0.95); backdrop-filter: blur(18px);
    padding: 1rem 1.3rem 1.6rem; border-bottom: 1px solid var(--stroke);
    transform: translateY(-120%); transition: transform .35s var(--ease); z-index: -1;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: 0.95rem 0; border-bottom: 1px solid var(--stroke); }
  .nav__links a::after { display: none; }
  .nav__burger { display: flex; }
  .nav__cta .btn--ghost.sm { display: none; }
  .fcard--3 { display: none; }
  .section { padding: 5rem 0; }
}

@media (max-width: 540px) {
  body { font-size: 16px; }
  .hero { padding-top: 6rem; }
  .fcard--1, .fcard--2 { opacity: 0.32; }
  .fcard--1 { width: 110px; height: 154px; }
  .fcard--2 { width: 120px; height: 168px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
