/* =========================================================
   SomaSpace Africa — Design Tokens
   Palette: Deep Blue / Emerald / Dark Slate / Gold / Neutral
   Type: Space Grotesk (display) + Inter (body) + JetBrains Mono (data)
   Signature: "weave-grid" lattice motif — a diagonal interlocking
   line pattern that reads at once as woven cloth and a circuit trace,
   used sparingly as the page's one recurring visual signature.
   ========================================================= */

:root {
  /* Color */
  --blue-900: #071B33;
  --blue-800: #0B2A4A;
  --blue-700: #123A63;
  --emerald-700: #086B4F;
  --emerald-600: #0E8F6B;
  --emerald-400: #34B889;
  --slate-950: #10141C;
  --slate-900: #161B22;
  --slate-700: #2A3140;
  --gold-500: #D8A93B;
  --gold-300: #EAC978;
  --white: #FFFFFF;
  --gray-50: #F6F8FA;
  --gray-100: #EEF1F4;
  --gray-200: #E1E6EB;
  --gray-400: #A6AFBC;
  --gray-500: #6B7688;
  --gray-700: #3B4454;

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Scale */
  --step-1: clamp(0.85rem, 0.82rem + 0.15vw, 0.95rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.1rem);
  --step-2: clamp(1.3rem, 1.2rem + 0.5vw, 1.7rem);
  --step-3: clamp(1.7rem, 1.5rem + 1vw, 2.4rem);
  --step-4: clamp(2.3rem, 1.9rem + 1.8vw, 3.6rem);
  --step-5: clamp(3rem, 2.3rem + 3vw, 5rem);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 1px 2px rgba(11, 42, 74, 0.06), 0 12px 32px -16px rgba(11, 42, 74, 0.18);
  --shadow-lift: 0 2px 4px rgba(11, 42, 74, 0.08), 0 24px 48px -20px rgba(11, 42, 74, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--gray-700);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--blue-900); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -60px; z-index: 1000;
  background: var(--blue-900); color: var(--white); padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm); transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--emerald-600);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--emerald-600);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 1.4em;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-primary {
  background: var(--emerald-600);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: var(--emerald-700); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }
.btn-outline {
  background: transparent;
  color: var(--blue-900);
  border-color: var(--gray-200);
}
.btn-outline:hover { border-color: var(--blue-800); background: var(--gray-50); }

/* ---------- Weave-grid signature motif ---------- */
.weave-divider {
  height: 46px;
  width: 100%;
  background-image: repeating-linear-gradient(115deg, var(--gold-500) 0 2px, transparent 2px 26px),
                     repeating-linear-gradient(65deg, var(--emerald-600) 0 2px, transparent 2px 26px);
  background-size: 52px 46px;
  opacity: 0.14;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 500;
  background: rgba(7, 27, 51, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--white); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--emerald-600), var(--blue-700));
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.brand-mark svg { width: 20px; height: 20px; }
.nav-primary { display: flex; align-items: center; gap: 2.2rem; }
.nav-primary a { color: rgba(255,255,255,0.82); font-size: 0.94rem; font-weight: 500; transition: color 0.2s var(--ease); }
.nav-primary a:hover { color: var(--white); }
.nav-cta { display: flex; align-items: center; gap: 0.9rem; }
.nav-toggle {
  display: none;
  background: transparent; border: 1px solid rgba(255,255,255,0.3); border-radius: 8px;
  width: 42px; height: 42px; color: var(--white); align-items: center; justify-content: center;
}

