:root {
  color-scheme: dark;
  --bg-primary: #050508;
  --bg-secondary: #0d0d12;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --accent: #6366f1;
  --accent-bright: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-secondary: #22d3ee;
  --border: #1f1f2e;
  --border-bright: #2a2a40;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  --radius: 20px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

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

/* Background gradient atmosphere */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(34, 211, 238, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px 60px;
}

/* ============================================
   HEADER / HERO CARD (matching ta.traxlabs.org)
   ============================================ */

.hero {
  margin-bottom: 80px;
  animation: slideDown 0.8s ease-out;
}

.hero-card {
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

.traxlabs-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.traxlabs-text h1 {
  margin: 0 0 4px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.traxlabs-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
}

/* ============================================
   INTRO SECTION
   ============================================ */

.intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 120px;
  min-height: 400px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.7rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--accent);
}

.intro-headline {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 24px;
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 500px;
  line-height: 1.7;
}

/* Orbit visual */
.intro-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.orbit-container {
  position: relative;
  width: 320px;
  height: 320px;
  transition: transform 0.3s ease-out;
}

.orbit {
  position: absolute;
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.orbit-1 {
  width: 100%;
  height: 100%;
  animation: rotate 30s linear infinite;
}

.orbit-1::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 20px var(--accent-glow);
}

.orbit-2 {
  width: 70%;
  height: 70%;
  animation: rotate 20s linear infinite reverse;
}

.orbit-2::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-secondary);
  border-radius: 50%;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.5);
}

.orbit-3 {
  width: 40%;
  height: 40%;
  animation: rotate 15s linear infinite;
}

.orbit-3::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent-bright);
  border-radius: 50%;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--accent-glow);
}

.core-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

/* ============================================
   SERVICES SECTION
   ============================================ */

.services {
  margin-bottom: 120px;
}

.section-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  margin: 0 0 48px;
  color: var(--text-primary);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(30px);
}

.service-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.service-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.service-icon svg {
  width: 24px;
  height: 24px;
  stroke: white;
}

.service-card h4 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.service-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

.projects {
  margin-bottom: 120px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: block;
  opacity: 0;
  transform: translateY(30px);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

.project-featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-color: var(--border-bright);
}

.project-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-badge.coming-soon {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.project-card:has(.project-badge:not(.coming-soon):not([class*="Live"])) .project-badge {
  background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
}

.project-content h4 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-content p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Clickable project cards */
a.project-card.project-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.project-card.project-link:hover {
  border-color: var(--accent-secondary);
  box-shadow: 0 20px 40px rgba(34, 211, 238, 0.15);
}

a.project-card.project-link .project-badge {
  background: linear-gradient(135deg, var(--accent-secondary) 0%, #06b6d4 100%);
}

.project-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  margin-left: 4px;
}

a.project-card.project-link:hover .project-arrow {
  transform: translateX(4px);
}

/* ============================================
   TECH STACK MARQUEE
   ============================================ */

.tech-stack {
  margin-bottom: 120px;
  overflow: hidden;
}

.tech-marquee {
  margin-top: 32px;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.tech-track {
  display: flex;
  gap: 24px;
  animation: marquee 30s linear infinite;
  width: max-content;
}

.tech-item {
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.3s ease;
}

.tech-item:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================
   CONTACT CTA
   ============================================ */

.contact-cta {
  margin-bottom: 80px;
}

.cta-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 60px 48px;
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.cta-card h3 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-primary);
}

.cta-card p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

/* ============================================
   CONTACT MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(165deg, var(--bg-card) 0%, #0a0a12 100%);
  border: 1px solid var(--border-bright);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 
    0 0 0 1px rgba(99, 102, 241, 0.1),
    0 25px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 100px -50px var(--accent-glow);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.modal-close:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-header {
  text-align: center;
  margin-bottom: 32px;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  border-radius: 16px;
  animation: float 3s ease-in-out infinite;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
  stroke: white;
}

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

.modal-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Form Fields */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.form-field .optional {
  color: var(--text-secondary);
  font-weight: 400;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.form-field input:hover,
.form-field textarea:hover {
  border-color: var(--border-bright);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 0 20px rgba(99, 102, 241, 0.05);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

/* Submit Button */
.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent-secondary) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.submit-btn:hover::before {
  opacity: 1;
}

.btn-text,
.btn-icon {
  position: relative;
  z-index: 1;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon svg {
  transform: translate(3px, -3px);
}

/* Modal Footer */
.modal-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.modal-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-footer a {
  color: var(--accent-bright);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.modal-footer a:hover {
  color: var(--accent-secondary);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .modal-overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .modal-container {
    padding: 32px 24px;
    border-radius: 24px 24px 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-form-grid {
    grid-template-columns: 1fr;
  }

  .modal-header h2 {
    font-size: 1.5rem;
  }

  .modal-icon {
    width: 56px;
    height: 56px;
  }

  .modal-icon svg {
    width: 28px;
    height: 28px;
  }
}

/* ============================================
   FOOTER
   ============================================ */

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

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-powered {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-powered strong {
  color: var(--accent-bright);
  font-weight: 600;
}

.footer-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .intro-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .intro-visual {
    order: -1;
  }

  .orbit-container {
    width: 260px;
    height: 260px;
  }

  .project-featured {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 24px 20px 48px;
  }

  .hero {
    margin-bottom: 60px;
  }

  .hero-card {
    padding: 20px 24px;
    gap: 16px;
  }

  .traxlabs-logo {
    width: 44px;
    height: 44px;
  }

  .intro {
    margin-bottom: 80px;
    min-height: auto;
  }

  .orbit-container {
    width: 200px;
    height: 200px;
  }

  .services,
  .projects,
  .tech-stack {
    margin-bottom: 80px;
  }

  .section-title {
    margin-bottom: 32px;
  }

  .service-card,
  .project-card {
    padding: 24px 20px;
  }

  .cta-card {
    padding: 40px 24px;
  }

  .services-grid,
  .projects-grid {
    gap: 16px;
  }
}

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

