/* TM Takeoff — site styles */

/* ─── FONTS (self-hosted, SIL Open Font License) ─────────────────────────── */
@font-face{font-family:'Inter';src:url('../fonts/inter-latin-400-normal.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:'Inter';src:url('../fonts/inter-latin-500-normal.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap;}
@font-face{font-family:'Inter';src:url('../fonts/inter-latin-600-normal.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap;}
@font-face{font-family:'Inter';src:url('../fonts/inter-latin-400-italic.woff2') format('woff2');font-weight:400;font-style:italic;font-display:swap;}
@font-face{font-family:'IBM Plex Sans';src:url('../fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap;}
@font-face{font-family:'IBM Plex Sans';src:url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap;}
@font-face{font-family:'IBM Plex Sans';src:url('../fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap;}
@font-face{font-family:'IBM Plex Mono';src:url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:'IBM Plex Mono';src:url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap;}
@font-face{font-family:'IBM Plex Mono';src:url('../fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap;}
/* ─── DESIGN TOKENS ──────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --bg:         #16141f;
  --surface:    #1e1b2e;
  --surface2:   #252235;
  --border:     rgba(255,255,255,0.08);
  --border2:    rgba(255,255,255,0.13);
  --purple:     #7c3aed;
  --purple-dk:  #5b21b6;
  --purple-lt:  #a78bfa;
  --green:      #34d399;
  --amber:      #fbbf24;
  --blue:       #60a5fa;
  --teal:       #2dd4bf;
  --red:        #f87171;
  --text:       #e2dff0;
  --muted:      #7b7599;
  --hint:       #3d3758;

  /* Typography */
  --font-sans:  'Inter', sans-serif;
  --font-mono:  'IBM Plex Mono', monospace;
  --font-display: 'IBM Plex Sans', 'Inter', sans-serif;

  /* Spacing */
  --section-py: 96px;
  --container:  1200px;
  --radius:     10px;
  --radius-lg:  16px;
}

body.light-mode {
  --bg:        #f4f3fa;
  --surface:   #ffffff;
  --surface2:  #eeeaf8;
  --border:    rgba(0,0,0,0.08);
  --border2:   rgba(0,0,0,0.14);
  --teal:      #0d9488;
  --green:     #059669;
  --amber:     #d97706;
  --blue:      #2563eb;
  --red:       #dc2626;
  --text:      #1e0a5c;
  --muted:     #6b5fa8;
  --hint:      #c4b8f5;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--teal); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.8; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ─── TYPOGRAPHY ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
p  { color: var(--muted); line-height: 1.75; }

.mono { font-family: var(--font-mono); }
.teal { color: var(--teal); }
.amber { color: var(--amber); }
.purple-lt { color: var(--purple-lt); }
.green { color: var(--green); }

/* ─── LAYOUT ──────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: var(--section-py) 0; }
.section-sm { padding: 64px 0; }

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

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr; }
  :root { --section-py: 64px; }
}

/* ─── COMPONENTS ──────────────────────────────────────────────────────────── */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 15px;
  padding: 13px 28px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s; border: none; text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal), #0d9488);
  color: #fff;
  box-shadow: 0 4px 20px rgba(45,212,191,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(45,212,191,0.4);
  opacity: 1;
}
.btn-purple {
  background: linear-gradient(135deg, var(--purple), var(--purple-dk));
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.3);
}
.btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.4);
  opacity: 1;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface2); opacity: 1; }
.btn-sm { font-size: 13px; padding: 9px 18px; }
.btn-lg { font-size: 17px; padding: 16px 36px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover {
  border-color: rgba(45,212,191,0.3);
  transform: translateY(-3px);
}
.card-accent-teal   { border-left: 3px solid var(--teal); }
.card-accent-purple { border-left: 3px solid var(--purple-lt); }
.card-accent-amber  { border-left: 3px solid var(--amber); }
.card-accent-green  { border-left: 3px solid var(--green); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 4px 12px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.8px;
}
.badge-teal   { background: rgba(45,212,191,0.12);  color: var(--teal);      border: 1px solid rgba(45,212,191,0.25); }
.badge-purple { background: rgba(167,139,250,0.12); color: var(--purple-lt); border: 1px solid rgba(167,139,250,0.25); }
.badge-amber  { background: rgba(251,191,36,0.12);  color: var(--amber);     border: 1px solid rgba(251,191,36,0.25); }
.badge-green  { background: rgba(52,211,153,0.12);  color: var(--green);     border: 1px solid rgba(52,211,153,0.25); }

/* Section Label */
.section-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px; color: var(--teal);
  margin-bottom: 12px; display: block;
}
.section-title { margin-bottom: 16px; }
.section-sub { font-size: 18px; color: var(--muted); max-width: 600px; line-height: 1.7; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 0; }

/* ─── HEADER / NAV ─────────────────────────────────────────────────────────── */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(22,20,31,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}
body.light-mode #site-header {
  background: rgba(244,243,250,0.9);
}
#site-header.scrolled {
  background: rgba(22,20,31,0.95);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-brand-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dk));
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
}
.nav-brand-mark svg { width: 20px; height: 20px; }
.nav-brand-name {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: #f0eeff; letter-spacing: -0.3px;
}
body.light-mode .nav-brand-name { color: var(--purple-dk); }
.nav-menu { display: flex; align-items: center; gap: 6px; }
.nav-menu a {
  font-size: 14px; font-weight: 500; color: var(--muted);
  padding: 7px 14px; border-radius: 6px; transition: all 0.15s;
  text-decoration: none;
}
.nav-menu a:hover { color: var(--text); background: var(--surface2); opacity: 1; }
.nav-menu a.active { color: var(--teal); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.theme-toggle-btn:hover { border-color: var(--teal); }
.theme-toggle-btn svg { width: 16px; height: 16px; }
.icon-dark { display: block; } .icon-light { display: none; }
body.light-mode .icon-dark { display: none; } body.light-mode .icon-light { display: block; }

/* Mobile Nav */
.nav-hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.nav-hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }

