/* AI42 Hub - Main Stylesheet
   Dark theme, Indigo accent #6366f1
   Template: 2085 Neuron (Bootstrap 4, Font Awesome 4)
*/

/* ---- CSS Variables ---- */
:root {
  --bg: #0a0b14;
  --surface: #11131f;
  --surface2: #1a1d2e;
  --text: #e8eaf0;
  --text-muted: #8892a4;
  --accent: #6366f1;
  --accent-dark: #4f52d9;
  --accent-light: #818cf8;
  --border: rgba(255,255,255,0.08);
  --radius: 12px;
  --nav-height: 72px;
  --funding-bar-h: 0px;
}

/* ---- Base ---- */
html { -webkit-font-smoothing: antialiased; }
body {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  font-family: 'Lora', serif;
  font-size: 18px !important;
  font-weight: 300;
  line-height: 1.9;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--accent); transition: 0.3s; text-decoration: none !important; }
a:hover, a:focus { color: var(--accent-light); outline: none; }
p { color: var(--text-muted); font-size: 18px !important; line-height: 1.9; margin-bottom: 16px; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}
h1 { font-size: 61px !important; line-height: 1.1 !important; }
h2 { font-size: 43px !important; line-height: 1.2 !important; }
h3 { font-size: 28px !important; line-height: 1.3 !important; }
h4 { font-size: 18px; color: var(--text-muted); font-weight: 400; }

/* ---- Navbar ---- */
.navbar-default {
  background: rgba(10,11,20,0.97) !important;
  border-bottom: 1px solid var(--border) !important;
  margin: 0 !important;
  padding: 0 !important;
  position: fixed !important;
  top: var(--funding-bar-h, 0px) !important;
  left: 0 !important; right: 0 !important;
  width: 100% !important;
  z-index: 1000 !important;
  min-height: var(--nav-height) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4) !important;
}
.navbar-default .container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  min-height: var(--nav-height) !important;
}
.navbar-default .navbar-brand {
  color: var(--text) !important;
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 1.2em !important;
  letter-spacing: 1px;
  padding: 0 !important;
  line-height: var(--nav-height) !important;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.navbar-brand img { height: 36px !important; width: auto !important; display: block; }
.navbar-default .navbar-header { display: flex; align-items: center; }
.navbar-default .navbar-nav > li > a {
  color: rgba(255,255,255,0.75) !important;
  font-size: 15px !important;
  font-family: 'Merriweather', serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 1.2em !important;
  line-height: var(--nav-height) !important;
  transition: color 0.3s;
  white-space: nowrap;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  color: #ffffff !important;
  background-color: transparent !important;
}
.navbar-default .navbar-toggle {
  border: 1px solid var(--border) !important;
  margin-top: 18px;
}
.navbar-default .navbar-toggle .icon-bar { background: var(--text) !important; }
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus { background-color: var(--surface2) !important; }
.navbar-default .navbar-collapse { border-color: var(--border) !important; }

/* Page top offset for fixed nav */
.page-top { padding-top: var(--nav-height) !important; }

/* ---- Hero Section ---- */
#home {
  background-color: rgba(10,15,40,0.35);
  background-blend-mode: multiply;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  color: #ffffff;
  display: flex;
  align-items: center;
  position: relative;
  text-align: center;
  min-height: 620px !important;
}
.main-home {
  background-image: url('../images/hero-main.jpg');
  min-height: 620px !important;
}
#home::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 0;
  pointer-events: none;
}
#home > * { position: relative; z-index: 2; }
#home .overlay { display: none; }
#home h1 { color: #ffffff !important; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
#home h4 { color: rgba(255,255,255,0.88) !important; font-size: 16px !important; letter-spacing: 2px; text-transform: uppercase; }
#home p { color: rgba(255,255,255,0.88) !important; font-size: 17.6px !important; max-width: 640px; margin: 16px auto; }
#particles-js { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 1; }

/* Hero buttons */
#home .btn {
  display: inline-block;
  padding: 0.8em 2.2em;
  border-radius: 6px;
  font-family: 'Merriweather', serif;
  font-size: 0.82em !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s;
  margin: 0.5em;
  cursor: pointer;
}
#home .btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
}
#home .btn-primary:hover {
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
}
#home .btn-default {
  background: transparent !important;
  border: 2px solid rgba(255,255,255,0.75) !important;
  color: #ffffff !important;
}
#home .btn-default:hover {
  background: rgba(255,255,255,0.12) !important;
  border-color: #ffffff !important;
}

