/* ═══════════════════════════════════════════════════════════════
   RiftMate
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --bg:       #0a0e14;
  --bg-2:     #0f1319;
  --surface:  #13181f;
  --surface-2:#181e27;
  --border:   rgba(255,255,255,.06);
  --border-2: rgba(255,255,255,.1);

  --text:      #e4e8ed;
  --text-2:    #9aa3b0;
  --text-3:    #5e6773;

  --accent:    #4a9eed;
  --accent-bg: rgba(74,158,237,.1);

  --radius:    12px;
  --radius-lg: 18px;
  --max-w:     1200px;

  --font:      -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  --font-head: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, Menlo, monospace;

  --ease:     cubic-bezier(.25,.46,.45,.94);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ── Reveal ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ═══════════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .35s var(--ease), border-color .35s var(--ease);
}
.nav.is-scrolled {
  background: rgba(10,14,20,.8);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex; align-items: center; gap: 32px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head);
  font-weight: 700; font-size: 1rem;
}
.nav-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
}
.nav-links {
  display: flex; gap: 28px;
  margin-left: auto;
}
.nav-links a {
  color: var(--text-2); font-size: .88rem; font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: .82rem; font-weight: 600;
  background: var(--text); color: var(--bg);
  transition: opacity .2s;
}
.nav-cta:hover { opacity: .88; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px;
  font-weight: 600; font-size: .92rem;
  cursor: pointer; border: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(74,158,237,.3);
}
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: rgba(255,255,255,.04); color: var(--text); }
.btn-lg { padding: 16px 30px; font-size: .95rem; }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 80px 28px 0;
  overflow: hidden;
  text-align: center;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  top: -300px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, rgba(74,158,237,.1) 0%, transparent 70%);
  filter: blur(40px);
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.08;
  color: var(--text);
}
.hero-sub {
  margin: 20px auto 0;
  max-width: 540px;
  color: var(--text-2);
  font-size: clamp(.98rem, 1.3vw, 1.12rem);
  line-height: 1.65;
}
.hero-cta {
  margin-top: 36px;
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

/* Hero image */
.hero-device {
  max-width: 1100px;
  margin: 60px auto 0;
  will-change: transform;
}
.hero-device img {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   STORY (sticky scroll)
   ═══════════════════════════════════════════════════════════════ */
.story {
  max-width: 1400px;
  margin: 0 auto;
  padding: 120px 40px 60px;
}
.story-track {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 80px;
  align-items: flex-start;
}
.story-visual {
  position: sticky;
  top: 80px;
  padding: 20px 0;
}

.story-shots {
  position: relative;
}
.story-shot {
  width: 100%;
  display: block;
  opacity: 0;
  transition: opacity .6s var(--ease-out);
}
/* Stack all shots on top of each other; first is in flow, rest are absolute */
.story-shot:not(:first-child) {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: contain;
}
.story-shot.is-active { opacity: 1; }

.story-text {
  display: flex; flex-direction: column;
}
.story-step {
  min-height: 80vh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 40px 0;
  opacity: .25;
  transition: opacity .4s var(--ease);
}
.story-step.is-active { opacity: 1; }

.step-num {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 16px;
}
.story-step h2 {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.story-step p {
  margin-top: 14px;
  color: var(--text-2);
  font-size: .98rem;
  max-width: 420px;
  line-height: 1.65;
}
.step-list {
  margin-top: 20px;
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.step-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-2);
  font-size: .9rem;
}
.step-list li::before {
  content: '';
  position: absolute; left: 0; top: 10px;
  width: 8px; height: 1px;
  background: var(--text-3);
}

/* ═══════════════════════════════════════════════════════════════
   FEATURES
   ═══════════════════════════════════════════════════════════════ */
.section-head {
  max-width: 620px;
  margin: 0 auto 52px;
  text-align: center;
}
.section-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.12;
}
.section-sub {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 1rem;
}

