/*! GPT42 Hub — main.css | dark violet theme */

/* ── CSS Variables ─────────────────────────────────── */
:root {
  --bg: #0d0a1a;
  --surface: #160f2e;
  --surface2: #1e1540;
  --text: #e8e0ff;
  --text-muted: #9b8fc2;
  --accent: #8b5cf6;
  --accent-dark: #6d28d9;
  --border: rgba(139,92,246,0.15);
  --radius: 12px;
  --gap: 2.5em;
  --nav-height: 72px;
  --funding-bar-h: 0px;
  --sidebar-w: 0px;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  font-family: 'Kumbh Sans', 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  margin: 0;
  padding: 0;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #c4b5fd; }
h1,h2,h3,h4,h5 { font-weight: 700; line-height: 1.2; margin-top: 0; color: var(--text); }
p { margin-top: 0; }
ul { list-style: none; margin: 0; padding: 0; }

/* ── Loader ───────────────────────────────────────── */
#loader-wrapper {
  position: fixed; top:0; left:0; width:100%; height:100%; z-index: 20000;
}
#loader {
  display: block; position: relative; left:50%; top:50%;
  width:120px; height:120px; margin:-60px 0 0 -60px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: spin 1.8s linear infinite;
  z-index: 20001;
}
#loader:before {
  content:""; position:absolute; top:5px; left:5px; right:5px; bottom:5px;
  border-radius:50%; border:3px solid transparent;
  border-top-color: #c4b5fd; animation: spin 3s linear infinite;
}
#loader:after {
  content:""; position:absolute; top:15px; left:15px; right:15px; bottom:15px;
  border-radius:50%; border:3px solid transparent;
  border-top-color: #6d28d9; animation: spin 1.2s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#loader-wrapper .loader-section {
  position:fixed; top:0; width:51%; height:100%;
  background: var(--bg); z-index: 20001;
  transform: translateX(0);
}
#loader-wrapper .loader-section.section-left { left:0; }
#loader-wrapper .loader-section.section-right { right:0; }
.loaded #loader-wrapper .loader-section.section-left {
  transform: translateX(-100%);
  transition: all 0.7s 0.3s cubic-bezier(0.645,0.045,0.355,1.000);
}
.loaded #loader-wrapper .loader-section.section-right {
  transform: translateX(100%);
  transition: all 0.7s 0.3s cubic-bezier(0.645,0.045,0.355,1.000);
}
.loaded #loader { opacity:0; transition: all 0.3s ease-out; }
.loaded #loader-wrapper {
  visibility:hidden; transform:translateY(-100%);
  transition: all 0.3s 1s ease-out;
}

