/* ===================================================================
   SAMOS.co.za — Design System
   Independent educational resource on the South African Multiple
   Option Settlement (SAMOS) system.
   =================================================================== */

:root {
  /* Brand palette — banking / finance */
  --c-navy-900: #0a2540;
  --c-navy-800: #122f4f;
  --c-navy-700: #1b3a5e;
  --c-navy-600: #284b73;
  --c-gold-500: #c9a96e;
  --c-gold-600: #b08f54;
  --c-gold-100: #f6efe1;
  --c-ink: #0f172a;
  --c-text: #1f2937;
  --c-muted: #5b6776;
  --c-line: #e5e8ee;
  --c-bg: #ffffff;
  --c-bg-alt: #f7f9fc;
  --c-bg-soft: #eef2f8;
  --c-success: #0f8a5f;
  --c-warning: #b97a00;
  --c-danger: #b3261e;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Scale */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, .12);
  --max-w: 1200px;
  --max-w-prose: 760px;
  --transition: 200ms cubic-bezier(.4,.0,.2,1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--c-navy-700); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-gold-600); text-decoration: underline; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin-bottom: .35rem; }
hr { border: 0; border-top: 1px solid var(--c-line); margin: 2rem 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--c-navy-900);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 .75rem;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 2.25rem; }
h3 { font-size: 1.25rem; margin-top: 1.75rem; }
h4 { font-size: 1.05rem; margin-top: 1.25rem; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.container-prose { max-width: var(--max-w-prose); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-tight { padding: clamp(2rem, 4vw, 3rem) 0; }
.bg-alt { background: var(--c-bg-alt); }
.bg-soft { background: var(--c-bg-soft); }
.text-muted { color: var(--c-muted); }
.text-center { text-align: center; }

/* ===== Topbar / Notice ===== */
.topbar {
  background: var(--c-navy-900);
  color: #cfdbe9;
  font-size: .82rem;
  padding: .55rem 0;
  text-align: center;
}
.topbar strong { color: var(--c-gold-500); }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem;
  max-width: var(--max-w); margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  font-weight: 800; font-size: 1.25rem; color: var(--c-navy-900);
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; color: var(--c-navy-900); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--c-navy-800), var(--c-navy-600));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: .85rem; letter-spacing: .05em;
  box-shadow: 0 4px 10px rgba(10,37,64,.25);
}
.brand-mark span { color: var(--c-gold-500); }
.brand-meta { font-size: .68rem; color: var(--c-muted); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; display: block; line-height: 1; }

.nav-links { display: flex; gap: 1.4rem; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--c-navy-800); font-weight: 500; font-size: .94rem;
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--c-navy-900); border-bottom-color: var(--c-gold-500); text-decoration: none;
}
.nav-toggle {
  display: none; background: none; border: 1px solid var(--c-line);
  border-radius: 8px; padding: .45rem .55rem; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--c-navy-900); margin: 4px 0; border-radius: 2px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--c-navy-900); color: #fff; }
