/* AIFox AI - main.css | UTF-8 */
:root {
  --bg: #060810;
  --surface: #0d1020;
  --surface2: #121628;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #ef4444;
  --accent-dark: #dc2626;
  --border: rgba(255,255,255,0.08);
  --radius: 12px;
  --gap: 2.5em;
  --nav-height: 72px;
  --funding-bar-h: 0px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Exo 2', 'Segoe UI', Arial, sans-serif;
  font-size: 18px !important;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; }

/* ---- Typography Scale ---- */
h1 { font-size: 61px !important; font-weight: 800; line-height: 1.1; }
h2 { font-size: 43px !important; font-weight: 700; line-height: 1.15; }
h3 { font-size: 28px !important; font-weight: 700; line-height: 1.2; }
h4 { font-size: 1.15em; font-weight: 600; }
p { line-height: 1.75; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #f87171; }

/* ---- Layout ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}
.page-top {
  padding-top: var(--nav-height, 72px);
}
section { padding: 5em 0; }
.section-dark { background-color: var(--surface); }
.section-darker { background-color: var(--surface2); }

/* ---- Navigation ---- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height, 72px);
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 5%;
  background-color: rgba(6,8,16,0.95) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 9999;
  box-sizing: border-box;
}
.site-nav .nav-logo {
  display: flex; align-items: center; gap: 0.6em;
  flex-shrink: 0;
  text-decoration: none;
}
.site-nav .nav-logo img { height: 36px; width: auto; display: block; }
.site-nav .nav-logo-text {
  font-size: 1.1em; font-weight: 700; color: #fff; letter-spacing: 0.02em;
}
.site-nav ul {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  list-style: none !important;
  margin: 0 !important; padding: 0 !important;
  gap: 0;
}
.site-nav ul li a {
  display: flex !important;
  align-items: center !important;
  height: var(--nav-height, 72px);
  padding: 0 1.1em !important;
  color: rgba(255,255,255,0.75) !important;
  font-size: 15px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  font-weight: 500 !important;
  white-space: nowrap;
  transition: color 0.2s;
  text-decoration: none;
}
.site-nav ul li a:hover,
.site-nav ul li.current a { color: #ef4444 !important; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4em;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: rgba(255,255,255,0.8);
  transition: all 0.3s;
}
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav .nav-links {
    position: fixed;
    top: var(--nav-height, 72px); left: 0; right: 0;
    background: rgba(6,8,16,0.98);
    flex-direction: column !important;
    padding: 1em 0;
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--border);
    z-index: 9998;
  }
  .site-nav .nav-links.is-open {
    transform: translateY(0);
  }
  .site-nav ul li a {
    height: auto !important;
    padding: 0.9em 2em !important;
    width: 100%;
  }
}

/* ---- Hero Section ---- */
.hero {
  min-height: 620px;
  display: flex;
  align-items: center;
  padding: 5rem 5%;
  position: relative;
  overflow: hidden;
  background-color: rgba(10,15,40,0.35);
  background-blend-mode: multiply;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero/* removed ::before position:fixed */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38);
  z-index: 0;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 2; }