/* ── Navigation ────────────────────────────────────── */
.site-header {
  position: fixed;
  top: var(--funding-bar-h, 0px);
  left: 0; right: 0;
  z-index: 9999;
  background-color: rgba(13,10,26,0.97) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 2.5em;
}
.site-header .logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-header .logo img { height: 34px; width: auto; }
.main-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  gap: 0;
}
.main-nav li { display: inline-block; }
.main-nav a {
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 1.1em;
  color: rgba(232,224,255,0.75) !important;
  font-size: 0.72em;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s;
}
.main-nav a:hover,
.main-nav li.active > a { color: #ffffff !important; }
.main-nav li.active > a {
  border-bottom: 2px solid var(--accent);
}
.navbar-toggler {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4em 0.7em;
  border-radius: 6px;
  margin-left: auto;
  cursor: pointer;
  font-size: 1.1em;
}
#page-wrapper { padding-top: var(--nav-height); }

/* ── Hero Section ──────────────────────────────────── */
.hero, .page-hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-image: url('../images/hero-main.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(10,5,30,0.40);
  background-blend-mode: multiply;
  padding: 5em 2em;
  text-align: center;
}
.hero::after, .page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 0;
  pointer-events: none;
}
.hero > *, .page-hero > * {
  position: relative;
  z-index: 2;
}
.hero-inner {
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 3em;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.4em;
  line-height: 1.15;
}
.hero .hero-subtitle {
  font-size: 1.15em;
  color: rgba(255,255,255,0.82);
  margin-bottom: 2em;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero p, .hero .text-muted { color: rgba(255,255,255,0.82); }
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.75em 2em;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn-outline {
  display: inline-block;
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
  padding: 0.7em 1.8em;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 600;
  margin-left: 1em;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: #fff; color: #fff; }

/* ── Page-specific hero backgrounds ──────────────────── */
.page-about .page-hero {
  background-image: url('../images/about-hero.jpg') !important;
}
.page-platform .page-hero {
  background-image: url('../images/platform-hero.jpg') !important;
}

/* ── Sections ──────────────────────────────────────── */
section.section-pad {
  padding: 5em 2em;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.section-header {
  text-align: center;
  margin-bottom: 3em;
}
.section-header h2 { font-size: 2em; margin-bottom: 0.5em; }
.section-header p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.section-alt { background-color: var(--surface); }
.section-dark {
  background-color: var(--surface2);
}

/* ── Cards / Grid ─────────────────────────────────── */
.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: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card-icon {
  width: 48px; height: 48px;
  background: rgba(139,92,246,0.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.2em;
  color: var(--accent);
  font-size: 1.3em;
}
.card h3 { font-size: 1.1em; margin-bottom: 0.5em; }
.card p { color: var(--text-muted); font-size: 0.92em; flex: 1; margin-bottom: 0; }

/* ── Advantage / Feature items ───────────────────── */
.advantage-item {
  display: flex;
  align-items: flex-start;
  gap: 1.2em;
  margin-bottom: 2em;
}
.advantage-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85em;
}
.advantage-text h4 { margin-bottom: 0.25em; font-size: 1em; }
.advantage-text p { color: var(--text-muted); font-size: 0.9em; margin: 0; }

/* ── Stats Bar ──────────────────────────────────── */
.stats-bar {
  background: var(--accent);
  padding: 3em 2em;
  text-align: center;
}
.stats-bar .section-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2em;
}
.stat-item {}
.stat-num {
  font-size: 2.4em;
  font-weight: 800;
  color: #ffffff;
  display: block;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.85em;
  color: rgba(255,255,255,0.82);
  display: block;
}

/* ── CTA Section ─────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  padding: 5em 2em;
  text-align: center;
}
#main .cta-section h2, #main .cta-section h3 { color: #ffffff !important; }
#main .cta-section p { color: rgba(255,255,255,0.88) !important; }

/* ── Team Cards ──────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
}
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2em 1.5em;
  text-align: center;
}
.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 var(--accent);
}
.team-card h3 { font-size: 1.05em; margin-bottom: 0.2em; }
.team-card .team-role {
  color: var(--accent);
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 0.8em;
}
.team-card .bio { color: var(--text-muted); font-size: 0.88em; margin: 0; }

/* ── 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 { margin-bottom: 1em; }
.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;
}

/* ── Blog Listing ────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.15s;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.article-card.pinned { border-left: 3px solid var(--accent); }
.card-thumb {
  width: 100%;
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
}
.card-body { padding: 1.5em; flex: 1; display: flex; flex-direction: column; }
.tag {
  display: inline-block;
  background: rgba(139,92,246,0.15);
  color: var(--accent);
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.7em;
}
.tag.funding { background: var(--accent); color: #fff; }
.article-card h2 { font-size: 1.05em; margin-bottom: 0.5em; line-height: 1.4; }
.article-card h2 a { color: var(--text); }
.article-card h2 a:hover { color: var(--accent); }
.card-meta { color: var(--text-muted); font-size: 0.82em; margin-top: auto; padding-top: 0.8em; }

/* ── Article Page ────────────────────────────────── */
.article-hero-img {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.article-hero-img img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
}
.article-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 3em 2em;
  color: var(--text);
}
.article-content h1 { font-size: 2em; margin-bottom: 0.5em; }
.article-content p { color: var(--text-muted); line-height: 1.8; margin-bottom: 1.5em; }
.article-content h2 { font-size: 1.4em; margin-top: 2em; margin-bottom: 0.7em; }
.article-content h3 { font-size: 1.15em; margin-top: 1.5em; }
.article-content ul, .article-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
  color: var(--text-muted);
}
.article-content ul li, .article-content ol li { margin-bottom: 0.5em; }
.article-meta { color: var(--text-muted); font-size: 0.85em; margin-bottom: 2em; }
.article-back { margin-bottom: 2em; display: inline-block; }