.btn-primary:hover { background: var(--c-navy-700); color: #fff; text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.btn-gold { background: var(--c-gold-500); color: var(--c-navy-900); }
.btn-gold:hover { background: var(--c-gold-600); color: var(--c-navy-900); text-decoration: none; }
.btn-outline { border-color: var(--c-line); color: var(--c-navy-800); background: #fff; }
.btn-outline:hover { border-color: var(--c-navy-800); color: var(--c-navy-900); text-decoration: none; }
.btn-sm { padding: .55rem 1rem; font-size: .85rem; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(201,169,110,.18), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(40,75,115,.55), transparent 60%),
    linear-gradient(135deg, #061a2e 0%, #0a2540 55%, #122f4f 100%);
  color: #f4f6fa;
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(3.5rem, 6vw, 5rem);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(201,169,110,.12); color: var(--c-gold-500);
  padding: .35rem .85rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid rgba(201,169,110,.3);
  margin-bottom: 1.25rem;
}
.hero h1 { color: #fff; max-width: 880px; margin-bottom: 1rem; }
.hero h1 .accent { color: var(--c-gold-500); }
.hero-lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #c8d2dd; max-width: 720px; margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }

.hero-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; max-width: 880px;
  background: rgba(255,255,255,.05); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg); padding: 1.5rem;
}
.hero-stat { text-align: left; }
.hero-stat-value { display: block; font-size: 1.5rem; font-weight: 800; color: var(--c-gold-500); }
.hero-stat-label { display: block; font-size: .82rem; color: #b9c4d2; margin-top: .15rem; }

/* ===== Quick Answer box (AEO) ===== */
.quick-answer {
  background: linear-gradient(135deg, #f6efe1 0%, #fbf6ea 100%);
  border-left: 4px solid var(--c-gold-500);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.quick-answer h3 {
  margin: 0 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--c-gold-600);
}
.quick-answer p:last-child { margin-bottom: 0; }

/* ===== Cards / Feature grid ===== */
.card-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: #fff; border: 1px solid var(--c-line);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfd6e2; }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--c-bg-soft); color: var(--c-navy-800);
  display: grid; place-items: center; margin-bottom: 1rem;
  font-size: 1.25rem;
}
.card h3 { margin: 0 0 .4rem; font-size: 1.1rem; }
.card p { margin: 0; color: var(--c-muted); font-size: .95rem; }

/* ===== How-it-works steps ===== */
.steps {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  counter-reset: step;
}
.step {
  background: #fff; border: 1px solid var(--c-line);
  border-radius: var(--radius-lg); padding: 1.5rem; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -16px; left: 1.25rem;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-navy-900); color: var(--c-gold-500);
  display: grid; place-items: center; font-weight: 800;
  box-shadow: 0 4px 10px rgba(10,37,64,.25);
}
.step h3 { margin-top: .5rem; font-size: 1.05rem; }
.step p { margin: 0; font-size: .92rem; color: var(--c-muted); }

/* ===== Comparison table ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--c-line); }
table.compare {
  width: 100%; border-collapse: collapse; background: #fff; font-size: .94rem;
}
table.compare th, table.compare td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--c-line); }
table.compare thead { background: var(--c-navy-900); color: #fff; }
table.compare th { font-weight: 600; }
table.compare tbody tr:nth-child(even) { background: var(--c-bg-alt); }
table.compare tbody tr:last-child td { border-bottom: 0; }
table.compare td:first-child { font-weight: 600; color: var(--c-navy-800); }

/* ===== FAQ ===== */
.faq-list { display: grid; gap: .75rem; }
.faq {
  background: #fff; border: 1px solid var(--c-line);
  border-radius: var(--radius); overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer;
  padding: 1rem 1.25rem; font-weight: 600; color: var(--c-navy-900);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--c-gold-600); transition: transform var(--transition); }
.faq[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 1.25rem 1.1rem; color: var(--c-text); }
.faq-body p:last-child { margin: 0; }

/* ===== Latest articles ===== */
.posts-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.post-card {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  overflow: hidden; transition: all var(--transition);
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfd6e2; }
.post-card-img {
  height: 160px;
  background: linear-gradient(135deg, var(--c-navy-800), var(--c-navy-600));
  position: relative; overflow: hidden;
  display: grid; place-items: center; color: var(--c-gold-500);
  font-size: 2.5rem;
}
.post-card-img::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 28px 28px;
}
.post-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.post-card-cat {
  font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--c-gold-600); margin-bottom: .5rem;
}
.post-card h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
.post-card h3 a { color: var(--c-navy-900); }
.post-card p { font-size: .9rem; color: var(--c-muted); margin: 0 0 1rem; flex: 1; }
.post-card .read-more { font-size: .85rem; font-weight: 600; color: var(--c-navy-800); }
.post-card .read-more::after { content: " →"; transition: transform var(--transition); display: inline-block; }
.post-card:hover .read-more::after { transform: translateX(3px); }

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: .85rem; color: var(--c-muted); padding: 1rem 0;
}
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.breadcrumb li::after { content: "›"; margin-left: .35rem; color: var(--c-muted); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--c-navy-700); }

/* ===== Article (blog post) ===== */
.article-header {
  background: linear-gradient(135deg, #061a2e 0%, #0a2540 100%);
  color: #fff; padding: 3rem 0 2.5rem;
}
.article-header .container-prose { max-width: 820px; }
.article-cat {
  display: inline-block; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--c-gold-500); margin-bottom: .75rem;
}
.article-header h1 { color: #fff; margin-bottom: .75rem; }
.article-meta { font-size: .88rem; color: #b9c4d2; }
.article-meta span + span::before { content: "•"; margin: 0 .5rem; color: var(--c-gold-500); }

.article-body {
  padding: 2.5rem 0 3rem;
}
.article-body .container-prose { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) {
  .article-body .container-prose { grid-template-columns: 220px 1fr; max-width: 1100px; }
}
.toc {
  position: sticky; top: 90px; align-self: start;
  font-size: .88rem; border-left: 2px solid var(--c-line); padding-left: 1rem;
}
.toc h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); margin: 0 0 .75rem; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: .4rem; line-height: 1.4; }
.toc a { color: var(--c-navy-700); }
.toc a:hover { color: var(--c-gold-600); }

