/* CogniBlueprint — Site B Design System */
:root {
  --bg-dark: #0C1A24;
  --text-on-dark: #F0FDFA;
  --bg-light: #F0FDFA;
  --text-on-light: #0C1A24;
  --bg-accent: #14B8A6;
  --text-on-accent: #0C1A24;
  --bg-slate: #152A38;
  --text-on-slate: #F0FDFA;
  --teal: #14B8A6;
  --font-head: 'Sora', sans-serif;
  --font-body: 'Nunito Sans', sans-serif;
  --max-width: 1200px;
  --header-h: 72px;
  --radius: 2px;
  --card-border: 2px dashed #14B8A6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-on-light);
  background: var(--bg-light);
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  font-weight: 700;
}

.surface-dark { background: var(--bg-dark); color: var(--text-on-dark); }
.surface-light { background: var(--bg-light); color: var(--text-on-light); }
.surface-accent { background: var(--bg-accent); color: var(--text-on-dark); }
.surface-slate { background: var(--bg-slate); color: var(--text-on-slate); }

.surface-dark a, .surface-light a, .surface-slate a { color: currentColor; }

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.section { padding: 4.5rem 0; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

.surface-dark .eyebrow,
.surface-slate .eyebrow--light,
.page-hero.surface-dark .eyebrow {
  color: var(--text-on-dark);
}

.surface-light .eyebrow,
.eyebrow--dark {
  color: var(--text-on-light);
}

.surface-accent .eyebrow,
.surface-accent .stat-num,
.surface-accent .blueprint-stats,
.surface-accent h2,
.surface-accent p,
.surface-accent .cta-band h2,
.surface-accent .cta-band p {
  color: var(--text-on-dark);
}

.page-hero.surface-dark h1,
.page-hero.surface-dark p {
  color: var(--text-on-dark);
}

.grid-divider {
  display: block;
  width: 100%;
  height: 32px;
  margin: 1.5rem 0;
}

.grid-divider svg { width: 100%; height: 100%; }

/* Header */
.cb-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  height: var(--header-h);
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(20, 184, 166, 0.25);
}

.cb-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.cb-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-on-dark);
}

.logo-grid { width: 36px; height: 36px; flex-shrink: 0; }