/* ---- Page Hero Sections ---- */
.page-hero {
  position: relative;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: rgba(10,15,40,0.35);
  background-blend-mode: multiply;
  min-height: 320px;
  display: flex;
  align-items: center;
  text-align: center;
  color: #fff;
  padding: 80px 0;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 0;
  pointer-events: none;
}
.page-hero > * { position: relative; z-index: 2; }
.page-hero h1, .page-hero h2 { color: #ffffff !important; }
.page-hero p { color: rgba(255,255,255,0.88) !important; }

/* ---- Sections ---- */
section { padding: 80px 0; }
.section-alt { background-color: var(--surface) !important; }
.section-dark {
  background-color: var(--surface2) !important;
  color: var(--text) !important;
}
.section-header { text-align: center; margin-bottom: 48px; }
.section-label {
  display: inline-block;
  color: var(--accent);
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-title { color: var(--text) !important; margin-bottom: 16px; }
.section-subtitle { color: var(--text-muted); max-width: 620px; margin: 0 auto; }

/* ---- Cards ---- */
.card-custom {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2em 1.8em;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}
.card-custom:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.card-custom h3 { color: var(--text) !important; margin-bottom: 12px; }
.card-custom p { color: var(--text-muted); margin: 0; }
.card-icon {
  width: 52px; height: 52px;
  background: rgba(99,102,241,0.12);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 19.2px;
  font-size: 1.4em;
  color: var(--accent);
}
.card-icon .fa { color: var(--accent); }

/* ---- Features/Advantages Grid ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

/* ---- Team Cards ---- */
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2em 1.5em;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px 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 19.2px;
}
.team-card h3 { color: var(--text) !important; margin-bottom: 4.8px; font-size: 22px !important; }
.team-role {
  color: var(--accent) !important;
  font-size: 0.88em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12.8px;
}
.team-card p { color: var(--text-muted); font-size: 0.92em !important; line-height: 1.7; margin: 0; }

/* ---- Blog/Content ---- */
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.3); }
.blog-card-thumb {
  width: 100%;
  overflow: hidden;
}
.blog-card-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: center;
  display: block;
}
.blog-card-body { padding: 1.5em; flex: 1; display: flex; flex-direction: column; }
.blog-card h3 { font-size: 20px !important; margin-bottom: 8px; }
.blog-card h3 a { color: var(--text) !important; }
.blog-card h3 a:hover { color: var(--accent) !important; }
.blog-card .meta { color: var(--text-muted); font-size: 0.82em; margin-bottom: 12px; }
.blog-card .tag {
  display: inline-block;
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  margin-bottom: 9.6px;
}
.blog-card .tag.funding {
  background: var(--accent);
  color: #fff;
}
.blog-card p { color: var(--text-muted); font-size: 0.9em !important; flex: 1; }
.blog-card .read-more { color: var(--accent); font-size: 0.88em; font-weight: 600; margin-top: 16px; display: inline-block; }
.blog-card .read-more:hover { color: var(--accent-light); }

/* Pinned article */
.article-card.pinned { border-left: 3px solid var(--accent); background: rgba(99,102,241,0.06); }

/* ---- Contact ---- */
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.contact-info-item .fa {
  color: var(--accent);
  font-size: 1.2em;
  margin-top: 0.1em;
  flex-shrink: 0;
  width: 20px;
}
.contact-info-item p { color: var(--text-muted); margin: 0; line-height: 1.6; }

/* Contact form */
.contact-form .form-control {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  padding: 0.75em 1em;
  font-size: 0.95em;
  transition: border-color 0.3s;
  box-shadow: none !important;
  margin-bottom: 1em;
}
.contact-form .form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}
.contact-form .form-control::placeholder { color: var(--text-muted); opacity: 0.7; }
.contact-form textarea.form-control { min-height: 140px; resize: vertical; }
.contact-form .btn-submit {
  background: var(--accent) !important;
  border: none !important;
  border-radius: 6px !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9em !important;
  letter-spacing: 0.08em;
  padding: 0.85em 2.5em;
  transition: background 0.3s;
  cursor: pointer;
  text-transform: uppercase;
}
.contact-form .btn-submit:hover { background: var(--accent-dark) !important; }

