/* ═══════════════════════════════════════════════════
   maatriks.ai — Visual Identity
   Inspired by: maatriks.ai brand system + mobile app theme
   ═══════════════════════════════════════════════════ */

/* ─── TOKENS ─────────────────────────────────────── */
:root {
  --black: #050505;
  --black-2: #0a0a0a;
  --black-3: #0C0C10;
  --black-4: #12121A;
  --black-5: #1A1A24;
  --black-6: #222230;
  --amber: #E8A838;
  --amber-bright: #FF8A1F;
  --amber-warm: #FFB347;
  --amber-dim: rgba(232,168,56,0.12);
  --amber-glow: rgba(232,168,56,0.4);
  --amber-glow-strong: rgba(255,138,31,0.34);
  --white: #F2F2F7;
  --muted: #8E8E9A;
  --muted-2: #4A4A5A;
  --success: #34C759;
  --error: #FF453A;
  --border: rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.04);

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

  --max-width: 1200px;
  --page-pad: 60px;
  --page-pad-mobile: 24px;

  --motion-fast: 160ms;
  --motion-base: 220ms;
  --motion-slow: 320ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── ENGINEERING DOT GRID ───────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(242,242,247,0.06) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* ─── TYPOGRAPHY ─────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--white);
}

h1 {
  font-size: clamp(42px, 6vw, 80px);
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(24px, 3vw, 36px);
  margin-bottom: 16px;
}

h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

p:last-child {
  margin-bottom: 0;
}

p.lead {
  color: rgba(242,242,247,0.8);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
}

strong {
  color: var(--white);
  font-weight: 600;
}

/* ─── LINKS ──────────────────────────────────────── */
a {
  color: var(--amber);
  text-decoration: none;
  transition: color var(--motion-base) ease;
  cursor: pointer;
}

a:hover {
  color: var(--amber-warm);
}

a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ─── LAYOUT ─────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  width: 100%;
}

.main {
  flex: 1;
  padding: 120px 0 80px;
}

/* ─── NAV ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 var(--page-pad);
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(5,5,5,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

.nav-logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  transition: opacity var(--motion-fast) ease;
}

.nav-logo:hover {
  color: var(--white);
  opacity: 0.8;
}

.nav-logo span {
  color: var(--amber);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-mono);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--amber);
  transition: width var(--motion-base) ease;
}

.nav-links a:hover {
  color: var(--amber);
}

.nav-links a:hover::after {
  width: 100%;
}

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

.nav-links a.active::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
  transition: all var(--motion-base) ease;
}

/* ─── HERO ───────────────────────────────────────── */
.hero {
  padding: 180px 0 100px;
  position: relative;
  overflow: hidden;
}

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

.hero .section-label {
  margin-bottom: 28px;
}

.hero h1 {
  margin-bottom: 24px;
  position: relative;
}

/* Gradient text accent */
.hero h1 .accent {
  background: linear-gradient(135deg, var(--amber-bright), var(--amber-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p.lead {
  max-width: 560px;
  margin-bottom: 48px;
}

/* Ambient glow orb — hero */
.hero::after {
  content: '';
  position: absolute;
  top: 20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(232,168,56,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

/* ─── MARQUEE STRIP ──────────────────────────────── */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: relative;
  background: var(--black-2);
}

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

.marquee-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.marquee-item .dot {
  width: 4px;
  height: 4px;
  background: var(--amber);
  flex-shrink: 0;
}

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

/* ─── SECTION ────────────────────────────────────── */
.section {
  padding: 80px 0;
  position: relative;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--amber);
  flex-shrink: 0;
}

/* Glowing divider — from mobile app separator style */
.section-divider {
  width: 100%;
  height: 1px;
  background: var(--amber);
  margin: 80px 0;
  opacity: 0.2;
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  inset: -3px 0;
  background: var(--amber);
  opacity: 0.15;
  filter: blur(6px);
}

/* ─── DIAGONAL LINE PATTERN ──────────────────────── */
.lines-bg {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 24px,
    rgba(232,168,56,0.03) 24px,
    rgba(232,168,56,0.03) 25px
  );
  pointer-events: none;
}

/* ─── CARD ───────────────────────────────────────── */
.card {
  background: var(--black-4);
  border: 1px solid var(--border);
  padding: 28px 28px 28px 32px;
  position: relative;
  overflow: hidden;
  transition: all var(--motion-base) ease;
  border-left: 3px solid var(--amber);
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232,168,56,0.03) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-base) ease;
}

.card:hover {
  border-color: rgba(255,255,255,0.12);
  background: var(--black-5);
}

.card:hover::after {
  opacity: 1;
}

.card h3 {
  font-size: 14px;
  letter-spacing: 0.05em;
}

.card p {
  font-size: 14px;
  line-height: 1.7;
}

/* ─── BUTTONS ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: all var(--motion-base) ease;
  text-decoration: none;
  position: relative;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber-bright), var(--amber));
  color: #050505;
}

.btn-primary:hover {
  color: #050505;
  box-shadow: 0 0 24px rgba(232,168,56,0.3), 0 0 60px rgba(232,168,56,0.1);
}

.btn-outline {
  background: transparent;
  color: var(--amber);
  border: 1.5px solid var(--amber);
}

.btn-outline:hover {
  background: var(--amber-dim);
  color: var(--amber);
  box-shadow: 0 0 20px rgba(232,168,56,0.15);
}

.btn-ghost {
  background: var(--black-5);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--black-6);
  color: var(--white);
  border-color: rgba(255,255,255,0.12);
}

.btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ─── FOOTER ─────────────────────────────────────── */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  position: relative;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.footer-brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
  font-family: var(--font-mono);
  transition: color var(--motion-fast) ease;
}