@media (max-width: 900px) {
  .nav-primary { position: fixed; top: 76px; left: 0; right: 0; background: var(--blue-900); flex-direction: column; align-items: flex-start; padding: 1.5rem clamp(1.25rem,4vw,2.5rem) 2rem; gap: 1.1rem; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-primary.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-cta .btn-outline { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 96px;
  background: radial-gradient(120% 100% at 15% -10%, #163457 0%, var(--blue-900) 45%, var(--slate-950) 100%);
  color: var(--white);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(216,169,59,0.16) 0 1.5px, transparent 1.5px 64px),
    repeating-linear-gradient(65deg, rgba(52,184,137,0.16) 0 1.5px, transparent 1.5px 64px);
  mask-image: radial-gradient(80% 70% at 70% 20%, black, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,0.7fr); gap: 3rem; align-items: center; }
.hero h1 { font-size: var(--step-5); color: var(--white); margin-top: 1rem; }
.hero h1 em { font-style: normal; background: linear-gradient(95deg, var(--gold-300), var(--emerald-400)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin-top: 1.4rem; font-size: 1.15rem; color: rgba(255,255,255,0.78); max-width: 46ch; }
.hero-actions { display: flex; gap: 1rem; margin-top: 2.4rem; flex-wrap: wrap; }
.hero-meta { margin-top: 3rem; display: flex; gap: 2.2rem; flex-wrap: wrap; }
.hero-meta div { font-family: var(--font-mono); font-size: 0.8rem; color: rgba(255,255,255,0.55); }
.hero-meta strong { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--white); font-weight: 600; }

.hero-panel {
  position: relative;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(6px);
}
.hero-panel-row { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.92rem; }
.hero-panel-row:last-child { border-bottom: none; }
.hero-panel-row span:first-child { color: rgba(255,255,255,0.6); }
.hero-panel-row span:last-child { color: var(--white); font-weight: 600; font-family: var(--font-mono); font-size: 0.85rem; }
.pill {
  display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.72rem;
  background: rgba(52,184,137,0.16); color: var(--emerald-400); font-family: var(--font-mono);
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero { padding-top: 140px; }
}

/* ---------- Section shell ---------- */
section { padding: 6.5rem 0; }
.section-head { max-width: 62ch; margin-bottom: 3rem; }
.section-head h2 { font-size: var(--step-4); margin-top: 0.75rem; }
.section-head p { margin-top: 1rem; color: var(--gray-500); font-size: 1.05rem; }
.section-alt { background: var(--gray-50); }
.section-dark { background: var(--slate-950); color: rgba(255,255,255,0.82); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark .section-head p { color: rgba(255,255,255,0.62); }

/* ---------- Definition block (AI/SEO readability) ---------- */
.definition {
  display: grid; grid-template-columns: minmax(0,0.9fr) minmax(0,1.1fr); gap: 3.5rem; align-items: start;
}
.definition-card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow-soft);
}
.definition-card dt { font-family: var(--font-mono); font-size: 0.78rem; color: var(--emerald-600); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1.25rem; }
.definition-card dt:first-child { margin-top: 0; }
.definition-card dd { margin: 0.35rem 0 0; color: var(--gray-700); font-weight: 500; }
.definition p + p { margin-top: 1.1rem; }
.definition .lede { font-size: 1.15rem; color: var(--blue-900); font-weight: 500; }

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

/* ---------- Philosophy / principle cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem; }
.principle-card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  padding: 1.6rem; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.principle-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); border-color: var(--emerald-400); }
.principle-card .icon { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--emerald-600), var(--blue-700)); display: grid; place-items: center; margin-bottom: 1rem; }
.principle-card .icon svg { width: 20px; height: 20px; color: var(--white); }
.principle-card h3 { font-size: 1.05rem; }
.principle-card p { margin-top: 0.5rem; font-size: 0.92rem; color: var(--gray-500); }

/* ---------- Why section ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 1rem; }
.why-item { border-left: 2px solid var(--gold-500); padding-left: 1.1rem; }
.why-item strong { display: block; font-family: var(--font-display); color: var(--blue-900); font-size: 1.05rem; margin-bottom: 0.3rem; }
.why-item p { font-size: 0.92rem; color: var(--gray-500); }
@media (max-width: 760px) { .why-grid { grid-template-columns: 1fr; } }

/* ---------- Products ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.product-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.9rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  overflow: hidden;
}
.product-card::after {
  content: ""; position: absolute; inset: auto -20% -30% auto; width: 160px; height: 160px;
  background-image: repeating-linear-gradient(115deg, var(--gold-500) 0 1.5px, transparent 1.5px 18px);
  opacity: 0.08; pointer-events: none; transform: rotate(8deg);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.product-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.product-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--gray-50); border: 1px solid var(--gray-200); flex-shrink: 0; }
.product-icon svg { width: 24px; height: 24px; color: var(--emerald-600); }
.status-badge {
  font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.3rem 0.6rem; border-radius: 999px; white-space: nowrap; margin-top: 0.3rem;
}
.status-badge.soon { background: #FBF1DC; color: #A6791E; }
.status-badge.available { background: #E4F5EE; color: var(--emerald-700); }
.product-card h3 { font-size: 1.2rem; }
.product-tagline { font-size: 0.88rem; color: var(--emerald-600); font-weight: 600; }
.product-desc { font-size: 0.92rem; color: var(--gray-500); }
.product-features { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.2rem; }
.product-features li {
  font-size: 0.78rem; color: var(--gray-700); background: var(--gray-50); border: 1px solid var(--gray-200);
  padding: 0.25rem 0.6rem; border-radius: 999px;
}
.product-link { margin-top: auto; font-size: 0.88rem; font-weight: 600; color: var(--blue-800); display: inline-flex; align-items: center; gap: 0.35rem; }
.product-link svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.product-card:hover .product-link svg { transform: translateX(3px); }

/* ---------- Who we serve ---------- */
.audience-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.audience-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center;
  padding: 1.4rem 0.75rem; border-radius: var(--radius-md); border: 1px solid var(--gray-200); background: var(--white);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.audience-item:hover { border-color: var(--emerald-400); transform: translateY(-2px); }
.audience-item .icon-wrap { width: 44px; height: 44px; border-radius: 50%; background: var(--gray-50); display: grid; place-items: center; }
.audience-item .icon-wrap svg { width: 22px; height: 22px; color: var(--blue-800); }
.audience-item span { font-size: 0.85rem; font-weight: 600; color: var(--blue-900); }
@media (max-width: 900px) { .audience-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .audience-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Timeline ---------- */
.timeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; position: relative; margin-top: 2.5rem; }
.timeline::before { content: ""; position: absolute; top: 22px; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.14); }
.timeline-stage { position: relative; padding-top: 3rem; padding-inline: 0.6rem; }
.timeline-stage .dot { position: absolute; top: 14px; left: 0.6rem; width: 16px; height: 16px; border-radius: 50%; background: var(--slate-950); border: 2px solid var(--gold-500); }
.timeline-stage .year { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold-300); }
.timeline-stage h3 { font-size: 1rem; margin-top: 0.4rem; color: var(--white); }
.timeline-stage p { font-size: 0.82rem; color: rgba(255,255,255,0.55); margin-top: 0.4rem; }
@media (max-width: 1100px) {
  .timeline { grid-template-columns: repeat(3, 1fr); row-gap: 2.5rem; }
  .timeline::before { display: none; }
}
@media (max-width: 760px) {
  .timeline { grid-template-columns: 1fr; gap: 2rem; }
  .timeline-stage { padding-top: 0; padding-left: 3rem; }
  .timeline-stage .dot { top: 4px; left: 15px; }
}

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 1rem; }
.stat-card { text-align: left; }
.stat-num { font-family: var(--font-mono); font-size: var(--step-4); font-weight: 700; color: var(--white); display: flex; align-items: baseline; gap: 0.15rem; }
.stat-label { font-size: 0.88rem; color: rgba(255,255,255,0.55); margin-top: 0.4rem; }
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Technology ---------- */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-top: 1rem; }
.tech-chip { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--gray-200); }
.tech-chip svg { width: 20px; height: 20px; color: var(--emerald-600); flex-shrink: 0; }
.tech-chip span { font-size: 0.9rem; font-weight: 600; color: var(--blue-900); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin-top: 1rem; border-top: 1px solid var(--gray-200); }
.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: transparent; border: none; text-align: left; padding: 1.4rem 0.25rem; font-family: var(--font-display);
  font-size: 1.02rem; color: var(--blue-900); font-weight: 600;
}
.faq-q svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.25s var(--ease); color: var(--emerald-600); }
.faq-item[open] .faq-q svg { transform: rotate(45deg); }
.faq-a { padding: 0 0.25rem 1.4rem; color: var(--gray-500); font-size: 0.95rem; max-width: 68ch; }
.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--emerald-700), var(--blue-800));
  border-radius: var(--radius-lg);
  padding: 3.5rem clamp(1.5rem, 5vw, 4rem);
  color: var(--white);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(216,169,59,0.18) 0 1.5px, transparent 1.5px 44px);
  mask-image: radial-gradient(60% 100% at 90% 50%, black, transparent);
}
.cta-band h2 { color: var(--white); font-size: var(--step-3); position: relative; }
.cta-band p { color: rgba(255,255,255,0.78); margin-top: 0.6rem; max-width: 46ch; position: relative; }
.cta-band .btn-primary { background: var(--gold-500); color: var(--blue-900); position: relative; }
.cta-band .btn-primary:hover { background: var(--gold-300); }

/* ---------- Footer ---------- */
.site-footer { background: var(--slate-950); color: rgba(255,255,255,0.6); padding: 4.5rem 0 2rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.footer-brand { flex: 1 1 220px; max-width: 260px; }
.footer-col { flex: 1 1 120px; }
.footer-brand p { margin-top: 1rem; font-size: 0.9rem; max-width: 32ch; color: rgba(255,255,255,0.5); }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.42); margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a { font-size: 0.9rem; color: rgba(255,255,255,0.68); transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--white); }
.footer-col .soon { opacity: 0.45; }
.footer-col .soon::after { content: " — soon"; font-size: 0.78rem; }
.footer-bottom { margin-top: 3.5rem; padding-top: 1.75rem; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; font-size: 0.82rem; }
.footer-bottom-links { display: flex; gap: 1.5rem; }
@media (max-width: 900px) { .footer-grid { gap: 1.5rem 2rem; } .footer-brand { flex-basis: 100%; max-width: none; } }
@media (max-width: 560px) { .footer-grid { flex-direction: column; gap: 2rem; } .footer-col { flex-basis: 100%; } }

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }