:root {
  --bg: #05060a;
  --text: #e8eaf2;
  --muted: #8a8fa3;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-1: #7c7bff;
  --accent-2: #22d3ee;
  --accent-3: #e879f9;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

::selection {
  background: rgba(124, 123, 255, 0.4);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

a:focus-visible {
  outline: 2px solid rgba(140, 140, 255, 0.8);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- */
/* Layer 1 — aurora gradient blobs                                    */
/* ---------------------------------------------------------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora-blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  mix-blend-mode: screen;
  opacity: 0.45;
  animation: drift 26s ease-in-out infinite alternate;
}

.blob-1 {
  background: radial-gradient(circle at 30% 30%, rgba(124, 123, 255, 0.55), transparent 60%);
  top: -20vmax;
  left: -10vmax;
}
.blob-2 {
  background: radial-gradient(circle at 60% 40%, rgba(34, 211, 238, 0.4), transparent 60%);
  top: 10vmax;
  right: -20vmax;
  animation-delay: -8s;
  animation-duration: 32s;
}
.blob-3 {
  background: radial-gradient(circle at 50% 60%, rgba(232, 121, 249, 0.35), transparent 60%);
  bottom: -25vmax;
  left: 20vmax;
  animation-delay: -16s;
  animation-duration: 38s;
}
.blob-4 {
  background: radial-gradient(circle at 70% 20%, rgba(52, 211, 153, 0.25), transparent 60%);
  top: 40vmax;
  left: -15vmax;
  animation-delay: -4s;
  animation-duration: 44s;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(6vmax, -4vmax, 0) scale(1.15); }
  100% { transform: translate3d(-4vmax, 6vmax, 0) scale(0.95); }
}

/* ---------------------------------------------------------------- */
/* Layer 2 — starfield                                                */
/* ---------------------------------------------------------------- */
#stars {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------------------------------------------------------------- */
/* Layer 4 — mouse spotlight                                          */
/* ---------------------------------------------------------------- */
#page-spotlight {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: radial-gradient(700px circle at var(--sx, 50%) var(--sy, 30%),
    rgba(140, 140, 255, 0.09), transparent 60%);
  mix-blend-mode: screen;
}

/* ---------------------------------------------------------------- */
/* Content                                                           */
/* ---------------------------------------------------------------- */
main {
  position: relative;
  z-index: 2;
}

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

#hero-threads {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-copy {
  max-width: 34rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.02;
  font-weight: 700;
}

.grad {
  background: linear-gradient(100deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  color: var(--muted);
  max-width: 34ch;
  margin-top: 1.4rem;
  font-size: 1.05rem;
}

.hero-meta {
  margin-top: 2rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: rgba(232, 234, 242, 0.55);
}

.prism-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: clamp(320px, 42vw, 540px);
  justify-self: end;
}

.prism-wrap canvas {
  position: absolute;
  inset: 0;
  /* Soft-fade the canvas rim so any residual glow blends into the page
     instead of hard-clipping into a visible square. The pyramid sits well
     inside the opaque centre, so it is unaffected. */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 62%, transparent 96%);
  mask-image: radial-gradient(circle at 50% 50%, #000 62%, transparent 96%);
}

.scroll-hint {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 2;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ---------------------------------------------------------------- */
/* Cards                                                             */
/* ---------------------------------------------------------------- */
.cards {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 4rem 8rem;
}

.section-head {
  margin-bottom: 2.5rem;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 600;
}

.section-head p {
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.section-head code {
  background: rgba(255, 255, 255, 0.07);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.85em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  padding: 1.4rem 1.5rem 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.15s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 40px rgba(124, 123, 255, 0.15);
}

/* per-card spotlight that follows the mouse */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%),
    rgba(124, 123, 255, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

/* shine sweep on hover */
.card .shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-160%) skewX(-12deg);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.card:hover .shine {
  transform: translateX(320%) skewX(-12deg);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transform: translateZ(24px);
}

.card-fav {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.card-fav img {
  width: 20px;
  height: 20px;
}

.card-head {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-name {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
}

.card-domain {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-desc {
  color: rgba(232, 234, 242, 0.75);
  font-size: 0.92rem;
  transform: translateZ(18px);
}

.card-arrow {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  color: var(--muted);
  font-size: 1.1rem;
  transition: transform 0.3s ease, color 0.3s ease;
}

.card:hover .card-arrow {
  transform: translate(3px, -3px);
  color: #fff;
}

/* ---------------------------------------------------------------- */
/* Footer                                                            */
/* ---------------------------------------------------------------- */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2.5rem 1rem 4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- */
/* Responsive & reduced motion                                       */
/* ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero {
    padding: 5rem 1.5rem 3rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .prism-wrap {
    order: -1;
    justify-self: center;
    max-width: 100%;
    height: 300px;
  }

  .cards {
    padding: 4rem 1.5rem 5rem;
  }
}

@media (max-height: 720px) {
  .hero {
    padding-top: 4rem;
  }

  .prism-wrap {
    height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .aurora-blob {
    animation: none;
  }

  .scroll-hint {
    animation: none;
  }

  .card,
  .card::before,
  .card .shine {
    transition: none;
  }

  .card .shine {
    display: none;
  }

  #page-spotlight {
    display: none;
  }
}
