/* ================================================================
   TryAICode - main.css
   Accent: #10b981 (emerald), Theme: dark
================================================================ */

:root {
  --bg: #0a0f19;
  --surface: #111827;
  --surface2: #1a2332;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #10b981;
  --accent-dark: #059669;
  --border: rgba(255,255,255,0.08);
  --radius: 12px;
  --gap: 2.5em;
  --nav-height: 4.5em;
  --funding-bar-h: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  margin: 0; padding: 0;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #34d399; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.15; color: #fff; margin-top: 0; }
p { margin-top: 0; }

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

/* Navigation */
#nav {
  display: flex !important; flex-direction: row !important;
  align-items: center !important; justify-content: flex-start !important;
  padding: 0 2.5em !important;
  position: fixed !important;
  top: var(--funding-bar-h, 0px) !important;
  left: 0 !important; right: 0 !important; width: 100% !important;
  min-height: var(--nav-height) !important;
  z-index: 9999 !important;
  background-color: rgba(10,15,25,0.97) !important;
  border-bottom: 1px solid var(--border) !important;
  box-sizing: border-box !important;
  transition: top 0.3s ease !important;
}
#nav .logo {
  flex-shrink: 0 !important; display: flex !important;
  align-items: center !important; margin-right: auto !important;
}
#nav .logo img { height: 38px !important; width: auto !important; display: block; }
#nav > ul {
  display: flex !important; flex-direction: row !important;
  align-items: center !important; list-style: none !important;
  margin: 0 !important; padding: 0 !important;
}
#nav > ul > li > a {
  display: flex !important; align-items: center !important;
  height: var(--nav-height) !important; padding: 0 1.1em !important;
  color: rgba(255,255,255,0.72) !important;
  font-size: 0.7em !important; letter-spacing: 0.18em !important;
  text-transform: uppercase !important; white-space: nowrap !important;
  transition: color 0.2s !important;
}
#nav > ul > li > a:hover,
#nav > ul > li.active > a { color: var(--accent) !important; }
@media screen and (max-width: 980px) { #nav > ul { display: none !important; } }

/* Page wrapper */
#page-wrapper { padding-top: calc(var(--nav-height) + var(--funding-bar-h, 44px)); }
body.page-top #page-wrapper { padding-top: calc(var(--nav-height) + 0px); }

/* Container */
.container {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2em; width: 100%; box-sizing: border-box;
}

/* Hero */
.hero-section, #hero, #banner {
  background-size: cover; background-position: center; background-repeat: no-repeat;
  background-color: rgba(10,15,40,0.35); background-blend-mode: multiply;
  position: relative; min-height: 600px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 5em 2em; overflow: hidden;
}
.hero-section::after, #hero::after, #banner::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 0; pointer-events: none;
}
.hero-section > *, #hero > *, #banner > * { position: relative; z-index: 2; }
#index-hero { background-image: url('../images/hero-main.jpg'); }
.hero-inner { max-width: 860px; margin: 0 auto; }
.hero-section h1 {
  font-size: clamp(2rem,5vw,3.6rem); font-weight: 800; color: #fff;
  margin-bottom: 0.5em; line-height: 1.1;
}
.hero-section p { font-size: 1.18em; color: rgba(255,255,255,0.82) !important; margin-bottom: 2em; }
.hero-btns { display: flex; gap: 1em; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; justify-content: center; gap: 3em; margin-top: 3em; flex-wrap: wrap; }
.hero-stat .number { font-size: 2.2em; font-weight: 800; color: var(--accent); display: block; }
.hero-stat .label { font-size: 0.82em; color: rgba(255,255,255,0.72); letter-spacing: 0.06em; }

/* Buttons */
.btn-primary {
  display: inline-block; background: var(--accent); color: #fff !important;
  padding: 0.75em 2.2em; border-radius: 8px; font-weight: 700; font-size: 0.95em;
  border: none; cursor: pointer; transition: background 0.2s, transform 0.15s; text-decoration: none;
}
.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.85) !important;
  padding: 0.75em 2.2em; border-radius: 8px; font-weight: 600; font-size: 0.95em;
  border: 2px solid rgba(255,255,255,0.35); cursor: pointer;
  transition: border-color 0.2s, color 0.2s; text-decoration: none;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent) !important; }

