/* ============================================
   SKY GRIT PORTAL — STYLE.CSS
   Mobile-first, professional, modern
   Colors: #0E0B1D #2A1E4D #5A3B8C #8B7CC7 #C9C2E3 #3A3A52
   Fonts: Syne (headings) + DM Sans (body)
   ============================================ */

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

:root {
  --bg-dark:      #0E0B1D;
  --bg-deep:      #2A1E4D;
  --purple:       #5A3B8C;
  --purple-mid:   #8B7CC7;
  --purple-lt:    #C9C2E3;
  --slate:        #3A3A52;
  --white:        #ffffff;
  --text-main:    #E8E4F5;
  --text-muted:   #9A90B8;
  --glow:         rgba(139,124,199,0.4);
  --glow-str:     rgba(90,59,140,0.6);

  /* Nav height — mobile smaller */
  --nav-h:        60px;
  --radius-card:  18px;
  --radius-btn:   100px;
  --transition:   0.28s cubic-bezier(0.4,0,0.2,1);

  /* Touch target minimum */
  --touch-min:    48px;
}

/* ---- Desktop nav height ---- */
@media (min-width: 768px) {
  :root { --nav-h: 72px; }
}

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

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   CANVAS BACKGROUND
=========================== */
#spaceCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(14,11,29,0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(139,124,199,0.18);
  transition: background var(--transition);
}

@media (min-width: 768px) {
  .navbar { padding: 0 2.5rem; }
}

.navbar.scrolled {
  background: rgba(14,11,29,0.95);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--glow));
}

@media (min-width: 768px) {
  .nav-logo-img { width: 40px; height: 40px; }
}

.nav-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  letter-spacing: 0.06em;
  line-height: 1;
}

@media (min-width: 768px) {
  .nav-brand { font-size: 1.1rem; }
}

.nav-sep { color: var(--purple-mid); margin: 0 3px; }

/* Desktop nav links */
.nav-links {
  display: none;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-link {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 4px;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--purple-mid));
  border-radius: 2px;
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active { color: var(--white); }

.nav-link.active::after,
.nav-link:hover::after { width: 100%; }

/* ===========================
   HAMBURGER
=========================== */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background var(--transition);
}

.hamburger:active {
  background: rgba(139,124,199,0.1);
}

@media (min-width: 768px) {
  .hamburger { display: none; }
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--purple-mid);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================
   MOBILE DRAWER MENU
=========================== */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(10,8,22,0.98);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  display: flex;
  flex-direction: column;
  z-index: 90;
  transform: translateY(-110%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  border-bottom: 1px solid rgba(139,124,199,0.2);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-menu.open { transform: translateY(0); }

.mob-link {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 1.1rem 1.5rem;
  width: 100%;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(139,124,199,0.08);
  transition: color var(--transition), background var(--transition), padding-left var(--transition);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

.mob-link:hover,
.mob-link.active {
  color: var(--white);
  background: rgba(90,59,140,0.12);
  padding-left: 2rem;
}

/* Active indicator bar */
.mob-link.active {
  border-left: 3px solid var(--purple-mid);
}

/* ===========================
   MAIN LAYOUT
=========================== */
main {
  position: relative;
  z-index: 10;
  padding-top: var(--nav-h);
}

.section {
  display: none;
  min-height: 100vh;
}

.section.active { display: block; }

/* ===========================
   HERO — MOBILE FIRST
=========================== */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.25rem 2.5rem;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .hero {
    padding: 4rem 2rem 3rem;
    gap: 1.5rem;
  }
}

/* Badge */
.hero-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--purple-mid);
  background: rgba(90,59,140,0.14);
  border: 1px solid rgba(139,124,199,0.28);
  padding: 5px 16px;
  border-radius: 100px;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .hero-badge { font-size: 0.78rem; padding: 6px 20px; }
}

/* Logo wrap */
.hero-logo-wrap {
  position: relative;
  width: 110px; height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 480px) {
  .hero-logo-wrap { width: 130px; height: 130px; }
}