/* ---- Advantages ---- */
.advantage-item {
  display: flex;
  align-items: flex-start;
  gap: 19.2px;
  padding: 1.5em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.advantage-num {
  min-width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9em;
  flex-shrink: 0;
}
.advantage-item h4 { color: var(--text) !important; font-weight: 600; margin: 0 0 0.3em; font-size: 1.1em !important; }
.advantage-item p { color: var(--text-muted); margin: 0; font-size: 0.92em !important; }

/* ---- CTA Section ---- */
.cta-section {
  background: linear-gradient(135deg, #1e1f3c 0%, #2d2f5a 100%);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
  padding: 3.5em 2em;
  text-align: center;
  margin: 0 auto;
  max-width: 1100px;
}
.cta-section h2 { color: #ffffff !important; }
.cta-section p { color: rgba(255,255,255,0.82) !important; }
.cta-section .btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  padding: 0.8em 2.2em;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9em !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cta-section .btn-primary:hover { background: var(--accent-dark) !important; }

/* ---- Footer ---- */
footer {
  background-color: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  padding: 4em 0 2em !important;
  color: var(--text) !important;
  position: relative;
}
#footer { background-color: var(--surface) !important; width: 100%; }
#footer .inner {
  display: grid !important;
  grid-template-columns: 2fr 1fr 1fr !important;
  gap: 3em !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 4em !important;
  align-items: start !important;
  box-sizing: border-box !important;
}
#footer h2, footer h3.footer-heading {
  color: #ffffff !important;
  font-size: 1em !important;
  font-weight: 600 !important;
  margin: 0 0 1em !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}
#footer p, footer .footer-desc {
  color: var(--text-muted) !important;
  font-size: 0.88em !important;
  line-height: 1.7 !important;
  margin: 0 !important;
}
.footer-nav { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 0.5em; }
.footer-nav a {
  color: var(--text-muted) !important;
  text-decoration: none !important;
  font-size: 0.88em;
  transition: color 0.2s;
}
.footer-nav a:hover { color: #ffffff !important; }
#footer .copyright, footer .footer-copyright {
  color: var(--text-muted) !important;
  font-size: 0.82em !important;
  text-align: center !important;
  margin: 2.5em auto 0 !important;
  padding-top: 1.5em !important;
  border-top: 1px solid var(--border) !important;
  max-width: 1100px !important;
  display: block !important;
}
footer hr { border-color: var(--border) !important; }
.social-icon { display: none !important; }

/* ---- Cookie Banner ---- */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10003;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding: 1.2em 2em;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: wrap;
}
#cookie-banner p { margin: 0; font-size: 0.88em; color: var(--text-muted) !important; }
#cookie-banner a { color: var(--accent); }
#cookie-accept {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45em 1.4em;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
}
#cookie-decline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45em 1.2em;
  cursor: pointer;
  font-size: 0.85em;
}
.cookie-actions { display: flex; gap: 0.5em; flex-shrink: 0; }

/* ---- Preloader ---- */
.preloader {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 99999;
  display: flex; flex-flow: row nowrap;
  justify-content: center; align-items: center;
  background: var(--bg);
}
.sk-spinner-wordpress { background-color: var(--accent); }

/* ---- Utility ---- */
.go-top {
  background: var(--surface2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  bottom: 2em; right: 2em;
  color: var(--text);
  font-size: 20px;
  display: none; position: fixed;
  width: 42px; height: 42px;
  line-height: 42px; text-align: center;
  border-radius: 50%;
  transition: all 0.3s;
}
.go-top:hover { background: var(--accent); color: #fff; }
.btn-accent {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: 6px;
  padding: 0.75em 2em;
  font-weight: 700;
  font-size: 0.88em !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.3s;
  cursor: pointer;
}
.btn-accent:hover { background: var(--accent-dark) !important; color: #fff !important; }
.text-accent { color: var(--accent) !important; }

/* Platform / Solutions features */
.platform-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
  padding: 2em 0;
  border-bottom: 1px solid var(--border);
}
.platform-feature:last-of-type { border-bottom: none; }
.platform-feature-image { overflow: hidden; border-radius: var(--radius); }
.platform-feature-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border-radius: var(--radius); }
.feature-list { list-style: none; padding: 0; margin: 1.2em 0 0; }
.feature-list li {
  padding: 0.5em 0 0.5em 1.8em;
  position: relative;
  color: var(--text-muted);
  font-size: 0.95em;
}
.feature-list li::before { content: "✓"; color: var(--accent); position: absolute; left: 0; font-weight: 700; }

/* Stats bar */
.stats-bar {
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
}
.stat-item { text-align: center; }
.stat-number { font-size: 43px !important; font-weight: 700; color: var(--accent) !important; display: block; }
.stat-label { color: var(--text-muted); font-size: 0.88em; text-transform: uppercase; letter-spacing: 0.08em; }

/* Legal pages */
.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 2em;
}
.legal-content h2 { font-size: 28px !important; margin-top: 2em; }
.legal-content p { color: var(--text-muted); }
.legal-content ul { color: var(--text-muted); padding-left: 1.5em; line-height: 2; }

/* About page */
.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: var(--text) !important; }
.story-text p { color: var(--text-muted); }
.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;
}

/* Responsive */
@media (max-width: 992px) {
  .platform-feature { grid-template-columns: 1fr; gap: 2em; }
  .spotlight-section { grid-template-columns: 1fr; }
  #footer .inner { grid-template-columns: 1fr 1fr !important; padding: 0 2em !important; }
}
@media (max-width: 768px) {
  h1 { font-size: 42px !important; }
  h2 { font-size: 32px !important; }
  h3 { font-size: 22px !important; }
  
  #footer .inner { grid-template-columns: 1fr !important; }
  .cta-section { padding: 2.5em 1.5em; }
  section { padding: 60px 0; }
}
@media (max-width: 480px) {
  h1 { font-size: 34px !important; }
}

.page-top { padding-top: 72px !important; }
.main-about { background-image: url(../images/about-hero.jpg); }
.main-contact { background-image: url(../images/hero-main.jpg); }

/* === 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%;
}
