/* ============================================================
   SSAIT Design System v1.0 (SSA-1498 W1)
   + Homepage build (SSA-1511 W4)
   Tokens-only colour source. No hex outside this file.
   ============================================================ */

:root {
  /* Palette — base */
  --color-graphite-950: #0D0F12;
  --color-graphite-900: #131619;
  --color-graphite-800: #1C2027;
  --color-graphite-700: #252B34;
  --color-graphite-600: #3A4250;
  --color-steel-500:   #2A6496;
  --color-steel-400:   #3B82C4;
  --color-steel-300:   #1E4E78;
  --color-cyan-400:    #22D3EE;
  --color-cyan-300:    #67E8F9;
  --color-slate-200:   #CBD5E1;
  --color-slate-100:   #E2E8F0;
  --color-white:       #F8FAFC;

  /* Semantic */
  --bg-page:        var(--color-graphite-950);
  --bg-surface:     var(--color-graphite-900);
  --bg-elevated:    var(--color-graphite-800);
  --border-default: var(--color-graphite-700);
  --border-muted:   var(--color-graphite-600);
  --text-primary:   var(--color-white);
  --text-secondary: var(--color-slate-200);
  --text-tertiary:  var(--color-slate-100);
  --accent:         var(--color-steel-400);
  --accent-active:  var(--color-cyan-400);
  --success:        #22C55E;
  --warning:        #F59E0B;
  --danger:         #EF4444;

  /* Typography families */
  --font-display: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    Inter, system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Type scale */
  --type-h1:      clamp(2.5rem, 5vw, 3.5rem);
  --type-h2:      clamp(1.75rem, 3.5vw, 2.5rem);
  --type-h3:      1.75rem;
  --type-h4:      1.25rem;
  --type-body-lg: 1.125rem;
  --type-body:    1rem;
  --type-body-sm: 0.875rem;
  --type-mono:    0.8125rem;
  --type-eyebrow: 0.75rem;

  /* Motion */
  --duration-instant: 80ms;
  --duration-fast:    150ms;
  --duration-base:    250ms;
  --duration-enter:   400ms;
  --duration-node:    600ms;
  --duration-pulse:   2400ms;
  --ease-out:         cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:      cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --shell-max:      1200px;
  --gutter:         clamp(20px, 5vw, 48px);
  --radius-sm:      6px;
  --radius-md:      8px;
  --radius-lg:      12px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Base
   ============================================================ */

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

html { scroll-behavior: smooth; }

body.homepage-2026 {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.homepage-2026 h1,
body.homepage-2026 h2,
body.homepage-2026 h3,
body.homepage-2026 h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

body.homepage-2026 a { color: var(--accent); text-decoration: none; }
body.homepage-2026 a:hover,
body.homepage-2026 a:focus-visible { color: var(--accent-active); }

body.homepage-2026 a:focus-visible,
body.homepage-2026 button:focus-visible {
  outline: 2px solid var(--accent-active);
  outline-offset: 2px;
}

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--type-eyebrow);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-active);
  margin: 0 0 12px 0;
}

.section-heading { max-width: 760px; margin: 0 auto 48px; }
.section-heading h2 { font-size: var(--type-h2); font-weight: 700; }
.section-heading p.lead {
  font-size: var(--type-body-lg);
  color: var(--text-secondary);
  margin: 16px 0 0;
  max-width: 56ch;
}
.section-heading.section-heading-left { margin-left: 0; margin-right: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--type-body-sm);
  line-height: 1;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-in-out),
              border-color var(--duration-fast) var(--ease-in-out),
              color var(--duration-fast) var(--ease-in-out),
              transform var(--duration-fast) var(--ease-out);
}
.btn-primary {
  background: var(--accent);
  color: var(--text-primary);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-steel-500);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--color-steel-300);
  transform: translateY(0);
}
.btn-secondary {
  background: transparent;
  color: var(--text-tertiary);
  border-color: var(--border-muted);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 8px 0;
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--accent-active);
  text-decoration: underline;
}