/* Sections */
.section { padding: 6em 2em; }
.section-dark { background-color: var(--surface); }
.section-darker { background-color: var(--surface2); }
.section-title { text-align: center; margin-bottom: 3.5em; }
.section-title .tag {
  display: inline-block; background: rgba(16,185,129,0.12); color: var(--accent);
  font-size: 0.75em; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 0.35em 1em; border-radius: 30px; margin-bottom: 0.8em; font-weight: 700;
}
.section-title h2 { font-size: clamp(1.7rem,3.5vw,2.6rem); margin-bottom: 0.5em; }
.section-title p { color: var(--text-muted); max-width: 640px; margin: 0 auto; font-size: 1.05em; }

/* Cards Grid */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: var(--gap); align-items: stretch;
}
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 2.2em; border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: border-color 0.25s, transform 0.2s;
}
.card:hover { border-color: rgba(16,185,129,0.35); transform: translateY(-4px); }
.card-icon {
  width: 52px; height: 52px; background: rgba(16,185,129,0.12); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.2em; color: var(--accent); font-size: 1.4em;
}
.card h3 { font-size: 1.1em; margin-bottom: 0.5em; }
.card p { color: var(--text-muted); font-size: 0.92em; line-height: 1.65; flex: 1; }

/* Advantages */
.advantages-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.8em; }
.advantage-item { display: flex; gap: 1em; align-items: flex-start; }
.advantage-num {
  width: 36px; height: 36px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8em; font-weight: 800; color: #fff; flex-shrink: 0;
}
.advantage-item h4 { font-size: 0.98em; margin-bottom: 0.25em; }
.advantage-item p { color: var(--text-muted); font-size: 0.88em; margin: 0; }
@media (max-width: 768px) {  }

/* Stats Bar */
.stats-bar { background: linear-gradient(135deg, #059669 0%, #10b981 60%, #34d399 100%); padding: 4em 2em; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 2em; max-width: 1100px; margin: 0 auto; text-align: center; }
.stat-item .num { font-size: 2.5em; font-weight: 800; color: #fff; display: block; }
.stat-item .lbl { font-size: 0.85em; color: rgba(255,255,255,0.82); letter-spacing: 0.05em; }
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }

/* CTA */
.cta-section {
  background: linear-gradient(135deg, var(--surface2) 0%, rgba(16,185,129,0.08) 100%);
  text-align: center; padding: 6em 2em; border-top: 1px solid var(--border);
}
.cta-section h2 { font-size: clamp(1.6rem,3vw,2.4rem); margin-bottom: 0.5em; color: #fff; }
.cta-section p { color: rgba(255,255,255,0.78) !important; max-width: 560px; margin: 0 auto 2em; }

/* About Page hero */
body.page-about .hero-section { background-image: url('../images/about-hero.jpg'); }

/* Spotlight / Story */
.spotlight-section {
  display: grid; grid-template-columns: 3fr 2fr; gap: 4em;
  align-items: start; max-width: 1100px; margin: 0 auto; padding: 4em 2em;
}
@media (max-width: 768px) { .spotlight-section { grid-template-columns: 1fr; } }
.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; }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 2.5em; }
.team-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 2.2em 1.5em; text-align: center; border: 1px solid var(--border);
  transition: border-color 0.25s, transform 0.2s;
}
.team-card:hover { border-color: rgba(16,185,129,0.35); transform: translateY(-3px); }
.team-card img {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; object-position: 50% 10%;
  display: block; margin: 0 auto 1.2em;
}
.team-card h3 { font-size: 1.05em; margin-bottom: 0.2em; }
.team-role { color: var(--accent); font-size: 0.82em; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 0.7em; display: block; }
.team-card .bio { color: var(--text-muted); font-size: 0.88em; line-height: 1.6; margin: 0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 4em; align-items: start; }
@media (max-width: 768px) {  }
.contact-item { display: flex; align-items: flex-start; gap: 1em; margin-bottom: 1.5em; }
.contact-item-icon {
  width: 40px; height: 40px; background: rgba(16,185,129,0.12); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0;
}
.contact-item-text h4 { font-size: 0.82em; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.2em; }
.contact-item-text p { color: var(--text); font-size: 0.95em; margin: 0; }
.contact-form-box { background: var(--surface); border-radius: var(--radius); padding: 2.5em; border: 1px solid var(--border); }
.form-group { margin-bottom: 1.5em; }
.form-group label { display: block; font-size: 0.85em; color: var(--text-muted); margin-bottom: 0.5em; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75em 1em; color: var(--text);
  font-size: 0.95em; outline: none; transition: border-color 0.2s; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 140px; resize: vertical; }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 2.5em; }
