/* ==========================================================================
   Synaptech Innovations — Design System
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fc;
  --bg-raised: #ffffff;
  --text: #10121a;
  --text-soft: #565b6e;
  --text-faint: #8489a0;
  --border: #e7e9f2;
  --border-soft: #f0f1f8;

  --brand-blue: #3355ff;
  --brand-blue-dark: #1c33cc;
  --brand-orange: #ff7a1a;
  --brand-orange-soft: #fff1e6;
  --brand-blue-soft: #eaefff;
  /* Text/link color — kept separate from --brand-blue because #3355ff (used for
     gradients, borders, decorative fills) fails 4.5:1 text contrast on dark
     backgrounds. Overridden to a lighter blue below wherever the page is dark. */
  --link: var(--brand-blue);

  /* A restrained, single-hue diagonal — orange-into-blue blended muddy in the
     middle and read as loud/cheap on a button repeated across the whole site.
     Buttons stay confidently blue; orange stays reserved for badges/accents. */
  --gradient-brand: linear-gradient(135deg, #4468ff 0%, #3355ff 45%, #1c33cc 100%);
  --gradient-text: linear-gradient(120deg, #ff7a1a 0%, #3355ff 100%);

  --success: #17845a;
  --success-bg: #e8f7f0;
  --error: #c4392b;
  --error-bg: #fdecea;

  --shadow-sm: 0 1px 3px rgba(16, 18, 26, 0.06), 0 1px 2px rgba(16, 18, 26, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 18, 26, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 18, 26, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --container: 1180px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html.dark-mode {
  --bg: #0a0c14;
  --bg-soft: #10131e;
  --bg-raised: #151928;
  --text: #f3f4f9;
  --text-soft: #b3b7cc;
  --text-faint: #8b90a8;
  --border: #262b40;
  --border-soft: #1c2032;
  --brand-blue-soft: #182047;
  --brand-orange-soft: #2b1d10;
  --link: #9db2ff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 24px 56px rgba(0,0,0,0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) {
    --bg: #0a0c14;
    --bg-soft: #10131e;
    --bg-raised: #151928;
    --text: #f3f4f9;
    --text-soft: #b3b7cc;
    --text-faint: #8b90a8;
    --border: #262b40;
    --border-soft: #1c2032;
    --brand-blue-soft: #182047;
    --brand-orange-soft: #2b1d10;
    --link: #9db2ff;
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--brand-blue); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { color: var(--text-soft); }

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  border-bottom: 1px solid var(--border);
}
/* The blur lives on a ::before (not on .site-header itself) because backdrop-filter
   on an ancestor creates a new containing block for fixed-position descendants —
   which would trap the fixed mobile nav panel inside the header's own box. */
.site-header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-name { color: var(--text); }

.main-nav ul { display: flex; gap: 28px; }
.main-nav a { font-size: 0.94rem; font-weight: 600; color: var(--text-soft); transition: color 0.15s; }
.main-nav a:hover { color: var(--link); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-raised); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--brand-blue); }

.nav-toggle {
  display: none; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-raised); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

@media (max-width: 900px) {
  .main-nav {
    position: fixed; inset: 64px 0 0 0; background: var(--bg); padding: 28px 24px;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all 0.2s ease;
    overflow-y: auto; z-index: 150;
  }
  .main-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--border-soft); }
  .nav-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-pill); font-weight: 700; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-brand); color: #fff;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-secondary { background: var(--bg-raised); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--brand-blue); color: var(--link); }
