/*
  NeurFly - main.css
  Neural Network Automation | Dark Theme | Accent: #8b5cf6
*/

/* ===== CSS Variables ===== */
:root {
  --bg: #0d0f18;
  --surface: #151825;
  --surface-2: #1c2033;
  --text: #e8eaf0;
  --text-muted: #8892a4;
  --accent: #8b5cf6;
  --accent-dark: #7c3aed;
  --border: rgba(255,255,255,0.08);
  --radius: 12px;
  --gap: 40px;
  --nav-height: 72px;
  --funding-bar-h: 44px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

body {
  font-family: "Raleway", "Segoe UI", Arial, sans-serif;
  font-size: 18px !important;
  line-height: 1.9;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  overflow-x: hidden;
}

h1 { font-size: 61px !important; line-height: 1.1; font-weight: 700; }
h2 { font-size: 43px !important; line-height: 1.2; font-weight: 700; }
h3 { font-size: 28px !important; line-height: 1.3; font-weight: 600; }
h4 { font-size: 20px; font-weight: 600; }
p { line-height: 1.9; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #a78bfa; }

ul { list-style: none; }

/* ===== Funding Bar ===== */
#funding-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1100;
  background-color: var(--accent-dark);
  color: #fff !important;
  padding: 10px 5%;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
#funding-bar a,
#funding-bar strong,
#funding-bar span { color: #ffffff !important; }
#funding-bar button { color: rgba(255,255,255,0.85) !important; }

/* ===== Navbar ===== */
.tm-navbar {
  position: fixed;
  top: var(--funding-bar-h, 0px); left: 0; right: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent;
  transition: all 0.3s ease;
  min-height: var(--nav-height);
}

.tm-navbar.scroll {
  background-color: var(--bg) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.tm-navbar .container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  max-width: 1200px;
  padding: 0 32px;
}

.navbar-brand {
  display: flex !important;
  align-items: center !important;
  padding: 8px 0;
  flex-shrink: 0;
}
.navbar-brand img {
  height: 36px;
  width: auto;
  max-width: 180px;
}

.navbar-nav {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  margin-left: auto !important;
}

.navbar-nav .nav-item { list-style: none; }

.tm-nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-size: 15px !important;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 8px 16px !important;
  text-transform: none;
  transition: color 0.2s;
}
.tm-nav-link:hover,
.tm-nav-link.current { color: var(--accent) !important; }

.tm-navbar.scroll .tm-nav-link { color: rgba(255,255,255,0.85) !important; }
.tm-navbar.scroll .tm-nav-link:hover { color: var(--accent) !important; }

.navbar-toggler {
  border: 1px solid rgba(255,255,255,0.5) !important;
  color: #fff;
}
.navbar-toggler-icon { color: #fff; }

/* ===== Page layout ===== */
.page-top { padding-top: calc(var(--nav-height) + var(--funding-bar-h, 0px)); }

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== Sections ===== */
.section-pad { padding: 100px 0; }
.section-pad-sm { padding: 60px 0; }

.section-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-title {
  color: var(--text) !important;
  margin-bottom: 19.2px;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 16.8px;
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.8;
}
.section-header { text-align: center; margin-bottom: 48px; }

/* ===== Dark sections ===== */
.section-dark {
  background-color: var(--surface);
}
.section-dark .section-title { color: #ffffff !important; }
.section-dark p, .section-dark li { color: rgba(255,255,255,0.88); }

/* ===== Hero section ===== */
.hero-section {
  background-color: rgba(10,5,30,0.35);
  background-image:
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    url('../images/hero-main.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: multiply;
  min-height: 620px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-section > * { position: relative; z-index: 2; }

.hero-content { text-align: center; padding: 96px 16px 80px; }
.hero-content h1 { color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); margin-bottom: 19.2px; }
.hero-content p { color: rgba(255,255,255,0.88); font-size: 18.4px; max-width: 640px; margin: 0 auto 40px; }

/* ===== Page hero (inner pages) ===== */
.page-hero {
  background-color: rgba(10,5,30,0.35);
  background-image:
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
    url('../images/about-hero.jpg');
  background-size: cover;
  background-position: center;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.page-hero h1 { color: #ffffff; font-size: 52px !important; margin-bottom: 12.8px; }
.page-hero p { color: rgba(255,255,255,0.82); }

/* ===== Buttons ===== */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #ffffff !important;
  padding: 12.8px 35.2px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15.2px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); color: #fff !important; }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: rgba(255,255,255,0.9) !important;
  padding: 12.8px 35.2px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15.2px;
  border: 2px solid rgba(255,255,255,0.5);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent) !important; transform: translateY(-2px); }

.btn-gap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }

/* ===== Feature grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 768px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.25); }
.feature-card .icon-wrap {
  width: 60px; height: 60px;
  background: rgba(139,92,246,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}
.feature-card .icon-wrap i { font-size: 24px; color: var(--accent); }
.feature-card h3 { color: var(--text) !important; margin-bottom: 12.8px; }
.feature-card p { color: var(--text-muted); font-size: 15.2px; line-height: 1.8; }

/* ===== Advantages ===== */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}
.advantage-item {
  display: flex;
  gap: 19.2px;
  align-items: flex-start;
}
.advantage-num {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
}
.advantage-item h4 { color: var(--text) !important; margin-bottom: 6.4px; }
.advantage-item p { color: var(--text-muted); font-size: 15.2px; line-height: 1.7; margin: 0; }

/* ===== Stats bar ===== */
.stats-bar {
  background: var(--accent-dark);
  padding: 60px 0;
}
.stats-bar .container { max-width: 1100px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  text-align: center;
}
.stat-item .stat-number { font-size: 44.8px; font-weight: 700; color: #fff; line-height: 1; }
.stat-item .stat-label { color: rgba(255,255,255,0.82); font-size: 14.7px; margin-top: 8px; }

/* ===== CTA section ===== */
.cta-section {
  background: linear-gradient(135deg, var(--accent-dark) 0%, #5b21b6 100%);
  padding: 80px 0;
  text-align: center;
}
.cta-section h2 { color: #ffffff !important; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.88); max-width: 560px; margin: 0 auto 32px; }

/* ===== Team page ===== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.team-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.25); }
.team-card img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 10%;
  display: block;
  margin: 0 auto 24px;
  border: 3px solid var(--accent);
}
.team-card h3 { color: var(--text) !important; margin-bottom: 6.4px; }
.team-role { color: var(--accent); font-size: 14.4px; font-weight: 600; margin-bottom: 16px; }
.team-bio { color: var(--text-muted); font-size: 14.4px; line-height: 1.75; }
.initial-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}

/* ===== About page ===== */
.about-hero {
  background-image:
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
    url('../images/about-hero.jpg') !important;
  background-size: cover;
  background-position: center;
}

.spotlight-section {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 64px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 32px;
}
.story-text h2 { color: var(--text) !important; margin-bottom: 24px; }
.story-text p { color: var(--text-muted); line-height: 1.9; margin-bottom: 19.2px; }
.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;
}

.investors-section { background: var(--surface); }
.investors-section h2 { color: var(--text) !important; }
.investors-section p { color: var(--text-muted); }
.vc-badge {
  display: inline-block;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.4);
  border-radius: 8px;
  padding: 19.2px 40px;
  margin-top: 24px;
  text-align: center;
}
.vc-badge .vc-name { font-size: 22.4px; font-weight: 700; color: #fff; }
.vc-badge .vc-amount { font-size: 14.4px; color: var(--accent); margin-top: 4.8px; }

/* ===== Platform / Solutions page ===== */
.platform-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 80px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 32px;
}
.platform-feature.reverse { direction: rtl; }
.platform-feature.reverse > * { direction: ltr; }
.platform-feature-content h3 { color: var(--text) !important; margin-bottom: 16px; }
.platform-feature-content p { color: var(--text-muted); line-height: 1.9; margin-bottom: 19.2px; }
.feature-list { list-style: none; padding: 0; }
.feature-list li { color: var(--text-muted); padding: 6.4px 0; padding-left: 24px; position: relative; }
.feature-list li::before { content: ""; position: absolute; left: 0; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.platform-feature-image { overflow: hidden; border-radius: var(--radius); }
.platform-feature-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); display: block; }

/* ===== Blog listing ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.25); }
.card-thumb {
  width: 100%; overflow: hidden;
  aspect-ratio: 16/9;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  aspect-ratio: 16/9;
}
.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  display: inline-block;
  background: rgba(139,92,246,0.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 11.2px;
  border-radius: 4px;
  margin-bottom: 12.8px;
}
.card-tag.funding {
  background: var(--accent);
  color: #fff;
}
.blog-card h3 { color: var(--text) !important; margin-bottom: 9.6px; font-size: 17.6px !important; line-height: 1.4; }
.blog-card h3 a { color: var(--text); }
.blog-card h3 a:hover { color: var(--accent); }
.card-meta { color: var(--text-muted); font-size: 13.1px; margin-top: auto; padding-top: 16px; }
.blog-card.pinned { border-left: 3px solid var(--accent); }

/* ===== Contact page ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}
.contact-info h3 { color: var(--text) !important; margin-bottom: 24px; }
.contact-item { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.contact-item i { color: var(--accent); font-size: 19.2px; flex-shrink: 0; margin-top: 3.2px; }
.contact-item span, .contact-item p { color: var(--text-muted); margin: 0; line-height: 1.7; }
.contact-form label { display: block; color: var(--text-muted); font-size: 14.1px; margin-bottom: 6.4px; }
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 12px 16px;
  font-size: 15.2px;
  margin-bottom: 19.2px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); outline: none; }
.contact-form textarea { min-height: 140px; resize: vertical; }

/* ===== Legal pages ===== */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 32px;
}
.legal-content h2 { color: var(--text) !important; margin: 40px 0 16px; font-size: 25.6px !important; }
.legal-content h3 { color: var(--text) !important; margin: 24px 0 12.8px; font-size: 19.2px !important; }
.legal-content p, .legal-content li { color: var(--text-muted); line-height: 1.9; margin-bottom: 16px; }
.legal-content ul { padding-left: 24px; list-style: disc; }
.legal-content ul li { color: var(--text-muted); margin-bottom: 8px; }