.features {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 100px 28px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature-card {
  background: var(--bg);
  padding: 36px 32px;
}
.feature-card--wide { grid-column: span 2; }
.feature-label {
  display: inline-block;
  font-size: .7rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-card h3 {
  font-family: var(--font-head);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
}
.feature-card--wide h3 {
  font-size: 1.3rem;
}
.feature-card p {
  color: var(--text-2);
  font-size: .9rem;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   HOW IT WORKS
   ═══════════════════════════════════════════════════════════════ */
.how {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 28px 120px;
}
.how-steps {
  list-style: none;
  max-width: 680px;
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: 0;
}
.how-step {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.how-step:last-child { border-bottom: none; }
.how-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: .8rem; font-weight: 600;
  color: var(--text-2);
}
.how-step h3 {
  font-size: 1rem; font-weight: 600;
  margin-bottom: 4px;
}
.how-step p {
  color: var(--text-2);
  font-size: .9rem;
}

/* ═══════════════════════════════════════════════════════════════
   CTA
   ═══════════════════════════════════════════════════════════════ */
.cta {
  padding: 120px 28px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.cta-icon {
  margin: 0 auto 28px;
  border-radius: 18px;
}
.cta-inner h2 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.cta-inner > p {
  margin: 16px auto 32px;
  color: var(--text-2);
  font-size: 1.05rem;
}
.cta-fine {
  margin-top: 20px;
  color: var(--text-3);
  font-size: .8rem;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 28px 36px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .92rem;
}
.footer-icon {
  border-radius: 5px;
}
.footer-links {
  display: flex; gap: 24px;
  margin-left: auto;
}
.footer-links a {
  color: var(--text-2);
  font-size: .85rem;
  transition: color .15s;
}
.footer-links a:hover { color: var(--text); }
.footer-fine {
  flex-basis: 100%;
  color: var(--text-3);
  font-size: .75rem;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   SUB-PAGES (Privacy / Support)
   ═══════════════════════════════════════════════════════════════ */
.page-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 80px 28px 120px;
}
.page-content h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 12px;
}
.page-content .subtitle {
  color: var(--text-3);
  font-size: .9rem;
  margin-bottom: 48px;
}
.page-content h2 {
  font-size: 1.2rem; font-weight: 700;
  margin: 40px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.page-content h2:first-of-type { border-top: none; padding-top: 0; }
.page-content p, .page-content li {
  color: var(--text-2);
  font-size: .95rem;
  line-height: 1.7;
}
.page-content ul { list-style: none; padding-left: 0; margin: 12px 0; }
.page-content li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
}
.page-content li::before {
  content: '';
  position: absolute; left: 0; top: 13px;
  width: 8px; height: 1px;
  background: var(--text-3);
}
.page-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(74,158,237,.35);
}
.page-content a:hover { text-decoration-color: var(--accent); }

.support-intro {
  color: var(--text-2);
  font-size: 1rem;
  margin-bottom: 36px;
  line-height: 1.7;
}
.support-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .8rem; font-weight: 600;
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: .92rem;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-submit { display: flex; justify-content: flex-end; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .story { padding: 80px 28px 40px; }
  .story-track {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .story-visual {
    position: relative;
    top: auto;
    order: -1;
    max-width: 700px;
    margin: 0 auto;
  }
  .story-step { min-height: auto; padding: 28px 0; opacity: 1; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card--wide { grid-column: auto; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 0 20px; }
  .hero { padding: 56px 20px 0; }
  .hero-device { margin-top: 40px; }
  .story { padding: 60px 20px 20px; }
  .features { padding: 70px 20px; }
  .how { padding: 20px 20px 80px; }
  .cta { padding: 80px 20px; }
  .page-content { padding: 60px 20px 80px; }
  .support-form { padding: 24px; }
  .footer-inner { flex-direction: column; text-align: center; gap: 16px; }
  .footer-links { margin-left: 0; }
  .footer-fine { text-align: center; }
}