@media (min-width: 768px) {
  .hero-logo-wrap { width: 160px; height: 160px; }
}

.logo-glow-ring {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90,59,140,0.5) 0%, transparent 70%);
  animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%,100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.1); opacity: 1; }
}

.hero-logo {
  width: 95px; height: 95px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(139,124,199,0.65));
  animation: float 4s ease-in-out infinite;
}

@media (min-width: 480px) {
  .hero-logo { width: 115px; height: 115px; }
}

@media (min-width: 768px) {
  .hero-logo { width: 140px; height: 140px; }
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Hero title */
.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.6rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.title-sky {
  color: var(--white);
  text-shadow: 0 0 30px rgba(139,124,199,0.45);
}

.title-sep { color: var(--purple-mid); }

.title-sg {
  background: linear-gradient(135deg, var(--purple-mid), var(--purple-lt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero sub */
.hero-sub {
  font-size: clamp(0.9rem, 3vw, 1.15rem);
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.8;
  font-weight: 300;
  letter-spacing: 0.01em;
  padding: 0 0.25rem;
}

/* Buttons */
.hero-btns {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 320px;
  margin-top: 0.25rem;
}

@media (min-width: 480px) {
  .hero-btns {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
    width: auto;
  }
}

.btn-primary {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--white);
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  border: none;
  padding: 0 28px;
  height: var(--touch-min);
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 22px rgba(90,59,140,0.5);
  width: 100%;
}

@media (min-width: 480px) {
  .btn-primary { width: auto; padding: 0 32px; }
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(90,59,140,0.65);
}

.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--purple-lt);
  background: transparent;
  border: 1px solid rgba(139,124,199,0.35);
  padding: 0 28px;
  height: var(--touch-min);
  border-radius: var(--radius-btn);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition);
  width: 100%;
}

@media (min-width: 480px) {
  .btn-ghost { width: auto; padding: 0 32px; }
}

.btn-ghost:hover {
  border-color: var(--purple-mid);
  background: rgba(90,59,140,0.1);
}

.btn-ghost:active { transform: scale(0.97); }

/* Stats row */
.stats-row {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.stat-card {
  background: rgba(42,30,77,0.5);
  border: 1px solid rgba(139,124,199,0.18);
  border-radius: 14px;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(12px);
  flex: 1;
  min-width: 80px;
  transition: border-color var(--transition), transform var(--transition);
}

@media (min-width: 480px) {
  .stat-card { flex: unset; padding: 0.9rem 1.75rem; }
}

.stat-card:active { transform: scale(0.97); }

@media (min-width: 768px) {
  .stat-card:hover {
    border-color: rgba(139,124,199,0.5);
    transform: translateY(-4px);
  }
}

.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

@media (min-width: 480px) {
  .stat-num { font-size: 1.6rem; }
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}

/* ===========================
   ABOUT SECTION
=========================== */
.about-section {
  padding: 4rem 1.25rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

@media (min-width: 768px) {
  .about-section { padding: 6rem 2rem; }
}

.section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--purple-mid);
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.section-desc {
  font-size: clamp(0.88rem, 2.5vw, 1rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

@media (min-width: 1024px) {
  .features-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}

.feature-card {
  background: rgba(42,30,77,0.4);
  border: 1px solid rgba(139,124,199,0.13);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.1rem;
  text-align: left;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  /* Active press on mobile */
  cursor: default;
}

.feature-card:active {
  transform: scale(0.98);
  background: rgba(42,30,77,0.65);
}

@media (min-width: 768px) {
  .feature-card { padding: 2rem 1.5rem; }
  .feature-card:hover {
    border-color: rgba(139,124,199,0.4);
    background: rgba(42,30,77,0.65);
    transform: translateY(-6px);
  }
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 768px) {
  .feature-icon { font-size: 2rem; }
}

.feature-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

@media (min-width: 768px) {
  .feature-card h3 { font-size: 0.95rem; }
}

.feature-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===========================
   TOOLS / PRODUCTS SECTION
=========================== */
.products-hero {
  text-align: center;
  padding: 3rem 1.25rem 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .products-hero { padding: 5rem 2rem 2rem; }
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 580px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 1.5rem 1.5rem 4rem;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem 2rem 5rem;
  }
}

/* Product / Tool card */
.product-card {
  position: relative;
  background: rgba(42,30,77,0.45);
  border: 1px solid rgba(139,124,199,0.18);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  overflow: hidden;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

/* Tap press on mobile */
.product-card:active:not(.coming-soon) {
  transform: scale(0.985);
  border-color: rgba(139,124,199,0.45);
}

@media (min-width: 768px) {
  .product-card { padding: 2rem; gap: 0.75rem; }
  .product-card:hover {
    border-color: rgba(139,124,199,0.5);
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(10,7,22,0.5);
  }
}

.product-card.coming-soon {
  opacity: 0.65;
}

/* Corner glow */
.product-glow {
  position: absolute;
  top: -40px; right: -40px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90,59,140,0.32), transparent 70%);
  pointer-events: none;
}

.product-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--purple-mid);
  text-transform: uppercase;
}