@media (max-width: 900px) {
  .nav-menu { display: none; position: fixed; top: 70px; left: 0; right: 0; bottom: 0; background: var(--surface); flex-direction: column; align-items: flex-start; padding: 20px; gap: 4px; z-index: 999; }
  .nav-menu.open { display: flex; }
  .nav-menu a { width: 100%; font-size: 18px; padding: 12px 16px; }
  .nav-hamburger { display: flex; }
}

/* ─── FOOTER ──────────────────────────────────────────────────────────────── */
#site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 48px;
}
.footer-brand-name {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: #f0eeff; margin-bottom: 10px;
}
.footer-brand-desc { font-size: 13px; color: var(--muted); line-height: 1.7; max-width: 260px; margin-bottom: 20px; }
.footer-col-title { font-size: 11px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-mono); margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 13px; color: var(--muted); transition: color 0.15s; text-decoration: none; }
.footer-links a:hover { color: var(--teal); opacity: 1; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: 12px; font-family: var(--font-mono); color: var(--hint); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 12px; font-family: var(--font-mono); color: var(--hint); text-decoration: none; transition: color 0.15s; }
.footer-legal a:hover { color: var(--muted); opacity: 1; }

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

/* ─── GLOBAL BG ELEMENTS ──────────────────────────────────────────────────── */
.bg-grid {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(124,58,237,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.bg-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); pointer-events: none;
}
.bg-orb-purple { background: rgba(124,58,237,0.15); }
.bg-orb-teal   { background: rgba(45,212,191,0.08); }

