/* ============================================
   KEEPR DIGITAL — "Digital Arcana" Theme
   ============================================ */

/* --- Design Tokens --- */
:root {
  --bg-deep: #0a0a0f;
  --bg-surface: #12121a;
  --bg-card: #1a1a25;
  --text-primary: #e8e8f0;
  --text-muted: #8888a0;
  --cyan: #00f0ff;
  --holo: linear-gradient(135deg, #00f0ff, #00c8ff, #00f0ff);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 12px;
  --radius-sm: 8px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- Grain Overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* --- Utility: Holo Text --- */
.holo-text {
  color: var(--cyan);
  -webkit-text-fill-color: var(--cyan);
}

.accent {
  color: var(--cyan);
}

/* --- Section Titles --- */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 560px;
  margin: 0 auto 3.5rem;
  line-height: 1.7;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: background 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__logo {
  height: 32px;
  width: auto;
}

.nav__wordmark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.nav__links a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.3s;
  letter-spacing: 0.01em;
}

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

.nav__cta {
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 100px;
  color: var(--cyan) !important;
  transition: all 0.3s var(--ease-out) !important;
}

.nav__cta:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 6rem clamp(1.25rem, 4vw, 2.5rem) 4rem;
  max-width: 1200px;
  margin: 0 auto;
  overflow: visible;
}

.hero__glow {
  position: absolute;
  top: 50%;
  right: 15%;
  width: 500px;
  height: 500px;
  transform: translate(20%, -50%);
  background: radial-gradient(circle, rgba(0, 240, 255, 0.1) 0%, rgba(0, 200, 255, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero__content {
  flex: 1;
  max-width: 580px;
  z-index: 1;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

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

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 2rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
  letter-spacing: 0.01em;
}

.btn--primary {
  background: var(--holo);
  color: #0a0a0f;
  background-size: 200% 200%;
  animation: holoShift 4s ease infinite;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.3), 0 4px 15px rgba(0, 200, 255, 0.15);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
}

@keyframes holoShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* --- Hero Card --- */
.hero__card-wrap {
  flex-shrink: 0;
  z-index: 1;
  perspective: 800px;
  animation: cardFloat 6s ease-in-out infinite;
}

.hero__card {
  width: clamp(200px, 22vw, 280px);
  aspect-ratio: 240 / 340;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.5s var(--ease-out);
}

.hero__card.tilting {
  transition: none;
}

.hero__card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(0, 240, 255, 0.08);
}

/* Holo gradient overlay */
.hero__card-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--holo);
  background-size: 300% 300%;
  animation: holoShift 4s ease infinite;
  mix-blend-mode: color-dodge;
  opacity: 0.12;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
}

/* Specular highlight (mouse-tracked) */
.hero__card-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle 180px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.18) 0%,
    transparent 70%
  );
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
}

.hero__card:hover .hero__card-inner::after,
.hero__card.active .hero__card-inner::after {
  opacity: 1;
}

.hero__card-art {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.hero__card-art svg {
  width: 100%;
  height: 100%;
}

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

/* ============================================
   STREAMS
   ============================================ */
.streams {
  padding: clamp(5rem, 10vw, 8rem) 0;
  position: relative;
}

.streams__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stream-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stream-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--holo);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

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

.stream-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 240, 255, 0.1);
}

.stream-card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
}

.stream-card__icon svg {
  width: 100%;
  height: 100%;
}

.stream-card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

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

/* ============================================
   ABOUT
   ============================================ */
.about {
  padding: clamp(5rem, 10vw, 8rem) 0;
  position: relative;
}

.about__divider {
  width: 120px;
  height: 2px;
  margin: 0 auto 3.5rem;
  background: var(--holo);
  border-radius: 2px;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.about__col {
  text-align: center;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.about__number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.2;
  line-height: 1;
  margin-bottom: 1rem;
}

.about__col h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.about__col p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 320px;
  margin: 0 auto;
}

/* ============================================
   CTA
   ============================================ */
.cta {
  padding: clamp(5rem, 10vw, 8rem) 0;
}

.cta__inner {
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem);
  background: var(--bg-surface);
  border-radius: clamp(16px, 2vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

.cta__inner::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: var(--holo);
  opacity: 0.5;
}

.cta__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.cta__sub {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.cta__actions {
  margin-bottom: 2.5rem;
}


/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

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

.footer__brand .nav__wordmark {
  font-size: 1.1rem;
}

.footer__tagline {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}


.footer__legal {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__legal a {
  color: var(--text-muted);
  transition: color 0.3s;
}

.footer__legal a:hover {
  color: var(--cyan);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

/* stagger delays for grid children */
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

/* ============================================
   PAGE LOAD STAGGER
   ============================================ */
.stagger-1, .stagger-2, .stagger-3, .stagger-4 {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

body.loaded .stagger-1 { opacity: 1; transform: none; transition-delay: 0s; }
body.loaded .stagger-2 { opacity: 1; transform: none; transition-delay: 0.15s; }
body.loaded .stagger-3 { opacity: 1; transform: none; transition-delay: 0.3s; }
body.loaded .stagger-4 { opacity: 1; transform: none; transition-delay: 0.45s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .streams__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 7rem;
    gap: 3rem;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__glow {
    right: 50%;
    transform: translate(50%, -50%);
    width: 350px;
    height: 350px;
  }

  .hero__card {
    width: 200px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__legal {
    text-align: center;
  }

  .nav__links {
    gap: 1rem;
  }
}

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

  .hero__card {
    width: 180px;
  }

  .nav__links li:not(:last-child) {
    display: none;
  }

  .btn--lg {
    width: 100%;
  }
}

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

  .reveal { opacity: 1; transform: none; }
  .stagger-1, .stagger-2, .stagger-3, .stagger-4 { opacity: 1; transform: none; }
}