.product-icon {
  font-size: 2.2rem;
  line-height: 1;
}

@media (min-width: 768px) {
  .product-icon { font-size: 2.5rem; }
}

.product-name {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .product-name { font-size: 1.1rem; }
}

.product-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.product-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.product-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
}

.product-badge.free {
  background: rgba(90,59,140,0.2);
  color: var(--purple-mid);
  border: 1px solid rgba(139,124,199,0.3);
}

.product-badge.web {
  background: rgba(58,58,82,0.5);
  color: var(--purple-lt);
  border: 1px solid rgba(139,124,199,0.15);
}

.product-badge.soon {
  background: rgba(42,30,77,0.5);
  color: var(--text-muted);
  border: 1px solid rgba(139,124,199,0.15);
}

/* Launch button */
.product-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  border: none;
  height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  margin-top: 0.4rem;
  box-shadow: 0 4px 16px rgba(90,59,140,0.38);
  letter-spacing: 0.02em;
  /* Full width on mobile — easier to tap */
  width: 100%;
}

@media (min-width: 768px) {
  .product-btn { width: auto; }
  .product-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(90,59,140,0.6);
  }
}

.product-btn:active:not(.disabled) {
  transform: scale(0.97);
}

.product-btn.disabled {
  background: rgba(58,58,82,0.45);
  box-shadow: none;
  cursor: not-allowed;
  color: var(--text-muted);
}

.btn-arrow {
  transition: transform var(--transition);
  display: inline-block;
}

.product-btn:hover .btn-arrow { transform: translateX(4px); }

/* ===========================
   FOOTER
=========================== */
.footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem 1.25rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(139,124,199,0.12);
  background: rgba(14,11,29,0.65);
  backdrop-filter: blur(16px);
}

@media (min-width: 768px) {
  .footer { padding: 2.5rem 2rem; }
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--white);
  margin-bottom: 0.65rem;
}

.footer-logo-img {
  width: 28px; height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px var(--glow));
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===========================
   SAFE AREA — Notch / home bar
=========================== */
body {
  padding-top: env(safe-area-inset-top, 0px);
}

.navbar {
  top: env(safe-area-inset-top, 0px);
}

main {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
}

.mobile-menu {
  top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
}

/* ===========================
   SCROLL — custom thin scrollbar
=========================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(139,124,199,0.3);
  border-radius: 4px;
}

/* ===========================
   UTILITY
=========================== */
/* Prevent text select on tap */
.hero-badge,
.product-tag,
.product-badge,
.stat-label,
.section-label {
  -webkit-user-select: none;
  user-select: none;
}

/* Focus visible for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--purple-mid);
  outline-offset: 3px;
  border-radius: 6px;
}
.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.6rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
}