.btn-ghost-invert { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost-invert:hover { background: rgba(255,255,255,0.22); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------------- Hero ---------------- */
.hero { padding: 64px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero-center .hero-inner { grid-template-columns: 1fr; text-align: center; }
.hero-inner:has(> .hero-copy:only-child) { grid-template-columns: 1fr; }
.hero-inner:has(> .hero-copy:only-child) .hero-subtitle { max-width: 760px; }
.hero-center .hero-actions { justify-content: center; }
.hero-center .breadcrumbs ol { justify-content: center; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--text-faint); margin-bottom: 18px; }
.breadcrumbs a { color: var(--text-faint); }
.breadcrumbs a:hover { color: var(--link); }
.breadcrumbs li[aria-current] { color: var(--text-soft); font-weight: 600; }

.badge {
  display: inline-block; background: var(--brand-blue-soft); color: var(--brand-blue-dark);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 7px 14px; border-radius: var(--radius-pill); margin-bottom: 18px;
}
html.dark-mode .badge { color: var(--link); }

.hero h1 { margin-bottom: 18px; }
.hero-subtitle { font-size: 1.15rem; max-width: 620px; margin-bottom: 8px; }
.hero-center .hero-subtitle { margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-visual { display: flex; align-items: center; justify-content: center; }
.neural-svg { width: 100%; max-width: 380px; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions, .breadcrumbs ol { justify-content: center; }
  .hero-visual { order: -1; max-width: 240px; margin: 0 auto; }
}

/* ---------------- Stats ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 40px 0; }
.stat-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 22px 20px; box-shadow: var(--shadow-sm);
}
.stat-icon { font-size: 1.6rem; margin-bottom: 10px; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.stat-label { font-size: 0.88rem; font-weight: 700; color: var(--text-soft); margin-top: 2px; }
.stat-note { font-size: 0.82rem; margin-top: 6px; color: var(--text-faint); }
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- Sections ---------------- */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-soft); }
.section-header { max-width: 680px; margin-bottom: 40px; }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-eyebrow { color: var(--link); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.section-subtitle { margin-top: 12px; font-size: 1.05rem; }

/* ---------------- Card grid ---------------- */
.card-grid { display: grid; gap: 20px; }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .card-grid.cols-4, .card-grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .card-grid.cols-4, .card-grid.cols-3, .card-grid.cols-2 { grid-template-columns: 1fr; } }

.info-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 26px; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-blue); }
.info-card-icon { font-size: 1.7rem; margin-bottom: 12px; }
.info-card h3 { margin-bottom: 8px; font-size: 1.08rem; }
.info-card p { font-size: 0.94rem; }
.info-card-link { display: inline-block; margin-top: 12px; font-weight: 700; color: var(--link); font-size: 0.9rem; }

/* ---------------- Instructors ---------------- */
.instructor-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 960px) { .instructor-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .instructor-grid { grid-template-columns: 1fr; } }

.instructor-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.instructor-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.instructor-card-body { padding: 20px; }
.instructor-card h3 { margin-bottom: 2px; }
.instructor-title { color: var(--link); font-weight: 700; font-size: 0.88rem; margin-bottom: 10px; }
.instructor-short { font-size: 0.92rem; }
.instructor-focus { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.instructor-card:not(.compact) { grid-column: span 1; }
.instructor-card-body p + p { margin-top: 12px; font-size: 0.94rem; }

.chip {
  background: var(--brand-orange-soft); color: #a0480a; font-size: 0.78rem; font-weight: 700;
  padding: 5px 12px; border-radius: var(--radius-pill);
}
html.dark-mode .chip { color: #ffb87a; }

/* ---------------- FAQ ---------------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: none; text-align: left; padding: 20px 4px; font-weight: 700; font-size: 1rem; color: var(--text); cursor: pointer;
}
.faq-icon { font-size: 1.4rem; color: var(--link); flex-shrink: 0; transition: transform 0.2s ease; }
.faq-item.is-open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-item.is-open .faq-answer { max-height: 480px; }
.faq-answer p { padding: 0 4px 20px; font-size: 0.95rem; }

/* ---------------- CTA banner ---------------- */
.cta-banner { background: linear-gradient(120deg, #1a1f3d, #12143a 55%, #2a1440); padding: 56px 0; margin: 0; }
.cta-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-banner h2 { color: #fff; }
.cta-banner p { color: #c7cbe8; margin-top: 8px; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------- Lead form ---------------- */
.lead-form-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow-lg); max-width: 560px; margin: 0 auto;
}
.lead-form-card.compact { max-width: none; box-shadow: var(--shadow-md); }
.lead-form-sub { font-size: 0.92rem; margin-bottom: 20px; }
.form-row { margin-bottom: 16px; }
.form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .form-row-2col { grid-template-columns: 1fr; } }
label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; font-weight: 500; margin-bottom: 18px; }
.consent-row input { width: auto; margin-top: 3px; }
.form-status { margin-top: 14px; font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--error); }
.form-fineprint { font-size: 0.78rem; color: var(--text-faint); margin-top: 10px; font-weight: 400; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 480px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
th { background: var(--bg-soft); font-weight: 700; }
tr:last-child td { border-bottom: none; }

/* ---------------- Article / long-form content ---------------- */
.article-layout { display: grid; grid-template-columns: 1fr 240px; gap: 48px; padding: 48px 0 72px; align-items: start; }
.article-body { max-width: 720px; }
.article-body h2 { margin-top: 44px; margin-bottom: 14px; }
.article-body h3 { margin-top: 30px; margin-bottom: 10px; }
.article-body p { margin-bottom: 16px; font-size: 1.02rem; }
.article-body ul, .article-body ol { margin: 0 0 18px 22px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; color: var(--text-soft); }
.article-body a:not(.info-card-link) { color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.article-body strong { color: var(--text); }
.article-body pre { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 20px; overflow-x: auto; margin: 8px 0 24px; }
.article-body pre code { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text); line-height: 1.6; }
.article-body :not(pre) > code { font-family: var(--font-mono); background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-faint); font-size: 0.88rem; margin-bottom: 8px; }
.article-byline { display: flex; align-items: center; gap: 10px; margin: 20px 0 32px; padding: 16px; background: var(--bg-soft); border-radius: var(--radius-md); }
.article-byline img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.article-byline .byline-meta { font-size: 0.85rem; color: var(--text-faint); }
.article-byline .byline-meta strong { color: var(--text); display: block; font-size: 0.95rem; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } .toc { display: none; } }

