/* ================================================
   ALTER8IGHT — DESIGN TOKENS
================================================ */
:root {
  --bg:        #0a0a0c;
  --bg-alt:    #0e0e11;
  --surface:   #141417;
  --surface-2: #1a1a1f;
  --line:      rgba(255,255,255,0.09);
  --line-soft: rgba(255,255,255,0.05);

  --text:       #f4f4f6;
  --text-muted: #96969f;
  --text-dim:   #6c6c76;

  --pink:   #e91e8c;
  --blue:   #29abe2;
  --green:  #2ecc71;
  --purple: #9b59b6;
  --red:    #e5484d;

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1180px;
}

/* ================================================
   RESET
================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ================================================
   BACKGROUND LAYERS
================================================ */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ================================================
   LOADER
================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease);
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-mark img {
  border-radius: 50%;
  animation: loaderPulse 1.8s ease-in-out infinite;
}
@keyframes loaderPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.loader-bar-track {
  width: 200px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--blue), var(--green), var(--purple), var(--red));
  border-radius: 2px;
}
.loader-pct {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ================================================
   NAV
================================================ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(10,10,12,0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.nav-logo { width: 30px; height: 30px; border-radius: 50%; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14.5px;
  color: var(--text-muted);
}
.nav-links a { transition: color 0.25s var(--ease); }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }

.nav-cta {
  color: var(--bg) !important;
  background: var(--text);
  padding: 9px 18px;
  border-radius: 100px;
  font-weight: 500;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-cta:hover { transform: translateY(-1px); background: #fff; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 11px; right: 11px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 19.5px; }
.nav-toggle span:nth-child(3) { top: 24px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--blue), var(--green), var(--purple), var(--red));
  z-index: 101;
}

/* ================================================
   SECTIONS — SHARED
================================================ */
.section {
  position: relative;
  z-index: 2;
  padding: 160px 0;
}
.two-col {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  max-width: 640px;
  margin-bottom: 22px;
}

.lead {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 520px;
}
.lead-narrow { max-width: 480px; margin-bottom: 48px; }

/* ================================================
   HERO
================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0 0;
  background: transparent;
}
.hero-inner {
  text-align: center;
  max-width: 780px;
  padding: 0 24px;
}
.hero-kicker {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 26px;
  letter-spacing: 0.01em;
}
.hero-title {
  font-size: clamp(38px, 7vw, 76px);
  margin-bottom: 26px;
}
.reveal-line { display: block; overflow: hidden; }
.reveal-line span {
  display: block;
  transform: translateY(115%);
}
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 40px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.reveal-fade { opacity: 0; }

.hero-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.hint-line { width: 1px; height: 34px; background: var(--line); overflow: hidden; }
.hint-line i {
  display: block;
  width: 100%; height: 10px;
  background: var(--text-muted);
  animation: hintDrop 2s ease-in-out infinite;
}
@keyframes hintDrop {
  0%   { transform: translateY(-10px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(34px); opacity: 0; }
}

/* ================================================
   BUTTONS
================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.35s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: #fff; }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); }
.btn-large { padding: 17px 34px; font-size: 16px; }

/* ================================================
   ABOUT
================================================ */
.about {
  background: var(--bg-alt);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.about-grid {
  display: flex;
  gap: 56px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.about-fact { display: flex; flex-direction: column; gap: 6px; }
.fact-number {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
}
.fact-label { font-size: 13.5px; color: var(--text-dim); max-width: 160px; }

/* ================================================
   FEATURES
================================================ */
.features { background: var(--bg); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 20px;
}
.feature-card {
  background: var(--surface);
  padding: 40px 32px;
  transition: background 0.4s var(--ease);
  cursor: default;
}
.feature-card:hover, .feature-card:focus-visible {
  background: var(--surface-2);
}
.feature-icon {
  width: 38px; height: 38px;
  margin-bottom: 26px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  position: relative;
}
.feature-icon::before {
  content: '';
  position: absolute;
  inset: 11px;
  border-radius: 3px;
  background: var(--text-muted);
  transition: background 0.3s var(--ease);
}
.feature-card:hover .feature-icon::before { background: var(--pink); }
.feature-card:nth-child(2):hover .feature-icon::before { background: var(--blue); }
.feature-card:nth-child(3):hover .feature-icon::before { background: var(--green); }
.feature-card:nth-child(4):hover .feature-icon::before { background: var(--purple); }
.feature-card:nth-child(5):hover .feature-icon::before { background: var(--red); }
.feature-card:nth-child(6):hover .feature-icon::before { background: var(--pink); }

.feature-card h3 { font-size: 19px; margin-bottom: 10px; }
.feature-card p { font-size: 14.5px; color: var(--text-muted); max-width: 300px; }

/* ================================================
   3D EXPERIENCE
================================================ */
.experience {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: transparent;
}
.experience-inner { max-width: 560px; }
.experience-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(8px);
}
.drag-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  position: relative;
}
.drag-icon::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* ================================================
   TECHNOLOGY
================================================ */
.technology { background: var(--bg-alt); border-top: 1px solid var(--line-soft); }
.tech-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.tech-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 32px;
  font-size: 15px;
  color: var(--text);
}
.tech-list li { display: flex; align-items: center; gap: 12px; }
.tech-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c);
  flex-shrink: 0;
}

