/* CogniPulse — Dark Premium AI Platform */
:root {
  --bg-void: #09090B;
  --text-on-dark: #FAFAFA;
  --bg-panel: #18181B;
  --bg-zinc: #27272A;
  --text-on-zinc: #FAFAFA;
  --bg-accent: #7C3AED;
  --text-on-accent: #FAFAFA;
  --bg-muted: #3F3F46;
  --sidebar-width: 260px;
  --font-headline: 'Outfit', system-ui, sans-serif;
  --font-body: 'JetBrains Mono', ui-monospace, monospace;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body.site-cognipulse {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-on-dark);
  background: var(--bg-void);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); font-weight: 600; }

p { margin: 0 0 1rem; }

a {
  color: #FAFAFA;
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: #D4D4D8; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Surface system */
.surface-dark { background: #09090B; color: #FAFAFA; }
.surface-zinc { background: #27272A; color: #FAFAFA; }
.surface-panel { background: #18181B; color: #FAFAFA; }
.surface-accent { background: #7C3AED; color: #FAFAFA; }
.surface-dark *, .surface-zinc *, .surface-panel *, .surface-accent * { color: inherit; }

/* White text on all dark backgrounds */
:is(
  .surface-dark,
  .surface-zinc,
  .surface-panel,
  .metrics-section,
  .cta-band,
  .page-hero,
  .hero-cinematic,
  .site-footer,
  .sidebar-nav,
  .cookie-banner,
  .disclaimer-block,
  .module-card,
  .mosaic-card,
  .pulse-card,
  .form-surface,
  .error-page,
  .legal-prose,
  .faq-item
) :is(
  h1, h2, h3, h4, h5, h6,
  p, li, span, label, strong, em,
  .eyebrow, .pulse-tag, .module-price, .serial-tag,
  .stat-number, .stat-label, .hero-sub, .manifesto-statement
) {
  color: #FAFAFA;
}

:is(
  .surface-dark,
  .surface-zinc,
  .surface-panel,
  .metrics-section,
  .cta-band,
  .page-hero,
  .hero-cinematic,
  .site-footer,
  .sidebar-nav,
  .cookie-banner,
  .disclaimer-block,
  .module-card,
  .mosaic-card,
  .pulse-card,
  .form-surface,
  .error-page,
  .legal-prose,
  .faq-item
) a:not(.btn) {
  color: #FAFAFA;
}

:is(
  .surface-dark,
  .surface-zinc,
  .surface-panel,
  .metrics-section,
  .cta-band,
  .page-hero,
  .hero-cinematic,
  .site-footer,
  .sidebar-nav,
  .cookie-banner,
  .disclaimer-block,
  .module-card,
  .mosaic-card,
  .pulse-card,
  .form-surface,
  .error-page,
  .legal-prose,
  .faq-item
) a:not(.btn):hover {
  color: #D4D4D8;
}

/* Sidebar */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--bg-zinc);
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.3s ease;
}

.sidebar-nav .sidebar-logo {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-on-dark);
  margin-bottom: 2.5rem;
  letter-spacing: -0.02em;
}

.sidebar-nav .sidebar-logo span { color: #FAFAFA; }

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li { margin-bottom: 0.25rem; }

.sidebar-nav a {
  display: block;
  padding: 0.65rem 0.75rem;
  color: var(--text-on-dark);
  font-size: 0.9rem;
  border-radius: 2px;
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
  background: var(--bg-zinc);
  border-left-color: var(--bg-accent);
  color: var(--text-on-dark);
}

.sidebar-nav .sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.75rem;
  opacity: 0.7;
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.75);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-scrim.is-visible {
  display: block;
  opacity: 1;
}

/* Shell */
.cognipulse-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

/* Header */
.cognipulse-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bg-zinc);
}

.cognipulse-header.is-solid {
  background: var(--bg-void);
}

.cognipulse-header .header-wordmark {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-on-dark);
}

.cognipulse-header .header-wordmark span { color: #FAFAFA; }

.sidebar-toggle {
  background: none;
  border: 2px solid var(--bg-accent);
  border-radius: 2px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-on-dark);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle svg { width: 24px; height: 24px; }

/* Hero Pattern B */
.hero-cinematic {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-cinematic.hero-compact { min-height: 72vh; }

.hero-cinematic .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-cinematic .hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9,9,11,0.99) 0%, rgba(9,9,11,0.88) 40%, rgba(9,9,11,0.68) 100%);
  z-index: 1;
}

.hero-cinematic .hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 2rem 4rem;
  max-width: 720px;
}

.hero-cinematic .hero-content .eyebrow {
  color: #FAFAFA;
}