/* ─── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}
@keyframes float {
  0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); }
}
.animate-fade-up { animation: fadeUp 0.6s ease forwards; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }


/* ─── STATIC-SITE LAYOUT FIXES ───────────────────────────────────────────── */
/* Hero: keep the headline clear of the pipeline panel on desktop */
@media (min-width: 1200px) {
  .hero > .container { width: 100%; }
  .hero-content { max-width: min(760px, 54%); }
  .hero-visual  { width: 42%; }
}
/* How It Works: two columns on desktop, one on tablet/phone */
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
@media (max-width: 900px) { .how-grid { grid-template-columns: 1fr; gap: 32px; } }
/* Header: drop the secondary button on phones so the bar fits */
@media (max-width: 600px) {
  .nav-right .btn-ghost { display: none; }
  .nav-right { gap: 8px; }
}

/* ─── CRM FORM PLUGIN (contact.html) ─────────────────────────────────────── */
.tm-crm-form { min-height: 220px; }
.crm-form-status {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 220px; text-align: center;
  font-size: 13px; font-family: var(--font-mono); color: var(--muted);
}
.crm-form-fallback {
  flex-direction: column; line-height: 1.7; padding: 24px;
  background: rgba(251,191,36,0.06); border: 1px solid rgba(251,191,36,0.2); border-radius: 10px;
}
.crm-form-fallback a { color: var(--teal); font-weight: 600; }
.crm-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border2); border-top-color: var(--teal);
  animation: crm-spin 0.8s linear infinite;
}
@keyframes crm-spin { to { transform: rotate(360deg); } }

/* ─── TOUCH TARGETS (phones & tablets) ───────────────────────────────────── */
@media (max-width: 900px) {
  .nav-hamburger { width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center; }
}
@media (max-width: 600px) {
  .theme-toggle-btn { width: 42px; height: 42px; }
  .nav-right .btn-sm { min-height: 42px; padding: 10px 14px; }
}
@media (max-width: 360px) {
  .nav-brand-name { font-size: 16px; }
  .nav-right { gap: 6px; }
  .nav-right .btn-sm { padding: 10px 12px; }
}

/* Mobile menu: the header's blur makes it the menu's containing block,
   so give the panel an explicit height instead of top/bottom stretching */
@media (max-width: 900px) {
  .nav-menu {
    top: 70px; bottom: auto;
    height: calc(100vh - 70px); height: calc(100dvh - 70px);
    overflow-y: auto; border-top: 1px solid var(--border);
  }
  body.light-mode .nav-menu { background: #f4f3fa; }
}
/* Brand name never wraps */
.nav-brand-name { white-space: nowrap; }
/* Very small phones: drop the theme toggle so logo, Sign In and menu fit */
@media (max-width: 360px) {
  .theme-toggle-btn { display: none; }
}

/* Hero text lines up with the logo at every width */
.hero > .container { width: 100%; }

/* ─── BRAND LOGO (green in dark mode, blue in light mode) ────────────────── */
.brand-logo { display: inline-flex; align-items: center; height: 52px; flex-shrink: 0; }
.brand-logo img { height: 100%; width: auto; display: block; }
.brand-logo-footer { height: 64px; }
.brand-logo .logo-light { display: none; }
body.light-mode .brand-logo .logo-dark { display: none; }
body.light-mode .brand-logo .logo-light { display: block; }
@media (max-width: 360px) { .brand-logo:not(.brand-logo-footer) { height: 46px; } }

/* ─── PAGE LOADER (yellow logo while a page loads) ───────────────────────── */
#page-loader {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.35s ease, visibility 0.35s ease;
  /* safety net: never stays up longer than 4s, even if scripts fail */
  animation: loader-timeout 0s linear 4s forwards;
}
#page-loader img { height: 120px; width: auto; animation: loader-pulse 1.2s ease-in-out infinite; }
#page-loader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes loader-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.94); opacity: 0.85; } }
@keyframes loader-timeout { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) { #page-loader img { animation: none; } }

/* Footer brand name readable in light mode */
body.light-mode .footer-brand-name { color: var(--purple-dk); }

/* Tablets: two columns instead of one long stack; an odd last card spans the row */
@media (min-width: 601px) and (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