.hero-content { max-width: 680px; }
.hero h1 { color: #fff; margin-bottom: 0.5em; }
.hero h1 span.accent { color: var(--accent); }
.hero-subtitle {
  font-size: 1.25em;
  color: rgba(255,255,255,0.82) !important;
  margin-bottom: 2em;
  max-width: 540px;
}
.hero-buttons { display: flex; gap: 1em; flex-wrap: wrap; }

/* Animated background particles */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.hero-particles::before, .hero-particles::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}
.hero-particles::before {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(239,68,68,0.12) 0%, transparent 70%);
  top: -80px; right: 10%;
}
.hero-particles::after {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
  bottom: -50px; left: 20%;
  animation-delay: -4s;
}
@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.85em 2em;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(239,68,68,0.35);
}
.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.3);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---- Cards & Grids ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  align-items: stretch;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2em 1.8em;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  border-color: rgba(239,68,68,0.3);
}
.card-icon {
  width: 52px; height: 52px;
  background: rgba(239,68,68,0.12);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.2em;
  color: var(--accent);
  font-size: 1.3em;
}
.card h3 { margin-bottom: 0.6em; color: #fff; }
.card p { color: var(--text-muted); flex: 1; }
.card-footer { margin-top: auto; padding-top: 1.2em; }

/* ---- Section Headers ---- */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5em;
}
.section-tag {
  display: inline-block;
  background: rgba(239,68,68,0.12);
  color: var(--accent);
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4em 1em;
  border-radius: 100px;
  margin-bottom: 0.8em;
}
.section-header h2 { color: #fff; margin-bottom: 0.5em; }
.section-header p { color: var(--text-muted); font-size: 1.05em; }

/* ---- Stats Bar ---- */
.stats-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3em 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2em;
  text-align: center;
}
.stat-item { padding: 1em; }
.stat-number {
  font-size: 2.4em;
  font-weight: 800;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 0.25em;
}
.stat-label { color: var(--text-muted); font-size: 0.88em; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Features List ---- */
.features-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2em;
}
.feature-item {
  display: flex; gap: 1.2em; align-items: flex-start;
}
.feature-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: rgba(239,68,68,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1.1em;
}
.feature-item h4 { color: #fff; margin-bottom: 0.3em; font-size: 1em; }
.feature-item p { color: var(--text-muted); font-size: 0.9em; margin: 0; }

/* ---- Team Cards ---- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5em;
}
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2em 1.5em;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.team-card img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 10%;
  display: block;
  margin: 0 auto 1.2rem;
  border: 3px solid rgba(239,68,68,0.3);
}
.team-card h3 { color: #fff; font-size: 1.25em !important; margin-bottom: 0.2em; }
.team-role {
  color: var(--accent);
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.8em;
}
.team-card .bio { color: var(--text-muted); font-size: 0.9em; line-height: 1.6; }

/* ---- Advantages / Checkmark List ---- */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5em 3em;
}
.advantage-item {
  display: flex; gap: 0.8em; align-items: flex-start;
  padding: 1.2em 1.5em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.advantage-item .check {
  width: 22px; height: 22px; flex-shrink: 0;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.7em; font-weight: 700;
  margin-top: 3px;
}
.advantage-item p { color: var(--text-muted); font-size: 0.95em; margin: 0; }
.advantage-item strong { color: #fff; display: block; margin-bottom: 0.2em; }

/* ---- Blog Cards ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2em;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex; flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.blog-card .card-thumb {
  width: 100%; overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
}
.blog-card .card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.blog-card .card-body { padding: 1.5em; flex: 1; display: flex; flex-direction: column; }
.blog-card .tag {
  display: inline-block;
  font-size: 0.75em; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(239,68,68,0.1);
  padding: 0.2em 0.7em; border-radius: 4px;
  margin-bottom: 0.7em;
}
.blog-card h3 { font-size: 1.1em !important; color: #fff; margin-bottom: 0.5em; line-height: 1.4; }
.blog-card h3 a { color: inherit; text-decoration: none; }
.blog-card h3 a:hover { color: var(--accent); }
.blog-card .excerpt { color: var(--text-muted); font-size: 0.88em; flex: 1; margin-bottom: 1em; }
.blog-card time { color: var(--text-muted); font-size: 0.8em; }

/* ---- Article cards (pinned) ---- */
.blog-card.pinned {
  border-left: 3px solid var(--accent);
  background: rgba(239,68,68,0.04);
}
.tag.funding {
  background: var(--accent); color: #fff;
  padding: 0.2em 0.6em; border-radius: 3px;
  font-size: 0.75em; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---- Contact Page ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4em;
  align-items: start;
}
.contact-info h2 { color: #fff; margin-bottom: 1em; }
.contact-item {
  display: flex; gap: 1em; align-items: flex-start;
  margin-bottom: 1.5em;
}
.contact-item .icon {
  width: 42px; height: 42px; flex-shrink: 0;
  background: rgba(239,68,68,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1em;
}
.contact-item .label { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.2em; }
.contact-item .value { color: #fff; font-size: 0.95em; }
.contact-form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5em;
}
.contact-form-wrap h3 { color: #fff; margin-bottom: 1.5em; }
.form-group { margin-bottom: 1.4em; }
.form-group label { display: block; font-size: 0.88em; color: var(--text-muted); margin-bottom: 0.5em; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.75em 1em;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.95em;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-group textarea { min-height: 120px; resize: vertical; }

/* ---- Page Hero (inner pages) ---- */
.page-hero {
  padding: 5em 5%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero h1 { color: #fff; margin-bottom: 0.4em; }
.page-hero p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.page-hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(239,68,68,0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Two-column layout (spotlight) ---- */
.spotlight-section {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4em;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4em 2em;
}
.story-text h2 { color: #fff; margin-bottom: 0.8em; }
.story-text p { color: var(--text-muted); margin-bottom: 1em; }
.story-img {
  width: 100%; overflow: hidden;
  border-radius: var(--radius);
}
.story-img img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover; object-position: center;
  border-radius: var(--radius);
  display: block;
}

/* ---- CTA Section ---- */
.cta-section {
  background: linear-gradient(135deg, rgba(239,68,68,0.15) 0%, rgba(220,38,38,0.08) 100%);
  border-top: 1px solid rgba(239,68,68,0.2);
  border-bottom: 1px solid rgba(239,68,68,0.2);
  text-align: center;
  padding: 5em 5%;
}
.cta-section h2 { color: #fff !important; }
.cta-section p { color: rgba(255,255,255,0.72) !important; max-width: 560px; margin: 0.8em auto 2em; font-size: 1.05em; }

/* ---- Footer ---- */
#footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 4em 5% 2em;
  width: 100%;
}
#footer .inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3em;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2em;
  align-items: start;
  box-sizing: border-box;
}
#footer h2 {
  color: #ffffff;
  font-size: 0.9em !important;
  font-weight: 700;
  margin: 0 0 1em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#footer p { color: var(--text-muted); font-size: 0.88em; line-height: 1.75; margin: 0; }
#footer .brand-desc p { color: var(--text-muted); font-size: 0.88em; margin-top: 0.8em; }
.footer-nav { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 0.5em; }
.footer-nav a { color: var(--text-muted); text-decoration: none; font-size: 0.88em; transition: color 0.2s; }
.footer-nav a:hover { color: #fff; }
#footer .copyright {
  color: var(--text-muted);
  font-size: 0.82em;
  text-align: center;
  margin: 2.5em auto 0;
  padding-top: 1.5em;
  border-top: 1px solid var(--border);
  max-width: 1100px;
}
@media (max-width: 768px) { #footer .inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { #footer .inner { grid-template-columns: 1fr; } }

/* ---- Cookie Banner ---- */
#cookie-banner {
  background: var(--surface2);
  color: var(--text);
  padding: 1.2em 2em;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: wrap;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10003;
}
#cookie-banner p { margin: 0; font-size: 0.88em; color: var(--text-muted); }
#cookie-banner a { color: var(--accent); }
.cookie-buttons { display: flex; gap: 0.7em; flex-shrink: 0; }
#cookie-banner button { border: none; padding: 0.45em 1.2em; border-radius: 6px; cursor: pointer; font-size: 0.85em; font-family: inherit; }
#cookie-accept { background: var(--accent); color: #fff; }
#cookie-decline { background: transparent; color: var(--text-muted); border: 1px solid var(--border) !important; }

/* ---- Platform/Solutions page features ---- */
.platform-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2em;
}
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2em 1.5em;
  border-top: 3px solid var(--accent);
}
.platform-card .icon {
  font-size: 1.8em;
  color: var(--accent);
  margin-bottom: 0.8em;
}
.platform-card h3 { color: #fff; margin-bottom: 0.5em; }
.platform-card p { color: var(--text-muted); font-size: 0.92em; }

/* ---- Legal pages ---- */
.legal-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 4em 5%;
}
.legal-content h2 { color: #fff; margin: 2em 0 0.8em; font-size: 1.6em !important; }
.legal-content h3 { color: #e2e8f0; margin: 1.5em 0 0.6em; font-size: 1.15em !important; }
.legal-content p { color: var(--text-muted); margin-bottom: 1em; }
.legal-content ul { color: var(--text-muted); padding-left: 1.5em; margin-bottom: 1em; line-height: 2; }
.legal-content a { color: var(--accent); }
.legal-date { color: var(--text-muted); font-size: 0.88em; font-style: italic; margin-bottom: 2em; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  h1 { font-size: 42px !important; }
  h2 { font-size: 32px !important; }
  h3 { font-size: 22px !important; }
  .hero { min-height: 480px; padding: 4rem 5%; }
  .card-grid, .features-list, .advantages-grid, .platform-features {
    grid-template-columns: 1fr;
  }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5em; }
  .spotlight-section { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  h1 { font-size: 32px !important; }
  h2 { font-size: 26px !important; }
  section { padding: 3.5em 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Background body ---- */
#page-wrapper, #wrapper, #main {
  background-color: var(--bg) !important;
}

/* === Card Grid Equal Height Fix === */
.features-grid,
.services-grid,
.cards-grid,
.solutions-grid,
.advantages-grid {
  align-items: start;
}

.card-custom,
.service-card,
.solution-card,
.advantage-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-custom p,
.service-card p,
.solution-card p,
.advantage-card p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* === Card Equal Height (stretch to tallest card) === */
.features-grid,
.services-grid,
.cards-grid,
.solutions-grid,
.advantages-grid,
.platform-grid,
[class*="-grid"] {
  align-items: stretch;
}

.card-custom,
.service-card,
.solution-card,
.advantage-card,
.feature-card,
.platform-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  box-sizing: border-box;
}

.card-custom h3,
.card-custom h4,
.service-card h3,
.solution-card h3 {
  flex-shrink: 0;
}

.card-custom p:last-of-type,
.service-card p:last-of-type,
.solution-card p:last-of-type {
  flex: 1;
}

/* === Odd-count card grid: last card centered === */
.features-grid > .card-custom:last-child:nth-child(odd),
.services-grid > .card-custom:last-child:nth-child(odd),
.cards-grid > .card-custom:last-child:nth-child(odd),
.solutions-grid > .card-custom:last-child:nth-child(odd),
.advantages-grid > .card-custom:last-child:nth-child(odd),
.features-grid > *:last-child:nth-child(odd),
.services-grid > *:last-child:nth-child(odd),
[class*="-grid"] > .card-custom:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 1rem);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