.hero-cinematic .hero-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
  background: var(--bg-panel);
  color: var(--text-on-dark);
  padding: 12px 20px;
  font-size: 0.8rem;
  border-radius: 2px;
  border-left: 3px solid var(--bg-accent);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: #FAFAFA;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.serial-tag {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  max-width: 560px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  min-height: 44px;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--bg-accent);
  color: var(--text-on-accent);
}

.btn-primary:hover {
  background: #6D28D9;
  color: var(--text-on-accent);
}

.btn-outline {
  background: transparent;
  color: var(--text-on-dark);
  border: 2px solid var(--bg-accent);
}

.btn-outline:hover {
  background: rgba(124, 58, 237, 0.15);
  color: var(--text-on-dark);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Sections */
section, .page-section {
  padding: 5rem 2rem;
}

@media (max-width: 767px) {
  section, .page-section { padding: 3rem 1.25rem; }
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 3rem;
  max-width: 720px;
}

.manifesto-statement {
  font-family: var(--font-headline);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.3;
}

/* Metrics strip */
.metrics-section {
  background: #09090B;
  color: #FAFAFA;
}

.metrics-section * {
  color: inherit;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.metrics-strip .stat-block {
  background: #18181B;
  padding: 2rem 1.5rem;
  border-radius: 2px;
  border: 1px solid #27272A;
  border-left: 3px solid var(--bg-accent);
}

.metrics-strip .stat-block .stat-number,
.metrics-strip .stat-block .stat-label {
  color: #FAFAFA;
}

.stat-block .stat-number {
  font-family: var(--font-headline);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-block .stat-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1.5rem;
}

.card-grid-3x2 { grid-template-columns: repeat(3, 1fr); }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }

.pulse-card {
  background: #18181B;
  border-radius: 2px;
  padding: 2rem;
  border: 1px solid #27272A;
  border-left: 3px solid var(--bg-accent);
  transition: box-shadow var(--transition), transform var(--transition);
  color: #FAFAFA;
}

.pulse-card:hover {
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.25);
  transform: translateY(-2px);
}

.pulse-card h3,
.pulse-card p,
.pulse-card .pulse-tag {
  color: #FAFAFA;
}

.pulse-card .pulse-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.pulse-card svg {
  width: 32px;
  height: 32px;
  margin-bottom: 1rem;
  stroke: #FAFAFA;
}

/* Architecture panel */
.arch-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.arch-diagram svg { width: 100%; max-width: 480px; }

.photo-frame {
  border: 3px solid var(--bg-accent);
  border-radius: 2px;
  overflow: hidden;
}

.photo-frame img { width: 100%; }

/* Programme mosaic */
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.mosaic-card {
  background: var(--bg-panel);
  border-radius: 2px;
  padding: 2rem;
  border-left: 3px solid var(--bg-accent);
  color: #FAFAFA;
}

.mosaic-card .pulse-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  color: #FAFAFA;
  opacity: 0.9;
}

.mosaic-card a {
  color: #FAFAFA;
}

.mosaic-card a:hover {
  color: #D4D4D8;
}

.mosaic-card:nth-child(1) { grid-column: span 5; }
.mosaic-card:nth-child(2) { grid-column: span 4; margin-top: 2rem; }
.mosaic-card:nth-child(3) { grid-column: span 3; margin-top: 4rem; }

/* FAQ split */
.faq-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.faq-item {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--bg-muted);
}

.faq-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* CTA band */
.cta-band {
  text-align: center;
  padding: 4rem 2rem;
  background: #09090B;
  color: #FAFAFA;
}

.cta-band.surface-accent {
  background: #09090B;
  color: #FAFAFA;
}

.cta-band h2,
.cta-band p,
.cta-band * {
  color: #FAFAFA;
}

.cta-band h2 { margin-bottom: 1rem; }

.cta-band p {
  max-width: 560px;
  margin: 0 auto 2rem;
}

.cta-band .angular-divider {
  background: #FAFAFA;
}

.cta-band .btn-outline {
  border-color: #FAFAFA;
  color: #FAFAFA;
}

.cta-band .btn-outline:hover {
  background: rgba(250, 250, 250, 0.1);
  color: #FAFAFA;
}

.angular-divider {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 2rem;
  height: 2px;
  background: var(--text-on-accent);
  clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}

/* Page hero (inner pages) */
.page-hero {
  padding: 4rem 2rem 3rem;
  border-bottom: 1px solid var(--bg-zinc);
}

.page-hero .section-inner { max-width: 800px; }

/* Disclaimer */
.disclaimer-block {
  padding: 1.5rem;
  border-left: 3px solid var(--bg-accent);
  background: var(--bg-panel);
  font-size: 0.9rem;
  margin: 2rem 0;
  color: #FAFAFA;
}

