/* ============================================================
   Leovery — Global Stylesheet
   Design: Dark-first, premium, Apple-adjacent aesthetic
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors */
  --bg:          #08080F;
  --surface:     #0E0E1C;
  --surface-2:   #14142A;
  --border:      rgba(124, 58, 237, 0.18);
  --border-soft: rgba(255, 255, 255, 0.06);

  --primary:      #7C3AED;
  --primary-light: #A78BFA;
  --primary-glow: rgba(124, 58, 237, 0.35);
  --accent:       #F59E0B;
  --accent-glow:  rgba(245, 158, 11, 0.3);

  --text:       #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim:   #475569;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
          'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', monospace;

  /* Spacing */
  --max-w: 1160px;
  --gap:   clamp(1.5rem, 4vw, 3rem);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  220ms;
}

/* Light mode (respects OS preference) */
@media (prefers-color-scheme: light) {
  :root {
    --bg:          #F8F7FF;
    --surface:     #FFFFFF;
    --surface-2:   #F1EFFE;
    --border:      rgba(124, 58, 237, 0.14);
    --border-soft: rgba(0, 0, 0, 0.06);
    --text:        #0F0A1E;
    --text-muted:  #4B5563;
    --text-dim:    #9CA3AF;
    --primary-glow: rgba(124, 58, 237, 0.15);
  }
}

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

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Noise texture overlay ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ---------- Layout helpers ---------- */
.container {
  width: min(var(--max-w), 100% - 2 * clamp(1rem, 5vw, 3rem));
  margin-inline: auto;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background var(--dur) var(--ease),
              backdrop-filter var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.nav.scrolled {
  background: rgba(8, 8, 15, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
}

@media (prefers-color-scheme: light) {
  .nav.scrolled {
    background: rgba(248, 247, 255, 0.8);
  }
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav__logo svg { flex-shrink: 0; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
}

.nav__links a:hover { color: var(--text); }

.nav__cta {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1.125rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.nav__cta:hover { opacity: 0.88; transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  overflow: hidden;
}

/* Gradient mesh background */
.hero__mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero__mesh::before,
.hero__mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 12s ease-in-out infinite alternate;
}

.hero__mesh::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -150px; left: -100px;
  animation-duration: 14s;
}

.hero__mesh::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #1D4ED8 0%, transparent 70%);
  bottom: -100px; right: -50px;
  animation-duration: 18s;
  animation-direction: alternate-reverse;
  opacity: 0.35;
}

.hero__accent {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  filter: blur(90px);
  opacity: 0.2;
  top: 30%; right: 10%;
  animation: drift 16s ease-in-out infinite alternate;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-20px, 30px) scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__mesh::before,
  .hero__mesh::after,
  .hero__accent { animation: none; }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 1.25rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.08);
}

.hero__title {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero__title span {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  align-items: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  transition: transform var(--dur) var(--ease),
              opacity var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 0 var(--primary-glow);
}

.btn--primary:hover {
  opacity: 0.9;
  box-shadow: 0 8px 32px var(--primary-glow);
}

.btn--ghost {
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.03);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,0.06);
}

/* ---------- Section base ---------- */
.section {
  padding-block: clamp(4rem, 10vw, 8rem);
  position: relative;
  z-index: 1;
}

.section__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 0.75rem;
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section__sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.7;
}

/* ---------- Apps section ---------- */
.apps-empty {
  margin-top: 3rem;
  padding: 4rem 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
  text-align: center;
  background: rgba(124, 58, 237, 0.03);
}

.apps-empty__icon {
  width: 64px; height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
}

.apps-empty__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.apps-empty__text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* App cards grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.app-card {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  transition: transform var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-accent, var(--primary)) 0%, transparent 60%);
  opacity: 0.04;
  pointer-events: none;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3),
              0 0 0 1px var(--border);
}

.app-card__icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  margin-bottom: 1.25rem;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}

.app-card__icon--placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

.app-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.app-card__status--available {
  background: rgba(34, 197, 94, 0.12);
  color: #4ADE80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.app-card__status--coming-soon {
  background: rgba(245, 158, 11, 0.12);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.app-card__name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.app-card__tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.app-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
}

.app-card__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

.store-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,0.06);
}

/* ---------- About / Brand ---------- */
.brand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
  margin-top: 3rem;
}

@media (max-width: 720px) {
  .brand-grid { grid-template-columns: 1fr; }
}

.brand-values {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.value-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

.value-card__icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--border);
  font-size: 1.1rem;
}

.value-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.value-card__text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Brand visual (right column) */
.brand-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark {
  width: clamp(220px, 40vw, 340px);
  aspect-ratio: 1;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.brand-mark::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  opacity: 0.15;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: 3rem;
}

.stat {
  padding: 2rem 1.5rem;
  background: var(--surface);
  text-align: center;
}

.stat__num {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 0.25rem;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  padding-block: 2.5rem;
  position: relative;
  z-index: 1;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
}

.footer__links a {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease);
}

.footer__links a:hover { color: var(--text-muted); }

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-soft), transparent);
  margin-block: 0;
}

/* ---------- Scroll fade-in animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav__links { display: none; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; justify-content: center; }
}
