/* ============================================
   TrailScope — Premium Landing Page
   Design tokens & layout
   ============================================ */

:root {
  --bg-primary: #050505;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 255, 102, 0.25);
  --text-primary: #f0f0f0;
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent: #00ff66;
  --accent-dim: rgba(0, 255, 102, 0.15);
  --accent-glow: rgba(0, 255, 102, 0.4);
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --nav-height: 72px;
  --container-max: 1280px;
  --section-padding: clamp(80px, 12vh, 160px);
  --transition: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: auto;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

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

@media (pointer: coarse) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.container {
  width: min(var(--container-max), calc(100% - 48px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-padding);
}

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

/* ---- Background layers ---- */

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(0, 255, 102, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 255, 102, 0.04) 0%, transparent 50%),
    var(--bg-primary);
  transition: background 1.2s var(--transition);
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px;
}

.spotlight {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 102, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

.particles-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.4;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), rgba(0, 255, 102, 0.5));
  z-index: 10001;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ---- Loader ---- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: var(--bg-primary);
  transition: opacity 0.8s var(--transition), visibility 0.8s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  position: relative;
}

.loader-ring-inner {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: var(--accent);
  animation: spin 1.5s linear infinite reverse;
}

.loader-text {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--text-muted);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Cursor ---- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--transition), width 0.2s, height 0.2s;
}

.cursor-ring {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: transform 0.35s var(--transition), width 0.3s, height 0.3s, opacity 0.3s;
  opacity: 0.6;
}

.cursor.hover .cursor-dot {
  width: 4px;
  height: 4px;
}

.cursor.hover .cursor-ring {
  width: 56px;
  height: 56px;
  opacity: 1;
}

/* ---- Navigation ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(24px, 4vw, 48px);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(5, 5, 5, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  transition: transform 0.4s var(--transition), background 0.4s;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-mark {
  color: var(--accent);
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .nav-links .nav-link { display: none; }
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: all 0.35s var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 30px var(--accent-dim);
}

.btn-primary:hover {
  box-shadow: 0 0 50px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-nav {
  padding: 10px 20px;
  font-size: 0.8125rem;
  background: var(--accent-dim);
  border-color: var(--border-glow);
  color: var(--accent);
}

.btn-large {
  padding: 18px 40px;
  font-size: 1rem;
}

/* ---- Glass Card ---- */

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color 0.4s var(--transition), box-shadow 0.4s var(--transition), transform 0.4s var(--transition);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 40px var(--accent-dim), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---- Hero ---- */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-height);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 255, 102, 0.12) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  flex: 1;
}

@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.hero-eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 40px;
}

@media (max-width: 968px) {
  .hero-sub { margin-inline: auto; }
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 968px) {
  .hero-cta { justify-content: center; }
}

.hero-visual{
  position:absolute;
  right:-8%;
  top:50%;
  transform:translateY(-50%);
  width:800px;
  height:800px;
  z-index:1;
}

.hero-content{
  position:relative;
  z-index:5;
}

.hero-visual spline-viewer {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 2;
}

.spline-glow {
  position: absolute;
  inset: 10%;
  background: radial-gradient(circle, rgba(0, 255, 102, 0.2) 0%, transparent 65%);
  filter: blur(40px);
  animation: pulse-glow 4s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.spline-canvas {
  width: 100%;
  height: 100%;
  outline: none;
}

.hero-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: 32px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ---- About ---- */

.about {
  overflow: hidden;
}

.about-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 102, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 102, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent);
  animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
  to { background-position: 60px 60px; }
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: center;
}

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

.display-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.about-card {
  padding: clamp(32px, 4vw, 48px);
}

.about-card-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.about-card p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.about-card em {
  color: var(--text-primary);
  font-style: normal;
}

.about-stats {
  display: flex;
  gap: 40px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.about-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.about-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---- Section headers ---- */

.section-header {
  margin-bottom: clamp(48px, 6vw, 80px);
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Features ---- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.feature-card {
  padding: 40px 32px;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 24px;
  transition: transform 0.5s var(--transition);
}

.feature-card:hover .feature-icon {
  transform: rotate(15deg) scale(1.1);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---- Showcase ---- */

.showcase-pin {
  overflow: hidden;
}

.showcase-track {
  display: flex;
  gap: 32px;
  padding-inline: clamp(24px, calc((100vw - var(--container-max)) / 2 + 24px), calc((100vw - var(--container-max)) / 2 + 24px));
  will-change: transform;
}

.showcase-card {
  flex: 0 0 clamp(320px, 40vw, 480px);
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: border-color 0.4s;
}

.showcase-card:hover {
  border-color: var(--border-glow);
}

.showcase-card-image {
  aspect-ratio: 3/2;
  overflow: hidden;
}

.showcase-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--transition);
}

.showcase-card:hover .showcase-card-image img {
  transform: scale(1.08);
}

.showcase-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to top, rgba(5, 5, 5, 0.95), transparent);
  font-family: var(--font-display);
  font-weight: 600;
}

.showcase-card-num {
  color: var(--accent);
  font-size: 0.875rem;
}

/* ---- Metrics ---- */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  text-align: center;
}

@media (max-width: 640px) {
  .metrics-grid { grid-template-columns: 1fr; gap: 32px; }
}

.metric-number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 0.9375rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ---- Spline Section ---- */

.spline-section {
  overflow: hidden;
}

.spline-section-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(0, 255, 102, 0.08) 0%, transparent 60%);
  filter: blur(60px);
}

.spline-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

@media (max-width: 968px) {
  .spline-section-grid { grid-template-columns: 1fr; }
}

.spline-section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 24px 0 32px;
  max-width: 420px;
}

.spline-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spline-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.spline-features .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.spline-section-visual {
  height: clamp(300px, 45vh, 500px);
  position: relative;
}

/* ---- Testimonials ---- */

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.testimonial-card {
  padding: 32px;
  transform-style: preserve-3d;
}

.testimonial-card p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.testimonial-author {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
}

.testimonial-role {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---- CTA ---- */

.cta {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0, 255, 102, 0.1) 0%, transparent 70%);
  animation: cta-pulse 6s ease-in-out infinite;
}

@keyframes cta-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
}

/* ---- Footer ---- */

.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-socials {
  display: flex;
  gap: 20px;
}

.social-link {
  color: var(--text-muted);
  transition: color 0.3s, transform 0.3s var(--transition);
}

.social-link:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

/* ---- Text mask ---- */

.line-mask {
  display: block;
  overflow: hidden;
}

.line {
  display: block;
}

.metric-number {
  white-space: nowrap;
  font-size: clamp(2rem, 4vw, 5rem);
}

.hero {
  position: relative;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 10;   /* text on top */
}

.hero-visual {
  position: absolute;
  top: 50%;
  right: -1%;   /* was -10% */
  transform: translateY(-50%);
  width: 900px;
  height: 900px;
  z-index: 0;
  pointer-events: none;
}