/* System-state chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--bg-page);
  border: 1px solid var(--accent-active);
  color: var(--accent-active);
  font-family: var(--font-mono);
  font-size: var(--type-eyebrow);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-active);
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse var(--duration-pulse) var(--ease-linear, linear) infinite;
}
.chip.chip-op { color: var(--success); border-color: var(--success); }
.chip.chip-op::before { background: var(--success); animation: none; }
.chip.chip-review { color: var(--warning); border-color: var(--warning); }
.chip.chip-review::before { background: var(--warning); animation: none; }
.chip.chip-inactive {
  color: var(--text-secondary);
  border-color: var(--border-muted);
  background: var(--bg-surface);
}
.chip.chip-inactive::before { background: var(--border-muted); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 0.5; box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.45); }
  50%      { opacity: 1;   box-shadow: 0 0 0 6px rgba(34, 211, 238, 0); }
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
}
.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 24px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
}
.site-brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-active));
  flex-shrink: 0;
}
.site-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.site-brand-text small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--type-mono);
  color: var(--text-secondary);
  letter-spacing: 0;
}
.site-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
.site-nav a {
  font-size: var(--type-body-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.site-nav a:hover { color: var(--text-primary); }

@media (max-width: 840px) {
  .site-nav { display: none; }
}

/* ============================================================
   Section: 1 — Hero
   ============================================================ */

.hero {
  position: relative;
  padding: clamp(64px, 10vw, 120px) 0 clamp(48px, 8vw, 96px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy h1 {
  font-size: var(--type-h1);
  font-weight: 800;
  line-height: 1.1;
}
.hero-copy .lead {
  font-size: var(--type-body-lg);
  color: var(--text-secondary);
  max-width: 56ch;
  margin: 20px 0 32px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual {
  position: relative;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 32px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-default) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-default) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.18;
  pointer-events: none;
}
.hero-visual > * { position: relative; z-index: 1; }
.hero-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-visual-caption {
  font-size: var(--type-body-sm);
  color: var(--text-secondary);
  max-width: 36ch;
  margin: 0;
}

/* Signature graphic slot (W3 fills this; fallback shown until then) */
.signature-graphic-slot {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  min-height: 280px;
}
.signature-graphic-slot[data-w3-loaded="false"] .signature-fallback { display: block; }
.signature-graphic-slot[data-w3-loaded="true"]  .signature-fallback { display: none; }
.signature-fallback {
  width: 100%;
  height: 100%;
  max-width: 480px;
}
.signature-fallback svg { width: 100%; height: auto; display: block; }

/* Topology SVG — token-driven colours */
.topology-svg .t-grid       { stroke: var(--border-default); opacity: 0.45; stroke-width: 1; }
.topology-svg .t-edge       { stroke: var(--accent-active); stroke-width: 1.5;
                              stroke-linecap: round; stroke-dasharray: 4 3; fill: none; }
.topology-svg .t-node       { fill: var(--bg-surface); stroke: var(--accent); stroke-width: 1.5; }
.topology-svg .t-node-label { font-family: var(--font-mono); font-size: 10px; fill: var(--text-primary); }
.topology-svg .t-node-label.t-cyan { fill: var(--accent-active); }
.topology-svg .t-chip-bg    { fill: var(--bg-surface); stroke: var(--accent-active); stroke-width: 1; }
.topology-svg .t-chip-dot   { fill: var(--accent-active); }
.topology-svg .t-chip-label { font-family: var(--font-mono); font-size: 9px; fill: var(--accent-active); }

.hero-microlabels {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero-microlabels li {
  font-family: var(--font-mono);
  font-size: var(--type-mono);
  color: var(--text-secondary);
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 380px; padding: 20px; }
}

/* ============================================================
   Section: 3 — Trust strip
   ============================================================ */

.trust-strip {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  padding: 24px 0;
}
.trust-strip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  justify-content: space-between;
  align-items: center;
}
.trust-claim {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--type-body-sm);
  color: var(--text-primary);
  font-weight: 500;
}
.trust-claim svg { color: var(--accent); flex-shrink: 0; }

.trust-evidence {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.trust-evidence-item {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 16px;
}
.trust-evidence-item p {
  margin: 0;
  font-size: var(--type-body-sm);
  color: var(--text-secondary);
}
.trust-evidence-item strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 4px;
}

@media (max-width: 880px) {
  .trust-strip-row { gap: 16px 32px; }
  .trust-evidence { grid-template-columns: 1fr; }
}

/* ============================================================
   Generic sections
   ============================================================ */

.section {
  padding: clamp(64px, 9vw, 112px) 0;
  position: relative;
}
.section-contrast { background: var(--bg-elevated); }

