/* ==========================================================================
   Apexillion — Design System
   ========================================================================== */

@font-face {
  font-family: 'Space Grotesk';
  src: local('Space Grotesk');
}

:root {
  --bg: #06070c;
  --bg-alt: #0b0d16;
  --bg-raise: #10131f;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --text: #f4f5f8;
  --text-dim: #9aa0b2;
  --text-faint: #5b6072;
  --teal: #4ff2d6;
  --teal-dim: #2ba892;
  --purple: #9a6bff;
  --purple-dim: #6b4bb0;
  --gradient-accent: linear-gradient(135deg, var(--teal), var(--purple));
  --radius: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.16,.84,.44,1);
  --container: 1240px;
}

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

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: default;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

::selection { background: var(--teal); color: #06070c; }

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

/* Smooth scroll wrapper (JS-driven) */
#smooth-wrapper {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
#smooth-content {
  will-change: transform;
}
body.no-smooth #smooth-wrapper { position: static; overflow: visible; }

/* film grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Custom cursor ===== */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 300;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot {
  width: 7px; height: 7px;
  background: var(--teal);
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,0.35);
  transition: width .25s var(--ease), height .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.cursor-ring.is-active {
  width: 64px; height: 64px;
  border-color: var(--teal);
  background: rgba(79, 242, 214, 0.08);
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ===== Buttons ===== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
}
.btn span { position: relative; z-index: 2; }
.btn-primary {
  background: var(--text);
  color: #06070c;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-accent);
  transform: translateY(101%);
  transition: transform .45s var(--ease);
  z-index: 1;
}
.btn-primary:hover::before { transform: translateY(0); }
.btn-primary:hover { color: #06070c; }
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.btn-ghost:hover { border-color: var(--teal); background: rgba(79,242,214,0.06); }
.btn-nav {
  padding: 11px 22px;
  font-size: 13px;
  border: 1px solid var(--line-strong);
  background: transparent;
}
.btn-nav:hover { border-color: var(--teal); background: rgba(79,242,214,0.06); }

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 0;
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6,7,12,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.nav-logo-mark {
  color: var(--teal);
  font-size: 20px;
  text-shadow: 0 0 18px rgba(79,242,214,0.7);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-left: auto;
  margin-right: 34px;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-dim);
  position: relative;
  transition: color .25s var(--ease);
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -5px;
  width: 0; height: 1px;
  background: var(--teal);
  transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none;
}
.nav-burger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--text);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-mobile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
  background: rgba(6,7,12,0.96);
}
.nav-mobile.open { max-height: 400px; }
.nav-mobile a {
  padding: 16px 32px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--text-dim);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 90px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.5;
  transform: scale(1.08);
  z-index: 0;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 2;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(6,7,12,0.92) 0%, rgba(6,7,12,0.68) 38%, rgba(6,7,12,0.22) 62%, rgba(6,7,12,0.05) 100%),
    linear-gradient(180deg, rgba(6,7,12,0.12) 0%, rgba(6,7,12,0.4) 72%, var(--bg) 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 26px;
}
.hero-title {
  font-size: clamp(48px, 8.5vw, 118px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 34px;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line span { display: block; }
.accent-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 560px;
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 42px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-scroll {
  position: absolute;
  bottom: 40px; left: 32px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero-scroll-line {
  width: 1px; height: 46px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}
.hero-scroll-line i {
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--teal);
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { top: -100%; }
  50% { top: 0; }
  100% { top: 100%; }
}

/* HUD data chips — echoes the tracking-overlay look from the product photography,
   floating near the 3D tracked-object scene rather than generic decoration. */
.hero-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.hud-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid rgba(79, 242, 214, 0.3);
  background: rgba(6, 7, 12, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--teal);
  white-space: nowrap;
  animation: hudFloat 6s ease-in-out infinite;
}
.hud-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px 1px rgba(79, 242, 214, 0.8);
  flex-shrink: 0;
}
.hud-chip-1 { top: 20%; right: 9%; animation-delay: 0s; }
.hud-chip-2 { top: 50%; right: 4%; animation-delay: 1.4s; color: var(--purple); }
.hud-chip-3 { top: 74%; right: 13%; animation-delay: 2.8s; }
.hud-chip-2 .hud-dot { background: var(--purple); box-shadow: 0 0 8px 1px rgba(154, 107, 255, 0.8); }

@keyframes hudFloat {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-10px); opacity: 1; }
}

@media (max-width: 900px) {
  .hero-hud { display: none; }
}

/* ===== Marquee ===== */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 22px 0;
  background: var(--bg-alt);
}
.marquee-track {
  display: flex;
  gap: 28px;
  white-space: nowrap;
  width: max-content;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  will-change: transform;
  animation: marquee 26s linear infinite;
}
.marquee-track span:nth-child(odd) { color: var(--text-dim); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== Section basics ===== */
section { position: relative; }
.kicker {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 18px;
}
.section-title {
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 900px;
}
.section-lead {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 640px;
  margin-top: 22px;
}

/* ===== About ===== */
.about { padding: 160px 0 120px; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 46px;
  padding-top: 46px;
  border-top: 1px solid var(--line);
}
.about-lead { font-size: 24px; line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; }
.about-details p { color: var(--text-dim); font-size: 16px; margin-bottom: 24px; }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
}
.link-arrow i { transition: transform .3s var(--ease); font-style: normal; }
.link-arrow:hover i { transform: translateX(6px); color: var(--teal); }

