:root {
  --bg: #05060f;
  --fg: #eef1ff;
  --muted: #9aa3c7;
  --card: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.09);
  --a1: #7c9cff;
  --a2: #d77cff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { color-scheme: dark; }

/* Hide the scrollbar on desktop (page still scrolls by wheel, trackpad and keys).
   Touch devices keep their native overlay scrollbar. */
@media (hover: hover) and (pointer: fine) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { display: none; }
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- background layers ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

.aurora { position: fixed; inset: 0; z-index: 0; filter: blur(90px); opacity: 0.55; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 26s var(--ease) infinite alternate; }
.aurora span:nth-child(1) { width: 46vw; height: 46vw; left: -10vw; top: -14vw; background: #2a3dff55; }
.aurora span:nth-child(2) { width: 38vw; height: 38vw; right: -8vw; top: 10vh; background: #b33dff44; animation-duration: 32s; }
.aurora span:nth-child(3) { width: 40vw; height: 40vw; left: 30vw; bottom: -20vw; background: #00c6ff33; animation-duration: 38s; }
@keyframes drift {
  to { transform: translate3d(6vw, 4vh, 0) scale(1.15); }
}

.cursor-glow {
  position: fixed; z-index: 1; width: 520px; height: 520px; left: 0; top: 0;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(124, 156, 255, 0.12), transparent 60%);
  transform: translate3d(-999px, -999px, 0);
  transition: opacity 0.4s;
}

header, main, footer { position: relative; z-index: 2; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(80px, 16vh, 160px) 16px 56px; }

.eyebrow {
  font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted);
}

.title {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: clamp(48px, 11vw, 132px); line-height: 1; letter-spacing: -0.04em;
  margin: 18px 0 20px;
}
.title .word { display: inline-block; opacity: 0; transform: translateY(40px) rotateX(-60deg); filter: blur(10px); }
.title .accent {
  background: linear-gradient(100deg, var(--a1), var(--a2), var(--a1));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: -200% 0; } }

body.ready .title .word {
  opacity: 1; transform: none; filter: none;
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease), filter 1.2s var(--ease);
}
body.ready .title .word:nth-child(2) { transition-delay: 0.15s; }

.subtitle { color: var(--muted); font-size: clamp(16px, 2vw, 19px); font-weight: 300; }

.reveal { opacity: 0; transform: translateY(16px); }
body.ready .reveal { opacity: 1; transform: none; transition: opacity 1s var(--ease) 0.5s, transform 1s var(--ease) 0.5s; }

/* ---------- grid & cards ---------- */
.grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  max-width: 1160px; margin: 0 auto; padding: 0 16px 120px;
  perspective: 1200px;
}

.card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --hue: 220;
  position: relative; display: block; aspect-ratio: 4 / 5;
  border-radius: 24px; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s;
  opacity: 0; translate: 0 40px;
  outline: none;
}
.card.in { opacity: 1; translate: 0 0; transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s, opacity 1s var(--ease), translate 1s var(--ease); }
.card:hover, .card:focus-visible {
  border-color: hsla(var(--hue), 90%, 70%, 0.45);
  box-shadow: 0 30px 80px -20px hsla(var(--hue), 90%, 55%, 0.45);
}
.card.tracking { transition: transform 0.12s linear, box-shadow 0.5s var(--ease), border-color 0.5s, opacity 1s, translate 1s; }

/* animated gradient border */
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: 3;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 70%, hsl(var(--hue) 95% 72%), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.5s; animation: spin 4s linear infinite;
  pointer-events: none;
}
.card:hover::before, .card:focus-visible::before { opacity: 1; }
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --angle: 360deg; } }

/* glare that follows the pointer */
.card::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.18), transparent 45%);
  opacity: 0; transition: opacity 0.4s;
}
.card:hover::after { opacity: 1; }

.cover { position: absolute; inset: 0; transition: transform 1.2s var(--ease), filter 0.8s var(--ease); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover canvas { width: 100%; height: 100%; display: block; }
.card:hover .cover, .card:focus-visible .cover { transform: scale(1.08); filter: brightness(0.55) saturate(1.2); }

.glyph {
  position: absolute; left: 50%; top: 42%; z-index: 1;
  font-size: 96px; line-height: 1; color: #fff;
  transform: translate(-50%, -50%) translateZ(60px);
  text-shadow: 0 10px 40px hsla(var(--hue), 90%, 60%, 0.8);
  transition: transform 0.8s var(--ease), opacity 0.6s;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { translate: 0 -10px; } }
.card:hover .glyph, .card:focus-visible .glyph { transform: translate(-50%, -90%) translateZ(60px) scale(0.7); opacity: 0.85; }

.info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 24px;
  background: linear-gradient(to top, rgba(5, 6, 15, 0.92), rgba(5, 6, 15, 0.5) 70%, transparent);
  transform: translateZ(40px);
}
.info h2 { font-family: "Space Grotesk", sans-serif; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.info .tagline { color: var(--muted); font-size: 14px; margin-top: 4px; }

.more {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows 0.6s var(--ease), opacity 0.5s var(--ease);
}
.more > div { overflow: hidden; }
.card:hover .more, .card:focus-visible .more { grid-template-rows: 1fr; opacity: 1; }
.more p { font-size: 14.5px; line-height: 1.6; color: #d6dbf5; margin-top: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags span {
  font-size: 11px; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 99px;
  background: hsla(var(--hue), 80%, 60%, 0.16); border: 1px solid hsla(var(--hue), 80%, 70%, 0.3);
}
.open {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 13px; font-weight: 600; color: hsl(var(--hue) 95% 80%);
}
.open i { font-style: normal; transition: transform 0.4s var(--ease); }
.card:hover .open i { transform: translateX(6px); }

/* placeholder card */
.card.soon { cursor: default; display: grid; place-items: center; text-align: center; border-style: dashed; }
.card.soon .info { position: static; background: none; transform: none; }
.card.soon .plus { font-size: 44px; color: var(--muted); font-weight: 300; animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; transform: scale(0.9); } }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 48px; }

/* Desktop / tablet: fit everything in one viewport, no scrolling.
   Sizes scale with viewport height so hero + cards + footer always fit. */
@media (min-width: 720px) and (min-height: 560px) {
  body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  .hero { padding: 7vh 16px 4vh; flex: none; }
  .title { font-size: clamp(48px, min(11vw, 13vh), 132px); margin: 1.5vh 0 1.8vh; }
  main { flex: 1; min-height: 0; display: flex; align-items: center; }
  .grid {
    display: flex; flex-wrap: wrap; justify-content: center; align-content: center;
    gap: 28px; width: 100%; padding: 0 16px; max-height: 100%;
  }
  .card { height: min(52vh, 500px); width: auto; aspect-ratio: 4 / 5; flex: none; }
  .glyph { font-size: min(96px, 10vh); }
  footer { flex: none; padding: 2.5vh 16px 3vh; }
}

/* touch devices: show details without hover */
@media (hover: none) {
  .more { grid-template-rows: 1fr; opacity: 1; }
  .card .glyph { top: 32%; }
  .cursor-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
