/* ============================================================
   TRK Studios — Main Stylesheet
   ============================================================ */

/* ------------------------------------------------------------
   1. Design Tokens
   ------------------------------------------------------------ */
:root {
  --bg-root:       #06091a;
  --bg-surface:    #0a0f22;
  --bg-card:       #0f1630;
  --bg-card-hover: #162040;
  --border:        rgba(255, 255, 255, 0.07);
  --border-accent: rgba(0, 200, 255, 0.28);

  /* Brand colors extracted from TRK_Logo.png */
  --accent:        #00c8ff;
  --accent-navy:   #0d2060;
  --gradient:      linear-gradient(135deg, #1c5aff 0%, #00c8ff 100%);
  /* Decorative full-range gradient (navy→cyan, matches logo mark) */
  --gradient-brand: linear-gradient(135deg, #0d2060 0%, #00c8ff 100%);

  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;

  --shadow:      0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px rgba(0, 212, 255, 0.08);

  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #33ddff; }

/* ------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-secondary-custom { color: var(--text-secondary); }
.text-muted-custom     { color: var(--text-muted); }
.font-mono             { font-family: var(--font-mono); }

/* ------------------------------------------------------------
   4. Layout
   ------------------------------------------------------------ */
.container-custom {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 56px;
}

.section-header { margin-bottom: 56px; }
.section-header.centered { text-align: center; }
.section-header.centered .section-subtitle { margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------
   5. Navbar
   ------------------------------------------------------------ */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(5, 8, 15, 0.8);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background var(--transition), box-shadow var(--transition);
}

#site-nav.scrolled {
  background: rgba(5, 8, 15, 0.95);
  box-shadow: 0 1px 40px rgba(0, 0, 0, 0.6);
}

.nav-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
}

.nav-logo .logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.nav-links a.active { color: var(--accent); }

.nav-cta {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--accent) !important;
  border: 1px solid var(--border-accent) !important;
  border-radius: var(--radius-sm) !important;
}

.nav-cta:hover {
  background: rgba(0, 212, 255, 0.1) !important;
  color: var(--accent) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Mobile nav */
@media (max-width: 767px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 15, 0.98);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 32px 24px;
    gap: 4px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open { transform: translateX(0); }

  .nav-links a {
    font-size: 1.1rem;
    padding: 12px 16px;
    width: 100%;
  }
}

/* ------------------------------------------------------------
   6. Buttons
   ------------------------------------------------------------ */
.btn-primary-custom,
.btn-outline-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary-custom {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.btn-primary-custom:hover {
  color: #fff;
  box-shadow: 0 0 32px rgba(0, 212, 255, 0.35);
  transform: translateY(-1px);
}

.btn-outline-custom {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline-custom:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------
   7. Hero Section
   ------------------------------------------------------------ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px; /* navbar height */
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,  rgba(0, 200, 255, 0.07) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 80% 60%, rgba(28, 90, 255, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center top, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center top, black 0%, transparent 70%);
  pointer-events: none;
}

/* Split-column layout wrapping both content and logo card */
.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  width: 100%;
}

.hero-content {
  /* max-width removed — constrained by grid column */
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* White card that hosts the logo PNG cleanly on the dark bg */
.hero-logo-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 100px rgba(0, 200, 255, 0.1);
}

.hero-logo-card img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-visual {
    order: -1; /* logo above headline on mobile */
  }
  .hero-logo-card {
    max-width: 260px;
    padding: 28px;
    border-radius: 20px;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 40px;
  line-height: 1.7;
}

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

.hero-scroll {
  margin-top: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hero-scroll-line {
  width: 48px;
  height: 1px;
  background: var(--border);
}

/* ------------------------------------------------------------
   8. Divider
   ------------------------------------------------------------ */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 24px;
}

/* ------------------------------------------------------------
   9. Alt surface sections
   ------------------------------------------------------------ */
.section-surface {
  background: var(--bg-surface);
  position: relative;
}

.section-surface::before,
.section-surface::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 30%, var(--border) 70%, transparent);
}

/* ------------------------------------------------------------
   10. Footer
   ------------------------------------------------------------ */
#site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand .nav-logo {
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li + li { margin-top: 10px; }

.footer-col ul a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-col ul a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

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

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

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

@media (max-width: 767px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------
   11. Page Headers (inner pages)
   ------------------------------------------------------------ */
.page-header {
  padding: 140px 0 80px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -20%, rgba(0, 212, 255, 0.05) 0%, transparent 60%);
}

.page-header .section-label { margin-bottom: 16px; }
.page-header h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
.page-header p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-top: 16px;
}

/* ------------------------------------------------------------
   12. Scroll-fade animation
   ------------------------------------------------------------ */
.observe {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Stagger siblings inside a grid */
.grid-2 .observe:nth-child(2),
.grid-3 .observe:nth-child(2) { transition-delay: 0.08s; }
.grid-2 .observe:nth-child(3),
.grid-3 .observe:nth-child(3) { transition-delay: 0.16s; }
.grid-3 .observe:nth-child(4) { transition-delay: 0.24s; }

/* Don't animate if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .observe { opacity: 1; transform: none; transition: none; }
}

/* ------------------------------------------------------------
   13. Utilities
   ------------------------------------------------------------ */
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-2  { margin-bottom: 8px; }
.mb-4  { margin-bottom: 16px; }

.flex       { display: flex; }
.flex-wrap  { flex-wrap: wrap; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
.gap-4      { gap: 16px; }
.items-center { align-items: center; }

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

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

@media (max-width: 1023px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 639px) {
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .page-header { padding: 120px 0 56px; }
}