/* ===== Footer ===== */
#footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 64px 32px 32px;
  width: 100%;
}
#footer .inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 64px;
  align-items: start;
  box-sizing: border-box;
}
#footer h2 {
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#footer p { color: var(--text-muted); font-size: 14.1px; line-height: 1.7; margin: 0; }
#footer .brand-desc { margin-top: 12.8px; }
.footer-nav { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 8px; }
.footer-nav a { color: var(--text-muted); text-decoration: none; font-size: 14.1px; transition: color 0.2s; }
.footer-nav a:hover { color: #ffffff; }
#footer .copyright {
  color: var(--text-muted);
  font-size: 13.1px;
  text-align: center;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  max-width: 1100px;
}

/* ===== Cookie Banner ===== */
#cookie-banner {
  background: var(--surface-2);
  color: var(--text);
  padding: 19.2px 32px;
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10003;
  flex-wrap: wrap;
}
#cookie-banner p { margin: 0; font-size: 14.1px; color: var(--text-muted); }
#cookie-banner a { color: var(--accent); }
#cookie-banner button { border: none; padding: 8px 20.8px; border-radius: 6px; cursor: pointer; font-size: 13.6px; font-weight: 600; transition: opacity 0.2s; }
#cookie-banner #cookie-accept { background: var(--accent); color: #fff; }
#cookie-banner #cookie-decline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
#cookie-banner button:hover { opacity: 0.85; }