.blog-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.25s, transform 0.2s;
}
.blog-card:hover { border-color: rgba(16,185,129,0.35); transform: translateY(-4px); }
.card-thumb { aspect-ratio: 16/9; width: 100%; overflow: hidden; background: var(--surface2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.blog-card-body { padding: 1.8em; flex: 1; display: flex; flex-direction: column; }
.tag { display: inline-block; background: rgba(16,185,129,0.12); color: var(--accent); font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.25em 0.7em; border-radius: 4px; margin-bottom: 0.75em; }
.tag.funding { background: var(--accent); color: #fff; }
.blog-card h3 { font-size: 1em; margin-bottom: 0.5em; line-height: 1.4; }
.blog-card h3 a { color: #fff; }
.blog-card h3 a:hover { color: var(--accent); }
.blog-card .excerpt { color: var(--text-muted); font-size: 0.88em; line-height: 1.6; flex: 1; margin-bottom: 1em; }
.blog-meta { font-size: 0.78em; color: var(--text-muted); margin-top: auto; }
.article-card.pinned { border-left: 3px solid var(--accent); background: rgba(16,185,129,0.04); }

/* Article */
.article-hero-img { width: 100%; overflow: hidden; border-radius: 8px; margin-bottom: 2em; }
.article-hero-img img { width: 100%; aspect-ratio: 16/9; object-fit: cover; object-position: center; display: block; }
.article-content { max-width: 820px; margin: 0 auto; }
.article-content h1 { font-size: clamp(1.6rem,3.5vw,2.4rem); margin-bottom: 0.4em; }
.article-content h2 { font-size: 1.4em; margin-top: 2em; margin-bottom: 0.5em; color: #fff; }
.article-content h3 { font-size: 1.15em; margin-top: 1.5em; color: #fff; }
.article-content p { color: var(--text); margin-bottom: 1.3em; font-size: 1.02em; line-height: 1.8; }
.article-content ul, .article-content ol { color: var(--text); padding-left: 1.5em; margin-bottom: 1.3em; }
.article-content li { margin-bottom: 0.4em; line-height: 1.7; }
.article-meta { color: var(--text-muted); font-size: 0.85em; margin-bottom: 2em; display: flex; gap: 1.5em; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 0.4em; color: var(--accent); font-size: 0.88em; margin-bottom: 2em; }

/* Legal */
.legal-content { max-width: 820px; margin: 0 auto; }
.legal-content h1 { font-size: 2em; margin-bottom: 0.3em; }
.legal-content h2 { font-size: 1.3em; margin-top: 2em; margin-bottom: 0.5em; color: #fff; }
.legal-content p { color: var(--text); margin-bottom: 1.2em; line-height: 1.8; }
.legal-content ul { color: var(--text); padding-left: 1.5em; margin-bottom: 1.2em; }
.legal-content li { margin-bottom: 0.4em; }
.legal-content .last-updated { color: var(--text-muted); font-size: 0.85em; margin-bottom: 2.5em; }

/* Features Page */
.features-list { display: flex; flex-direction: column; gap: 4em; }
.feature-item { display: grid; grid-template-columns: 1fr 1fr; gap: 4em; align-items: center; }
.feature-item.reverse { direction: rtl; }
.feature-item.reverse > * { direction: ltr; }
@media (max-width: 768px) { .feature-item, .feature-item.reverse { grid-template-columns: 1fr; direction: ltr; } }
.feature-img-wrap { width: 100%; overflow: hidden; border-radius: var(--radius); }
.feature-img-wrap img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.feature-text h2 { font-size: 1.6em; margin-bottom: 0.5em; }
.feature-text p { color: var(--text-muted); margin-bottom: 1.2em; }

/* Cookie Banner */
#cookie-banner {
  background: var(--surface2); color: var(--text); padding: 1.2em 2em;
  border-top: 1px solid var(--border); align-items: center;
  justify-content: space-between; gap: 1em;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 10003; flex-wrap: wrap;
}
#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; }
#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: #fff; font-size: 0.95em; font-weight: 700; margin: 0 0 1em; letter-spacing: 0.05em; text-transform: uppercase; }
#footer 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: #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; padding: 0 1em; } }
@media (max-width: 480px) { #footer .inner { grid-template-columns: 1fr; } }

/* Responsive */
@media (max-width: 768px) {  .hero-stats { gap: 2em; } }
@media (max-width: 600px) { .section { padding: 4em 1.5em; } .container { padding: 0 1.2em; } }

/* Utility */
.text-accent { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 2em !important; }
.text-center { text-align: center; }
.badge { display: inline-block; background: rgba(16,185,129,0.12); color: var(--accent); font-size: 0.75em; padding: 0.3em 0.9em; border-radius: 20px; font-weight: 600; }
/* === 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%;
}