/* ============================================================
   Section: 4 — Services / solution cards
   ============================================================ */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service-card {
  --tilt-rotate-x: 0deg;
  --tilt-rotate-y: 0deg;
  --tilt-scale: 1;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 32px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: perspective(1000px) rotateX(var(--tilt-rotate-x)) rotateY(var(--tilt-rotate-y)) scale(var(--tilt-scale));
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-in-out),
              box-shadow var(--duration-base) var(--ease-in-out);
}
.service-card:hover {
  transform: perspective(1000px) rotateX(var(--tilt-rotate-x)) rotateY(var(--tilt-rotate-y)) scale(var(--tilt-scale)) translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.service-card-icon {
  width: 64px;
  height: 64px;
  color: var(--accent);
}
.service-card-icon svg { width: 100%; height: 100%; }
.service-card h3 {
  font-size: var(--type-h3);
  font-weight: 700;
}
.service-problem {
  font-size: var(--type-body-sm);
  font-style: italic;
  color: var(--text-secondary);
  margin: 0;
}
.service-response { margin: 0; color: var(--text-tertiary); }
.service-outcome {
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-default);
  font-size: var(--type-body-sm);
  color: var(--text-primary);
}
.service-outcome strong { color: var(--accent-active); font-weight: 600; }

@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Section: 5 — How SSAIT works (4-step)
   ============================================================ */

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
.process-step {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 28px;
}
.process-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--accent-active);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 16px;
}
.process-step h3 {
  font-size: var(--type-h4);
  font-weight: 600;
  margin-bottom: 8px;
}
.process-step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-sm);
}

@media (max-width: 960px) { .process-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .process-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Section: 6 — Proof panels (W5 pending)
   ============================================================ */

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.proof-panel {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 28px 32px;
}
.proof-panel[data-pending="proof-content"] { opacity: 0.92; }
.proof-panel[data-pending="proof-content"]::after {
  content: "Awaiting W5 finalisation";
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: var(--type-mono);
  color: var(--warning);
  letter-spacing: 0.04em;
}
.proof-panel h4 {
  font-family: var(--font-body);
  font-size: var(--type-eyebrow);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-active);
  margin: 0 0 6px;
}
.proof-panel p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: var(--type-body-sm);
}
.proof-panel p:last-child { margin-bottom: 0; }
.proof-panel .proof-result {
  color: var(--text-primary);
  font-weight: 500;
  font-size: var(--type-body);
}

@media (max-width: 960px) { .proof-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Section: 7 — Governance (4 sub-blocks)
   ============================================================ */

.governance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.governance-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.governance-block-num {
  font-family: var(--font-mono);
  font-size: var(--type-mono);
  color: var(--accent-active);
  letter-spacing: 0.06em;
}
.governance-block h3 {
  font-size: var(--type-h4);
  font-weight: 600;
}
.governance-block p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-sm);
}

@media (max-width: 720px) { .governance-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Section: 8 — Leadership / founder
   ============================================================ */

.leadership-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px);
}
.leadership-portrait {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 30% 30%, var(--color-steel-500), var(--bg-elevated) 60%);
  border: 1px solid var(--border-default);
  display: grid;
  place-items: center;
  color: var(--accent-active);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
}
.leadership-copy h3 {
  font-size: var(--type-h3);
  font-weight: 700;
  margin-bottom: 12px;
}
.leadership-statement {
  font-size: var(--type-body-lg);
  color: var(--text-secondary);
  margin: 0 0 20px;
}
.leadership-sectors {
  font-family: var(--font-mono);
  font-size: var(--type-mono);
  color: var(--text-tertiary);
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent);
  margin-bottom: 20px;
}
.leadership-actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 720px) {
  .leadership-card { grid-template-columns: 1fr; text-align: left; }
  .leadership-portrait { max-width: 200px; }
}

/* ============================================================
   Section: 9 — Segmented CTA footer
   ============================================================ */

.cta-footer {
  background: var(--bg-page);
  padding: clamp(80px, 10vw, 128px) 0 clamp(48px, 6vw, 80px);
  text-align: center;
  border-top: 1px solid var(--border-default);
}
.cta-footer .section-heading { margin-left: auto; margin-right: auto; }
.cta-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: left;
  margin-top: 32px;
}
.cta-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--duration-base) var(--ease-in-out),
              transform var(--duration-base) var(--ease-out);
}
.cta-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.cta-card h3 {
  font-size: var(--type-h4);
  font-weight: 600;
}
.cta-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-sm);
}
.cta-card .btn { margin-top: auto; align-self: flex-start; }

@media (max-width: 880px) { .cta-cards { grid-template-columns: 1fr; } }

/* ============================================================
   Site footer
   ============================================================ */

.site-footer {
  background: var(--bg-page);
  border-top: 1px solid var(--border-default);
  padding: 48px 0;
  color: var(--text-secondary);
  font-size: var(--type-body-sm);
}
.site-footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--text-primary); }