.cb-logo span {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.menu-trigger {
  position: relative;
  background: none;
  border: 2px solid var(--teal);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1.25rem;
  min-width: 6.5rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.menu-trigger .label-menu,
.menu-trigger .label-close {
  display: inline-block;
  transition: opacity 0.25s, transform 0.25s;
}

.menu-trigger .label-close {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

body.menu-open .menu-trigger .label-menu {
  opacity: 0;
  transform: scale(0.85);
}

body.menu-open .menu-trigger .label-close {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Fullscreen overlay menu */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  clip-path: circle(0% at calc(100% - 3rem) 3rem);
  transition: clip-path 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  visibility: hidden;
}

body.menu-open .menu-overlay,
.menu-overlay.is-closing {
  visibility: visible;
}

body.menu-open .menu-overlay {
  clip-path: circle(150% at calc(100% - 3rem) 3rem);
  pointer-events: auto;
}

.menu-overlay.is-closing {
  pointer-events: none;
}

.overlay-nav {
  list-style: none;
  text-align: center;
  padding: 0;
}

.overlay-nav a {
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  text-decoration: none;
  color: var(--text-on-dark);
  display: block;
  padding: 0.35rem 1rem;
}

.overlay-nav a:hover { color: var(--teal); }

.overlay-nav li {
  opacity: 1;
  transform: none;
}

.js .overlay-nav li {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.menu-open .overlay-nav li {
  opacity: 1;
  transform: none;
}

body.menu-open .overlay-nav li:nth-child(1) { transition-delay: 0.08s; }
body.menu-open .overlay-nav li:nth-child(2) { transition-delay: 0.14s; }
body.menu-open .overlay-nav li:nth-child(3) { transition-delay: 0.2s; }
body.menu-open .overlay-nav li:nth-child(4) { transition-delay: 0.26s; }
body.menu-open .overlay-nav li:nth-child(5) { transition-delay: 0.32s; }
body.menu-open .overlay-nav li:nth-child(6) { transition-delay: 0.38s; }
body.menu-open .overlay-nav li:nth-child(7) { transition-delay: 0.44s; }

.menu-overlay.is-closing .overlay-nav li {
  opacity: 0;
  transform: translateY(24px);
  transition-delay: 0s !important;
}

.overlay-tags {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* Static nav fallback (no JS) */
.static-nav {
  display: none;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(20, 184, 166, 0.2);
  margin-top: var(--header-h);
}

.static-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.static-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

html:not(.js) .static-nav { display: block; }

html:not(.js) .menu-overlay {
  position: static;
  clip-path: none;
  visibility: visible;
  pointer-events: auto;
  padding: 2rem 1rem;
  min-height: auto;
}

html:not(.js) .menu-trigger { display: none; }

html:not(.js) body { padding-top: 0; }

/* Hero Pattern L */
.hero-l {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 28%;
  margin-top: var(--header-h);
  overflow: hidden;
}

.hero-l-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(20, 184, 166, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.4) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hero-l-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2rem 10rem 4.5rem;
}

.hero-l-stack h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  max-width: 640px;
}

.hero-sub {
  margin-top: 1.25rem;
  max-width: 560px;
  font-size: 1.05rem;
  opacity: 0.9;
}

.hero-ctas {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-l-strip {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

.hero-l-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}

.metric-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(12, 26, 36, 0.92);
  border-top: 2px dashed var(--teal);
  color: var(--text-on-dark);
}

.ticker-cell {
  padding: 1rem 1.25rem;
  border-right: 1px solid rgba(20, 184, 166, 0.2);
  font-size: 0.85rem;
}

.ticker-cell:last-child { border-right: none; }

.ticker-val {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-on-dark);
  display: block;
}

.ticker-thumb {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 0.35rem;
  border: 1px solid rgba(20, 184, 166, 0.4);
}

/* Buttons */
.btn-cb {
  display: inline-block;
  padding: 14px 28px;
  background: var(--teal);
  color: var(--text-on-dark);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-head);
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
}

a.btn-cb,
button.btn-cb {
  color: var(--text-on-dark);
}

.surface-accent .btn-cb {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border: 2px solid var(--text-on-dark);
}

.btn-cb-outline {
  display: inline-block;
  padding: 14px 28px;
  background: transparent;
  color: var(--text-on-dark);
  border: 2px solid var(--teal);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius);
}

/* Cards */
.cb-card {
  background: var(--bg-slate);
  color: var(--text-on-slate);
  padding: 2rem;
  border: var(--card-border);
  border-radius: var(--radius);
}

.surface-light .cb-card {
  background: var(--bg-light);
  color: var(--text-on-light);
}

/* Manifesto */
.manifesto {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  max-width: 900px;
}

/* Blueprint counter */
.blueprint-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  text-align: center;
}

.stat-num {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
}

/* Layer panels */
.layer-panels { margin-top: 2rem; }

.layer-panel {
  border-bottom: 1px solid rgba(20, 184, 166, 0.25);
  padding: 1rem 0;
}

.layer-panel-trigger {
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.layer-panel-trigger::after {
  content: '+';
  color: var(--teal);
  font-size: 1.5rem;
  font-weight: 400;
}

.layer-panel.is-open .layer-panel-trigger::after { content: '−'; }

.layer-panel-body { margin-top: 1rem; padding-bottom: 1rem; }

.layer-panel-body ul { list-style: none; padding: 0; }

.layer-panel-body li {
  padding: 0.35rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--teal);
  margin-bottom: 0.5rem;
}

.js .layer-panel-body { display: none; }
.js .layer-panel.is-open .layer-panel-body { display: block; }

.layer-panel-img {
  margin-top: 1rem;
  border: var(--card-border);
  border-radius: var(--radius);
}

/* Architecture split */
.arch-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-top: 2rem;
}

.arch-svg-frame {
  border: var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg-dark);
}

.arch-photo {
  border: var(--card-border);
  border-radius: var(--radius);
}