/* ===== Stats ===== */
.stats {
  padding: 90px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.stat { display: flex; flex-direction: column; gap: 10px; }
.stat-number {
  font-size: clamp(38px, 4.4vw, 58px);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { font-size: 14px; color: var(--text-dim); max-width: 220px; }

/* ===== Solutions ===== */
.solutions { padding: 160px 0 120px; overflow: hidden; }
.solutions-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.16;
}
.solutions-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(6,7,12,0.85) 40%, var(--bg) 100%);
}
.solutions .container { position: relative; z-index: 2; }
.solution-list {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.solution-card {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 48px;
  align-items: center;
  background: var(--bg-alt);
  padding: 40px;
  transform-style: preserve-3d;
  transition: background .3s var(--ease);
}
.solution-card:hover { background: var(--bg-raise); }
.solution-media {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 1px solid var(--line);
}
.solution-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.solution-card:hover .solution-media img { transform: scale(1.06); }
.solution-index {
  font-size: 13px;
  color: var(--teal);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.solution-body h3 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 10px 0 14px;
}
.solution-body p { color: var(--text-dim); font-size: 16px; max-width: 560px; }

/* ===== Technology ===== */
.tech { padding: 120px 0; border-top: 1px solid var(--line); }
.tech-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 70px; }
.tech-left { position: sticky; top: 140px; align-self: start; }
.tech-list { display: flex; flex-direction: column; }
.tech-item {
  display: flex;
  gap: 26px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.tech-item:first-child { border-top: 1px solid var(--line); }
.tech-num { font-size: 14px; color: var(--text-faint); font-weight: 600; padding-top: 4px; }
.tech-item h4 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.tech-item p { color: var(--text-dim); font-size: 15px; max-width: 480px; }

/* ===== Sports ===== */
.sports { padding: 120px 0; background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sports-chips { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 46px; }
.sports-chips span {
  padding: 13px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  font-size: 14px;
  color: var(--text-dim);
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.sports-chips span:hover { border-color: var(--teal); color: var(--text); }
.sports-focus {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.focus-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
.focus-tags { display: flex; gap: 12px; flex-wrap: wrap; }
.focus-tags span {
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  background: var(--gradient-accent);
  color: #06070c;
}

/* ===== Team ===== */
.team { padding: 120px 0; }
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 56px; }
.team-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 44px;
  transform-style: preserve-3d;
  transition: border-color .3s var(--ease);
}
.team-card:hover { border-color: var(--line-strong); }
.team-card-top { margin-bottom: 30px; }
.team-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #06070c;
  font-weight: 700;
  font-size: 18px;
}
.team-card h3 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.team-role { color: var(--teal); font-size: 14px; margin-bottom: 18px; }
.team-bio { color: var(--text-dim); font-size: 15px; }

/* ===== Contact ===== */
.contact { padding: 140px 0 100px; border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 70px; }
.contact-info { margin-top: 40px; display: flex; flex-direction: column; gap: 10px; }
.contact-info a { font-size: 20px; font-weight: 600; }
.contact-info a:hover { color: var(--teal); }
.contact-info span { color: var(--text-dim); font-size: 15px; }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form label { display: flex; flex-direction: column; gap: 10px; }
.contact-form label span { font-size: 13px; color: var(--text-dim); }
.contact-form input, .contact-form textarea {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
  resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--bg-raise);
}
.contact-form button { align-self: flex-start; margin-top: 6px; border: none; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-status { font-size: 14px; color: var(--text-dim); min-height: 20px; }
.form-status.success { color: var(--teal); }
.form-status.error { color: #ff6b7a; }

/* ===== Footer ===== */
.footer { padding: 50px 0; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.footer-links { display: flex; gap: 26px; }
.footer-links a { font-size: 14px; color: var(--text-dim); }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 13px; color: var(--text-faint); }

/* ===== Reveal animation base states (JS toggles .is-visible) ===== */
.reveal-up { opacity: 0; transform: translateY(28px); }
.reveal-up.is-visible { opacity: 1; transform: translateY(0); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal-line span { transform: translateY(110%); display: inline-block; }
.reveal-line.is-visible span { transform: translateY(0); transition: transform .9s var(--ease); }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .btn-nav { display: none; }
  .nav-burger { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .solution-card { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr; gap: 40px; }
  .tech-left { position: static; }
  .team-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 50px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { padding: 0 20px; }
  .hero-content { padding: 0 20px; }
  .about, .solutions, .tech, .sports, .team, .contact { padding: 90px 0; }
  .solution-card { padding: 24px; }
  .team-card { padding: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up, .reveal-line span { transition: none !important; opacity: 1 !important; transform: none !important; }
}
