/* ============================================================
   RAVATA STORE — styles.css
   Custom styles that Tailwind (CDN) does not provide:
   animations, glass cards, the orbital hero, legal typography.
   Loaded by every page after the Tailwind CDN script.
   ============================================================ */

/* ---------- 1. Design tokens (colors used across the site) ---------- */
:root {
  --space-950: #05060f;   /* page background, deepest */
  --space-900: #090b1c;   /* section background */
  --space-800: #101235;   /* card background */
  --violet:    #8b5cf6;   /* primary accent */
  --indigo:    #6366f1;   /* secondary accent */
  --cyan:      #22d3ee;   /* highlight accent */
  --line:      rgba(148, 163, 255, 0.14); /* subtle borders */
  --text-soft: #9aa3c0;   /* muted paragraph text */
}

/* ---------- 2. Base ---------- */
html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--space-950);
  overflow-x: hidden;                 /* prevents horizontal scroll from glows */
  -webkit-font-smoothing: antialiased;
}

/* Offset for anchor links so the fixed navbar doesn't cover the target */
[id] { scroll-margin-top: 104px; }

/* Custom scrollbar (desktop only) */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--space-950); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--violet), var(--indigo));
  border-radius: 999px;
  border: 3px solid var(--space-950);
}

/* Visible keyboard focus everywhere (accessibility) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 3. Background layers ---------- */

/* The animated star canvas sits behind everything */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  pointer-events: none;
}

/* Faint technical grid, faded out towards the bottom */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 10%, transparent 70%);
}

/* Big blurred light sources ("nebulas") */
.orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
}
.orb-violet { background: rgba(139, 92, 246, 0.35); }
.orb-cyan   { background: rgba(34, 211, 238, 0.22); }
.orb-indigo { background: rgba(99, 102, 241, 0.28); }

/* ---------- 4. Logo ---------- */
.logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #05060f;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 32px rgba(139, 92, 246, 0.45);
  overflow: hidden;
  flex: none;
}
.logo-mark::after {                    /* glossy highlight on top of the square */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.4), transparent 55%);
  pointer-events: none;
}
.logo-mark span { position: relative; z-index: 1; }