/* ================================================
   STATISTICS
================================================ */
.statistics { background: var(--bg); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
}
.stat-label { font-size: 13.5px; color: var(--text-dim); }

/* ================================================
   SHOWCASE
================================================ */
.showcase { background: var(--bg-alt); border-top: 1px solid var(--line-soft); }
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}
.showcase-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
}
.showcase-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.2); }
.showcase-media {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--surface-2), var(--bg));
  position: relative;
  overflow: hidden;
}
.showcase-media::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.5;
}
.showcase-media-1::after { background: radial-gradient(circle at 30% 30%, var(--pink), transparent 60%); }
.showcase-media-2::after { background: radial-gradient(circle at 70% 40%, var(--blue), transparent 60%); }
.showcase-media-3::after { background: radial-gradient(circle at 50% 70%, var(--green), transparent 60%); }
.showcase-meta { padding: 24px; }
.showcase-tag {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: none;
}
.showcase-meta h3 { font-size: 19px; margin: 8px 0 8px; }
.showcase-meta p { font-size: 14px; color: var(--text-muted); }

/* ================================================
   CTA
================================================ */
.cta {
  background: transparent;
  min-height: 70vh;
  display: flex;
  align-items: center;
}
.cta-inner { text-align: center; max-width: 620px; margin: 0 auto; }
.cta-title { font-size: clamp(30px, 5vw, 52px); margin-bottom: 22px; }
.cta .lead { margin: 0 auto 36px; }

/* ================================================
   FOOTER
================================================ */
.site-footer {
  position: relative;
  z-index: 2;
  background: var(--bg-alt);
  border-top: 1px solid var(--line-soft);
  padding: 72px 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
}
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-logo { width: 36px; height: 36px; border-radius: 50%; }
.footer-brand p { font-size: 14px; color: var(--text-dim); }
.footer-col h4 {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 16px;
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 14.5px; color: var(--text-muted); transition: color 0.25s var(--ease); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ================================================
   MAGNETIC BUTTON HELPER
================================================ */
.magnetic { will-change: transform; }

/* ================================================
   GENERIC SCROLL REVEAL (progressive text-in)
================================================ */
.reveal-init {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal-init.reveal-in { opacity: 1; transform: none; }

/* ================================================
   NO-WEBGL FALLBACK
================================================ */
body.no-webgl #scene { display: none; }
body.no-webgl {
  background: radial-gradient(ellipse 60% 40% at 50% 0%, #1c1c24, transparent),
              var(--bg);
}

/* ================================================
   TOUCH — dedicated drag area for the 3D piece
================================================ */
.experience { touch-action: none; }


/* ================================================
   RESPONSIVE
================================================ */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .showcase-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .container { padding: 0 22px; }
  .section { padding: 110px 0; }

  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: rgba(10,10,12,0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 32px;
    gap: 26px;
    font-size: 18px;
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
    border-left: 1px solid var(--line);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-cta { margin-top: 8px; }
  .nav-toggle { display: block; }

  .feature-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .about-grid { gap: 32px; }
}