.footer-links a:hover {
  color: var(--amber);
}

.footer-copy {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 16px;
}

/* ─── CONTENT PAGE STYLES ────────────────────────── */
.content-page .main {
  padding: 140px 0 80px;
}

.content-page h1 {
  font-size: clamp(28px, 4vw, 48px);
  margin-bottom: 8px;
}

.content-page .page-meta {
  font-size: 12px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  margin-bottom: 48px;
  letter-spacing: 0.05em;
}

.content-body {
  max-width: 720px;
}

.content-body h2 {
  font-size: 20px;
  margin-top: 48px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-body h2::before {
  content: '';
  width: 3px;
  height: 20px;
  background: var(--amber);
  flex-shrink: 0;
}

.content-body h3 {
  font-size: 16px;
  margin-top: 32px;
  margin-bottom: 12px;
}

.content-body p {
  margin-bottom: 16px;
}

.content-body ul,
.content-body ol {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 16px;
  padding-left: 24px;
}

.content-body li {
  margin-bottom: 8px;
}

.content-body li::marker {
  color: var(--amber);
}

.content-body .email-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--black-4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  padding: 14px 20px;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--amber);
  transition: all var(--motion-base) ease;
}

.content-body .email-link:hover {
  background: var(--black-5);
  border-color: rgba(255,255,255,0.12);
  border-left-color: var(--amber);
  color: var(--amber-warm);
  box-shadow: 0 0 20px rgba(232,168,56,0.1);
}

/* ─── AUTH HANDOFF PAGES ─────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}

.auth-card {
  background: var(--black-4);
  border: 1px solid var(--border);
  padding: 48px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  border-top: 2px solid var(--amber);
}

.auth-card h1 {
  font-size: 24px;
  margin-bottom: 16px;
}

.auth-card p {
  margin-bottom: 24px;
}

.auth-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--black-6);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

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

.auth-status {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-success .auth-status {
  color: var(--success);
}

.auth-error .auth-status {
  color: var(--error);
}

.auth-fallback {
  display: none;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.auth-fallback.visible {
  display: block;
}

.auth-fallback h3 {
  font-size: 14px;
  margin-bottom: 12px;
}

.auth-fallback ol {
  color: var(--muted);
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.8;
}

/* ─── STORE BADGES ───────────────────────────────── */
.store-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.store-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--black-4);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all var(--motion-base) ease;
}

.store-links a:hover {
  border-color: var(--amber);
  color: var(--white);
  background: var(--black-5);
  box-shadow: 0 0 20px rgba(232,168,56,0.1);
}

.store-links svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ─── QUICK LINKS GRID ───────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  background: var(--black-4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--motion-base) ease;
}

.quick-link:hover {
  border-color: rgba(255,255,255,0.12);
  border-left-color: var(--amber-bright);
  color: var(--white);
  background: var(--black-5);
  box-shadow: 0 0 20px rgba(232,168,56,0.08);
}

.quick-link svg {
  width: 18px;
  height: 18px;
  color: var(--amber);
  flex-shrink: 0;
}

/* ─── FEATURES GRID ──────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  margin-top: 48px;
}

.feature {
  background: var(--black-3);
  padding: 40px 32px;
  position: relative;
  transition: background var(--motion-base) ease;
}

.feature:hover {
  background: var(--black-4);
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--amber);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature h3 {
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.feature p {
  font-size: 14px;
  line-height: 1.7;
}

/* ─── STAT COUNTER ───────────────────────────────── */
.stat-strip {
  display: flex;
  gap: 2px;
  background: var(--border);
  margin-top: 2px;
}

.stat {
  flex: 1;
  background: var(--black-3);
  padding: 32px;
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--amber);
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 0 30px rgba(232,168,56,0.25);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--font-mono);
}

/* ─── SCROLL REVEAL ANIMATIONS ───────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ─── FLOATING GLOW ANIMATIONS ───────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.3; }
}

/* Ambient glow orb */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(232,168,56,0.1) 0%, transparent 70%);
}

.glow-orb-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -100px;
  animation: float 10s ease-in-out infinite;
}

.glow-orb-2 {
  width: 400px;
  height: 400px;
  bottom: -50px;
  left: -100px;
  animation: float 12s ease-in-out infinite 2s;
}

/* ─── REDUCED MOTION ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .marquee-track {
    animation: none;
  }
}

/* ─── RESPONSIVE ─────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --page-pad: 40px;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-strip {
    flex-wrap: wrap;
  }

  .stat {
    flex: 1 1 calc(50% - 1px);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --page-pad: var(--page-pad-mobile);
  }

  body::before {
    background-size: 20px 20px;
  }

  .nav {
    padding: 0 var(--page-pad-mobile);
    height: 56px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(5,5,5,0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 130px 0 60px;
  }

  .hero::after {
    width: 300px;
    height: 300px;
    top: 10%;
    right: -20%;
  }

  .section {
    padding: 48px 0;
  }

  .main {
    padding: 100px 0 60px;
  }

  .content-page .main {
    padding: 110px 0 60px;
  }

  .card {
    padding: 22px 22px 22px 26px;
  }

  .auth-card {
    padding: 32px 24px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 16px;
  }

  .section-divider {
    margin: 48px 0;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .stat-strip {
    flex-direction: column;
  }

  .stat {
    flex: 1 1 100%;
  }

  .feature {
    padding: 28px 24px;
  }

  .marquee-item {
    font-size: 11px;
    gap: 18px;
    padding: 0 18px;
  }
}

/* Small mobile */
@media (max-width: 375px) {
  h1 {
    font-size: 32px;
  }

  .store-links {
    flex-direction: column;
  }

  .store-links a {
    justify-content: center;
  }
}
