:root {
  --bg: #07070d;
  --bg-soft: #0c0c16;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #eef0f8;
  --muted: #9aa0b8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-3: #f472b6;
  --grad: linear-gradient(120deg, #22d3ee, #a78bfa 55%, #f472b6);
  --radius: 20px;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-head: "Space Grotesk", "Inter", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

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

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(167, 139, 250, 0.35);
}

/* ---------- Background decoration ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  z-index: -1;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.5;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}

.bg-glow-1 {
  top: -220px;
  left: -140px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.45), transparent 70%);
}

.bg-glow-2 {
  top: 30%;
  right: -200px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.4), transparent 70%);
  animation-delay: -9s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 60px) scale(1.15); }
}

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  text-align: center;
}

.loader-logo {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 1.2rem;
}

.loader-logo span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.loader-bar {
  width: 180px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: var(--grad);
  animation: load 1.1s ease-in-out infinite;
}

@keyframes load {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 2rem;
  backdrop-filter: blur(14px);
  background: rgba(7, 7, 13, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav.scrolled {
  background: rgba(7, 7, 13, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad);
  color: #07070d;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(167, 139, 250, 0.4);
}

.brand-name span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  position: relative;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transition: width 0.25s ease;
}

.nav-link:hover {
  color: var(--text);
}

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

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav { padding: 0.9rem 1.25rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.btn-primary {
  background: var(--grad);
  color: #07070d;
  box-shadow: 0 10px 34px rgba(167, 139, 250, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(167, 139, 250, 0.5);
}

.btn-ghost {
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.1);
  transform: translateY(-2px);
}

.arr {
  transition: transform 0.25s ease;
}

.btn:hover .arr {
  transform: translateX(4px);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.1rem;
  border-radius: 99px;
  border: 1px solid var(--card-border);
  background: var(--card);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.8rem;
  backdrop-filter: blur(8px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.hero-sub {
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  margin-bottom: 2.4rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 3.5rem;
}

.hero-stats {
  display: flex;
  gap: clamp(1.5rem, 6vw, 4rem);
  padding: 1.6rem 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(10px);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat strong {
  font-family: var(--font-head);
  font-size: 1.8rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat span {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Section headings ---------- */
.section-head,
.section-title {
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-sub {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Categories grid ---------- */
.categories {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.6rem;
  margin-top: 3rem;
}

.card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--bg-soft);
  transform-style: preserve-3d;
  will-change: transform;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.65, 0.25, 1), filter 0.4s ease;
  filter: saturate(0.9);
}

.card:hover .card-media img {
  transform: scale(1.08);
  filter: saturate(1.15);
}

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(7, 7, 13, 0.98) 0%, rgba(7, 7, 13, 0.82) 35%, rgba(7, 7, 13, 0.35) 70%, transparent 100%),
    linear-gradient(to bottom, rgba(7, 7, 13, 0.55) 0%, transparent 35%);
}

.card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem;
  transform: translateZ(30px);
}

.card-index {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  background: rgba(7, 7, 13, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--c) 32%, rgba(7, 7, 13, 0.9));
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 2px 10px rgba(7, 7, 13, 0.5);
  margin-bottom: 0.7rem;
}

.card h3 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 12px rgba(7, 7, 13, 0.9);
}

.card p {
  color: #c4c9dd;
  font-size: 0.9rem;
  text-shadow: 0 1px 8px rgba(7, 7, 13, 0.95);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.card-footer .count {
  color: var(--muted);
  font-weight: 400;
}

.card-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover .card-arrow {
  background: var(--grad);
  color: #07070d;
  transform: rotate(-45deg);
}

/* ---------- About ---------- */
.about {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.about-card {
  text-align: center;
  padding: 3.5rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(10px);
}

.about-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  border-radius: 16px;
  background: var(--grad);
  color: #07070d;
  box-shadow: 0 12px 34px rgba(167, 139, 250, 0.4);
}

.about-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
  margin-top: 2.2rem;
}

.feature {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.1rem;
  border-radius: 99px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  color: var(--muted);
}

.f-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 12px var(--c);
}

/* ---------- Contact ---------- */
.contact {
  text-align: center;
  padding: 2rem 1.5rem 6rem;
}

.contact .btn {
  margin-top: 1.6rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--card-border);
  background: rgba(7, 7, 13, 0.6);
  padding: 2.5rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.footer-brand span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-note {
  font-size: 0.78rem;
  opacity: 0.7;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.65, 0.25, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.card {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.65, 0.25, 1);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal,
  .card {
    opacity: 1;
    transform: none;
  }
}