.disclaimer-block strong {
  color: #FAFAFA;
}

/* Footer */
.site-footer {
  padding: 4rem 2rem 2rem;
  border-top: 1px solid var(--bg-zinc);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 2rem;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #FAFAFA;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li { margin-bottom: 0.5rem; }

.footer-col a { color: #FAFAFA; opacity: 0.85; }
.footer-col a:hover { opacity: 1; color: #D4D4D8; }

.footer-disclaimer {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-zinc);
  font-size: 0.8rem;
  opacity: 0.8;
}

.footer-hosting {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 1rem;
}

/* Forms */
.form-surface {
  background: var(--bg-panel);
  padding: 2rem;
  border-radius: 2px;
  border: 1px solid var(--bg-zinc);
  color: #FAFAFA;
}

.form-surface label,
.form-surface a {
  color: #FAFAFA;
}

.form-surface a:hover {
  color: #D4D4D8;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-void);
  border: 1px solid var(--bg-zinc);
  border-radius: 2px;
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--bg-accent);
}

.form-group textarea { min-height: 140px; resize: vertical; }

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-check input { width: auto; margin-top: 0.25rem; }

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.form-success {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--bg-accent);
  padding: 1rem;
  border-radius: 2px;
  margin-bottom: 1.5rem;
  color: #FAFAFA;
}

.form-success strong {
  color: #FAFAFA;
}

/* About layout */
.about-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.metric-rail {
  position: sticky;
  top: 2rem;
}

.metric-rail .stat-block {
  background: #18181B;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid #27272A;
  border-left: 3px solid var(--bg-accent);
  border-radius: 2px;
  color: #FAFAFA;
}

.metric-rail .stat-block .stat-number,
.metric-rail .stat-block .stat-label {
  color: #FAFAFA;
}

.metric-rail .portrait-frame {
  max-width: 200px;
}

.metric-rail .portrait-frame img {
  width: 100%;
  height: auto;
}

/* Programme / service lists */
.module-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  background: var(--bg-panel);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--bg-accent);
  border-radius: 2px;
  color: #FAFAFA;
}

.module-card .pulse-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  color: #FAFAFA;
  opacity: 0.9;
}

.module-card .module-price {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: #FAFAFA;
}

/* Legal prose */
.legal-prose {
  color: #FAFAFA;
}

.legal-prose h2,
.legal-prose h3,
.legal-prose p,
.legal-prose li,
.legal-prose a {
  color: #FAFAFA;
}

.legal-prose a:hover {
  color: #D4D4D8;
}

.legal-prose h2 { margin-top: 2.5rem; }
.legal-prose h3 { margin-top: 1.5rem; }
.legal-prose ul, .legal-prose ol { margin: 0 0 1rem 1.5rem; }
.legal-prose li { margin-bottom: 0.5rem; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--bg-zinc);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}

.cookie-banner.is-hidden { display: none; }

.cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-inner p {
  margin: 0;
  flex: 1;
  min-width: 240px;
  font-size: 0.85rem;
  color: #FAFAFA;
}

.cookie-inner a {
  color: #FAFAFA;
}

.cookie-inner a:hover {
  color: #D4D4D8;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cookie-customise-panel {
  width: 100%;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-zinc);
}

.cookie-customise-panel.is-hidden { display: none; }

/* Dashboard showcase */
.dashboard-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 3rem;
}

.dashboard-showcase .eyebrow {
  color: #FAFAFA;
}

.dashboard-showcase img {
  border-radius: 2px;
  border: 1px solid var(--bg-zinc);
}

/* Scroll reveal */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* 404 */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}

/* Responsive */
@media (max-width: 1023px) {
  .sidebar-nav {
    transform: translateX(-100%);
  }

  .sidebar-nav.is-open {
    transform: translateX(0);
  }

  .cognipulse-shell {
    margin-left: 0;
  }

  .cognipulse-header {
    display: flex;
  }

  .hero-cinematic { min-height: 72vh; }
  .hero-cinematic .hero-badge { top: 80px; right: 16px; font-size: 0.7rem; padding: 8px 12px; }
}

@media (max-width: 767px) {
  .metrics-strip { grid-template-columns: 1fr; gap: 1.5rem; }
  .card-grid-3x2, .card-grid-2, .card-grid-3 { grid-template-columns: 1fr; }
  .arch-split, .faq-split, .about-split, .dashboard-showcase { grid-template-columns: 1fr; }
  .mosaic-grid { grid-template-columns: 1fr; }
  .mosaic-card:nth-child(n) { grid-column: span 1; margin-top: 0; }
  .module-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; }
}

@media (min-width: 1024px) {
  .cognipulse-header { display: none; }
  .sidebar-scrim { display: none !important; }
}