.toc { position: sticky; top: 96px; border-left: 2px solid var(--border); padding-left: 18px; }
.toc-title { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 12px; }
.toc ol { display: flex; flex-direction: column; gap: 10px; }
.toc a { font-size: 0.88rem; color: var(--text-soft); }
.toc a:hover { color: var(--link); }

.callout { border-radius: var(--radius-md); padding: 18px 20px; margin: 24px 0; border: 1px solid var(--border); }
.callout p { margin: 0; font-size: 0.95rem; }
.callout-info { background: var(--brand-blue-soft); border-color: transparent; }
.callout-tip { background: var(--brand-orange-soft); border-color: transparent; }

/* ---------------- Blog / resource cards ---------------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; height: 100%; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-cluster { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-orange); margin-bottom: 10px; }
.post-card h3 { margin-bottom: 10px; font-size: 1.1rem; }
.post-card p { font-size: 0.92rem; flex-grow: 1; }
.post-meta { display: flex; gap: 8px; font-size: 0.8rem; color: var(--text-faint); margin-top: 14px; }

/* ---------------- Timeline (curriculum) ---------------- */
.session-list { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
.session-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px 24px; }
.session-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.session-num { background: var(--gradient-brand); color: #fff; font-weight: 800; font-size: 0.78rem; padding: 4px 12px; border-radius: var(--radius-pill); }
.session-card h3 { font-size: 1.05rem; }
.session-hours { margin-left: auto; font-size: 0.82rem; color: var(--text-faint); font-weight: 700; }
.session-card ul { margin: 10px 0 0 20px; list-style: disc; }
.session-card li { font-size: 0.92rem; color: var(--text-soft); margin-bottom: 4px; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 56px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; padding-bottom: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { font-size: 0.88rem; margin-top: 12px; }
.footer-tagline { font-weight: 700; color: var(--text); }
.footer-email { display: inline-block; margin-top: 12px; font-weight: 700; color: var(--link); }
.footer-col h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 0.9rem; color: var(--text-soft); }
.footer-col a:hover { color: var(--link); }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-faint); }

/* ---------------- Misc page sections ---------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.icon-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.icon-list li { display: flex; gap: 12px; font-size: 0.96rem; color: var(--text-soft); }
.icon-list .ico { color: var(--success); font-weight: 800; }

.dot-divider { color: var(--border); margin: 0 6px; }

.center-text { text-align: center; }
.mt-lg { margin-top: 48px; }