/* ── Feature image wrapper ────────────────────────── */
.feature-img-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  display: block;
}
.feature-img-wrap img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* ── Contact Page ────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4em;
  align-items: start;
}
.contact-info h3 { margin-bottom: 1em; }
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1em;
  margin-bottom: 1.5em;
  color: var(--text-muted);
}
.contact-item i { color: var(--accent); margin-top: 0.2em; flex-shrink: 0; }
.contact-form-wrap {}
.form-group { margin-bottom: 1.5em; }
.form-group label {
  display: block;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 0.4em;
}
.form-control {
  width: 100%;
  padding: 0.75em 1em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95em;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-submit {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75em 2em;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.form-submit:hover { background: var(--accent-dark); }

/* ── Cookie Banner ───────────────────────────────── */
#cookie-banner {
  background: var(--surface);
  color: var(--text);
  padding: 1.2em 2em;
  border-top: 1px solid var(--border);
  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; }
#cookie-banner a { color: var(--accent); }
#cookie-banner button {
  border: none;
  padding: 0.45em 1.2em;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  font-family: inherit;
}
#cookie-banner #cookie-accept { background: var(--accent); color: #fff; }
#cookie-banner #cookie-decline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Footer ──────────────────────────────────────── */
#footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 4em 2em 2em;
  text-align: left;
  width: 100%;
}
#footer .inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3em;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4em;
  align-items: start;
  box-sizing: border-box;
}
#footer h2 {
  color: #ffffff;
  font-size: 1em;
  font-weight: 600;
  margin: 0 0 1em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#footer > .inner > section > p {
  color: var(--text-muted);
  font-size: 0.88em;
  line-height: 1.7;
  margin: 0;
}
.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: #ffffff; }
#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;
}

/* ── Legal Pages ─────────────────────────────────── */
.legal-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 3em 2em;
}
.legal-content h1 { font-size: 2em; margin-bottom: 0.4em; }
.legal-content h2 { font-size: 1.3em; margin-top: 2em; }
.legal-content p, .legal-content li { color: var(--text-muted); line-height: 1.8; }
.legal-content ul { padding-left: 1.5em; margin-bottom: 1.5em; }

/* ── Platform Page ───────────────────────────────── */
.platform-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4em;
  align-items: center;
  padding: 4em 2em;
  max-width: 1100px;
  margin: 0 auto;
}
.platform-features.reverse { direction: rtl; }
.platform-features.reverse > * { direction: ltr; }
.platform-feature-text h2 { font-size: 1.6em; margin-bottom: 0.8em; }
.platform-feature-text p { color: var(--text-muted); }
.platform-feature-text ul { padding-left: 1.5em; color: var(--text-muted); margin-bottom: 0; }
.platform-feature-text ul li { margin-bottom: 0.5em; }

/* ── Solutions Page ──────────────────────────────── */
.solutions-list { display: flex; flex-direction: column; gap: 2em; }
.solution-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2em;
  display: flex;
  gap: 1.5em;
  align-items: flex-start;
}
.solution-icon {
  width: 56px; height: 56px; flex-shrink: 0;
  background: rgba(139,92,246,0.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 1.4em;
}
.solution-body h3 { margin-bottom: 0.4em; }
.solution-body p { color: var(--text-muted); margin: 0; font-size: 0.93em; }

/* ── Funding Bar ─────────────────────────────────── */
#funding-bar {
  background-color: var(--accent-dark, #6d28d9) !important;
  color: #ffffff !important;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10001;
  padding: 0.55em 3em 0.55em 1.5em;
  font-size: 0.82em;
  letter-spacing: 0.04em;
  text-align: center;
  box-sizing: border-box;
}
#funding-bar a, #funding-bar strong, #funding-bar span { color: #ffffff !important; }
#funding-bar button { color: rgba(255,255,255,0.85) !important; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 980px) {
  .main-nav { display: none; }
  .navbar-toggler { display: block; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg);
    padding: 1em 0;
    border-bottom: 1px solid var(--border);
    z-index: 9998;
    gap: 0;
  }
  .main-nav.open a { height: auto; padding: 0.75em 2em; }
}
@media (max-width: 768px) {
  .hero h1 { font-size: 2.1em; }
  .card-grid, 
  
  .spotlight-section { grid-template-columns: 1fr; }
  .platform-features { grid-template-columns: 1fr; }
  .platform-features.reverse { direction: ltr; }
  .stats-bar .section-inner { grid-template-columns: repeat(2,1fr); }
  #footer .inner { grid-template-columns: 1fr 1fr; padding: 0 2em; }
  .team-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
  .stats-bar .section-inner { grid-template-columns: 1fr 1fr; }
  #footer .inner { grid-template-columns: 1fr; }
  
  .hero h1 { font-size: 1.7em; }
}

/* page-top: offset for fixed nav */
.page-top {
  padding-top: var(--nav-height, 70px);
}

/* container layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === 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%;
}