/* ---------- 5. Text & surfaces ---------- */
.text-gradient {
  background: linear-gradient(100deg, #ddd6fe 0%, var(--violet) 40%, var(--cyan) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Small uppercase technical label (mono face) */
.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 24px 60px -28px rgba(99, 102, 241, 0.75);
}

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
.btn-primary {
  color: #06070f;
  background: linear-gradient(100deg, var(--cyan), var(--violet));
  box-shadow: 0 12px 40px -12px rgba(139, 92, 246, 0.9);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 50px -12px rgba(34, 211, 238, 0.8); }
.btn-ghost {
  color: #e5e7fb;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover { border-color: rgba(34, 211, 238, 0.55); transform: translateY(-2px); }

/* ---------- 7. Navbar ---------- */
#navbar { transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease; }
#navbar.is-scrolled {
  background-color: rgba(5, 6, 15, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-link { position: relative; color: #c3c9e0; font-size: 14px; font-weight: 500; transition: color 0.25s ease; }
.nav-link::after {                     /* underline that grows on hover */
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 1.5px;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.3s ease;
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { width: 100%; }

/* Mobile menu: closed by default, opens by animating max-height */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-menu.is-open { max-height: 420px; }

/* Hamburger -> X animation */
.burger-line { transition: transform 0.3s ease, opacity 0.2s ease; }
.is-open .burger-top    { transform: translateY(7px) rotate(45deg); }
.is-open .burger-middle { opacity: 0; }
.is-open .burger-bottom { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 8. Hero: the orbital device (signature element) ---------- */
.orbit-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 460px;
  height: 460px;
  margin-inline: auto;
}

/* Two rings that slowly rotate around the phone.
   They are perfect squares so the circle never turns into a wobbly ellipse. */
.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  margin: -200px 0 0 -200px;
  border: 1px solid rgba(148, 163, 255, 0.22);
  border-radius: 50%;
  animation: spin 26s linear infinite;
}
.orbit-ring.ring-inner {
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-style: dashed;
  border-color: rgba(34, 211, 238, 0.2);
  animation: spin 18s linear infinite reverse;
}

/* Platform badges that travel along the outer ring.
   The wrapper is only positioned; the label inside counter-rotates so the
   text always stays readable. Two separate elements are needed because one
   element can only hold one transform at a time. */
.orbit-node {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
}
.node-ios     { top: 0; }
.node-android { top: 100%; }

.orbit-node-label {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #e8ebff;
  background: rgba(9, 11, 28, 0.92);
  border: 1px solid rgba(148, 163, 255, 0.3);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.5);
  white-space: nowrap;
  animation: spin 26s linear infinite reverse;
}

/* The phone itself */
.phone {
  position: relative;
  z-index: 2;
  width: 216px;
  height: 440px;
  padding: 10px;
  border-radius: 42px;
  background: linear-gradient(165deg, #1a1d3d, #06070f 60%);
  border: 1px solid rgba(148, 163, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 40px 80px -30px rgba(99, 102, 241, 0.85);
  animation: float 7s ease-in-out infinite;
}
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 33px;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(139, 92, 246, 0.4), transparent 60%),
    linear-gradient(180deg, #0b0d22, #05060f);
  padding: 26px 16px 16px;
}
.phone-notch {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 18px;
  border-radius: 999px;
  background: #05060f;
  border: 1px solid rgba(148, 163, 255, 0.2);
}

/* Animated bars inside the phone screen (a fake analytics widget).
   flex:1 shares the width evenly, height:100% fills the chart box,
   then scaleY() animates the bar up and down from its base. */
.bar {
  flex: 1 1 0;
  height: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  transform-origin: bottom;
  animation: grow 2.6s ease-in-out infinite;
}

/* Small scan line sweeping down the screen */
.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.12), transparent);
  animation: scan 5s linear infinite;
}

/* ---------- 9. Keyframes ---------- */
@keyframes spin  { from { transform: rotate(0deg); }   to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(-10px); } 50% { transform: translateY(10px); } }
@keyframes grow  { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
@keyframes scan  { 0% { top: -90px; } 100% { top: 100%; } }
@keyframes pulse-soft { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.pulse-dot { animation: pulse-soft 2.2s ease-in-out infinite; }

/* ---------- 10. Scroll reveal (activated from script.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 11. Legal pages typography ---------- */
.legal { color: #c3c9e0; font-size: 15.5px; line-height: 1.85; }
.legal h2 {
  margin-top: 48px;
  margin-bottom: 14px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  scroll-margin-top: 110px;
}
.legal h3 { margin-top: 28px; margin-bottom: 8px; color: #e8ebff; font-size: 17px; font-weight: 600; }
.legal p  { margin-bottom: 16px; }
.legal ul { margin: 0 0 16px 0; padding-left: 0; list-style: none; }
.legal li { position: relative; padding-left: 24px; margin-bottom: 9px; }
.legal li::before {                    /* custom bullet in accent color */
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
}
.legal a { color: #7dd3fc; text-decoration: underline; text-underline-offset: 3px; }
.legal a:hover { color: #a5f3fc; }
.legal strong { color: #ffffff; font-weight: 600; }
.legal table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 14.5px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; vertical-align: top; }
.legal th { color: #ffffff; background: rgba(255, 255, 255, 0.04); font-weight: 600; }

/* ---------- 12. Small screens ---------- */
@media (max-width: 639px) {
  .orbit-stage { height: 400px; }
  .orbit-ring  { width: 316px; height: 316px; margin: -158px 0 0 -158px; }
  .orbit-ring.ring-inner { width: 240px; height: 240px; margin: -120px 0 0 -120px; }
  .phone { width: 186px; height: 372px; border-radius: 36px; }
  .phone-screen { border-radius: 28px; padding: 22px 13px 13px; }
  .orbit-node-label { font-size: 11px; padding: 6px 12px; }
}

/* ---------- 13. Reduced motion (accessibility) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