/* ===== Misc ===== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.py-section { padding-top: 100px; padding-bottom: 100px; }

/* ===== Image overflow protection ===== */
.feature-img-wrap {
  width: 100%; max-width: 100%; overflow: hidden;
  border-radius: var(--radius); display: block; margin-bottom: 24px;
}
.feature-img-wrap img { width: 100%; max-width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; }

/* ===== Responsive ===== */
@media (max-width: 992px) {
  h1 { font-size: 48px !important; }
  h2 { font-size: 36px !important; }
  .spotlight-section { grid-template-columns: 1fr; }
  .platform-feature { grid-template-columns: 1fr; }
  .platform-feature.reverse { direction: ltr; }
  
  #footer .inner { grid-template-columns: 1fr 1fr; padding: 0 32px; }
}
@media (max-width: 768px) {
  h1 { font-size: 38px !important; }
  h2 { font-size: 28px !important; }
  h3 { font-size: 22px !important; }
  .hero-section { min-height: 520px; }
  
  
  
  
  #footer .inner { grid-template-columns: 1fr; }
  .navbar-nav { display: none !important; }
  .section-pad { padding: 60px 0; }
}
@media (max-width: 480px) {
  body { font-size: 16px !important; }
  .hero-content { padding: 64px 16px 48px; }
  .btn-gap { flex-direction: column; align-items: center; }
}
/* === 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% - 16px);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.frameworks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; max-width: 1100px; margin: 0 auto; }
@media (max-width: 768px) { .frameworks-grid { grid-template-columns: 1fr; } }