/* Integration grid 2x3 */
.int-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 2rem;
}

.int-cell {
  padding: 2rem 1.5rem;
  border: var(--card-border);
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

.int-cell:hover {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.surface-dark .int-cell {
  border-color: rgba(240, 253, 250, 0.35);
}

.surface-dark .int-cell span {
  color: var(--text-on-dark);
  opacity: 0.85;
}

.int-cell span {
  display: block;
  font-size: 0.75rem;
  color: var(--teal);
  margin-bottom: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* FAQ accordion */
.faq-acc-item { border-bottom: 1px solid rgba(20, 184, 166, 0.25); }

.faq-acc-trigger {
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  padding: 1.25rem 0;
  text-align: left;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.faq-num {
  font-weight: 800;
  color: var(--teal);
  min-width: 2rem;
}

.faq-acc-body { padding: 0 0 1.25rem 3rem; }

.js .faq-acc-item:not(.is-open) .faq-acc-body { display: none; }

/* CTA band */
.cta-band {
  text-align: center;
  padding: 4rem 2rem;
}

.cta-band h2 { margin-bottom: 1rem; }

.cta-band p { max-width: 560px; margin: 0 auto 2rem; }

/* Page hero */
.page-hero {
  margin-top: var(--header-h);
  padding: 4rem 0 3rem;
}

.page-hero h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-top: 0.75rem; }

/* Footer */
.cb-footer { padding: 3rem 0 2rem; }

.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-col h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--teal);
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 0.5rem; }

.footer-col a { text-decoration: none; opacity: 0.9; }

.footer-col a:hover { color: var(--teal); }

.contact-ribbon {
  padding: 1.25rem 1.5rem;
  border: var(--card-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-align: center;
}

.ai-disclaimer {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.75;
  max-width: 720px;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid rgba(12, 26, 36, 0.15);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg-light);
}

.form-group textarea { min-height: 140px; }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.consent input { width: auto; margin-top: 0.25rem; }

.sent-alert {
  display: none;
  padding: 1rem 1.25rem;
  background: rgba(20, 184, 166, 0.15);
  border: var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

/* About / split layouts */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-portrait {
  max-width: 280px;
  width: 100%;
  height: auto;
}

.prog-meta {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--text-on-light);
}

.prog-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(12, 26, 36, 0.1);
  align-items: start;
}

.prog-row img {
  border: var(--card-border);
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  object-fit: cover;
}

.svc-card {
  padding: 2rem;
  border: var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.svc-card img {
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  height: auto;
}

.legal-content { max-width: 780px; }

.legal-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.legal-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.legal-content p,
.legal-content li { margin-bottom: 1rem; }

.legal-content ul { padding-left: 1.5rem; }

.legal-meta {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 2rem;
}

.faq-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

.faq-sidebar img {
  border: var(--card-border);
  border-radius: var(--radius);
}

.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: var(--header-h);
  padding: 2rem;
}

.error-code {
  font-family: var(--font-head);
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 2px solid var(--teal);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

.cookie-banner.is-hidden { display: none; }

.cookie-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.cookie-btn-accept {
  background: var(--teal);
  color: var(--text-on-dark);
  padding: 0.55rem 1.1rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  font-family: var(--font-body);
}

.cookie-btn-reject,
.cookie-btn-customise,
.cookie-btn-save {
  background: transparent;
  border: 2px solid var(--teal);
  color: inherit;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  font-family: var(--font-body);
}

.cookie-customise-panel {
  width: 100%;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(20, 184, 166, 0.3);
}

.cookie-customise-panel label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Scroll reveal */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-l { grid-template-columns: 1fr; }
  .hero-l-main { padding: 3rem 1.5rem 10rem 2rem; }
  .hero-l-strip { min-height: 240px; order: -1; }
  .metric-ticker { grid-template-columns: repeat(2, 1fr); }
  .blueprint-stats,
  .footer-cols,
  .arch-split,
  .about-split,
  .prog-row,
  .faq-layout { grid-template-columns: 1fr; }
  .int-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .int-grid { grid-template-columns: 1fr; }
  .metric-ticker { grid-template-columns: 1fr; }
}