.prose h2 { padding-top: .5rem; }
.prose h2:first-of-type { padding-top: 0; margin-top: 0; }
.prose ul li, .prose ol li { margin-bottom: .5rem; }
.prose blockquote {
  margin: 1.5rem 0; padding: 1rem 1.25rem;
  border-left: 4px solid var(--c-gold-500); background: var(--c-bg-alt);
  color: var(--c-navy-800); font-style: italic; border-radius: 0 var(--radius) var(--radius) 0;
}
.prose code { background: var(--c-bg-soft); padding: .15em .4em; border-radius: 4px; font-size: .92em; }
.key-points {
  background: var(--c-bg-alt); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin: 1.5rem 0;
}
.key-points h3 { margin-top: 0; font-size: 1rem; color: var(--c-navy-900); }
.key-points ul { margin-bottom: 0; }

.related-posts {
  background: var(--c-bg-alt); border-top: 1px solid var(--c-line);
  padding: 3rem 0;
}
.related-posts h2 { margin-top: 0; }

/* ===== Footer ===== */
.site-footer {
  background: var(--c-navy-900); color: #cfd6e2;
  padding: 3rem 0 1.5rem; margin-top: 0;
}
.footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
}
.footer-col h4 {
  color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em;
  margin: 0 0 1rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .55rem; font-size: .92rem; }
.footer-col a { color: #cfd6e2; }
.footer-col a:hover { color: var(--c-gold-500); }
.footer-about { font-size: .92rem; color: #b9c4d2; max-width: 360px; }
.footer-about .brand { color: #fff; margin-bottom: .75rem; }
.footer-disclaimer {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 2.5rem; padding-top: 1.25rem;
  font-size: .8rem; color: #97a3b3;
}
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  margin-top: 1rem; font-size: .82rem; color: #97a3b3;
}
.footer-bottom a { color: #b9c4d2; }

/* ===== Misc helpers ===== */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 600;
  background: var(--c-bg-soft); color: var(--c-navy-800);
  padding: .2rem .55rem; border-radius: 999px; letter-spacing: .04em;
}
.section-head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.section-head .eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700;
  color: var(--c-gold-600); letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .75rem;
}
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--c-muted); font-size: 1.05rem; }

.cta-banner {
  background: linear-gradient(135deg, #0a2540 0%, #1b3a5e 100%);
  color: #fff; padding: 3rem 2rem; border-radius: var(--radius-lg);
  text-align: center; position: relative; overflow: hidden;
}
.cta-banner h2 { color: #fff; margin-top: 0; }
.cta-banner p { color: #cfd6e2; max-width: 580px; margin: 0 auto 1.5rem; }

/* ===== Forms (contact) ===== */
.form { display: grid; gap: 1rem; max-width: 560px; }
.form label { font-weight: 600; font-size: .9rem; color: var(--c-navy-800); display: block; margin-bottom: .35rem; }
.form input, .form textarea, .form select {
  width: 100%; padding: .75rem .9rem;
  border: 1px solid var(--c-line); border-radius: var(--radius);
  font: inherit; color: var(--c-text); background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--c-navy-700);
  box-shadow: 0 0 0 3px rgba(40,75,115,.15);
}
.form textarea { min-height: 140px; resize: vertical; }

/* ===== Blog index ===== */
.blog-hero { background: var(--c-navy-900); color: #fff; padding: 3rem 0 2.5rem; }
.blog-hero h1 { color: #fff; }
.blog-hero p { color: #cfd6e2; max-width: 640px; }
.silo-section { margin-bottom: 3rem; }
.silo-section h2 { display: flex; align-items: center; gap: .75rem; }
.silo-section h2::before {
  content: ""; width: 32px; height: 3px; background: var(--c-gold-500); border-radius: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: #fff; border-top: 1px solid var(--c-line); padding: .5rem 1.25rem 1rem; }
  .nav-links.is-open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: .75rem 0; border-bottom: 1px solid var(--c-line); }
  .nav-toggle { display: inline-block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
}

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .nav-toggle, .hero-actions, .related-posts { display: none; }
  body { color: #000; }
  a { color: #000; text-decoration: underline; }
}
