/* ============================================================
   SOC Launchpad — Design System (theme.css)
   Light-first. Dark theme available via [data-theme="dark"].
   No external fonts or frameworks — system stack only.
   ============================================================ */

/* ---------- Tokens: light (default) ---------- */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg:         #F7F9FC;
  --bg-2:       #FFFFFF;
  --surface:    #FFFFFF;
  --surface-2:  #F1F5FA;
  --surface-3:  #E6EDF6;
  --border:     #DCE4EF;
  --border-2:   #C3D0E2;

  /* Text */
  --text:       #0D1524;
  --text-2:     #4A5B75;
  --text-3:     #7C8CA6;

  /* Brand */
  --accent:     #0284C7;
  --accent-2:   #4F46E5;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(2, 132, 199, 0.10);
  --accent-line: rgba(2, 132, 199, 0.30);

  /* Semantic */
  --pass:       #059669;
  --pass-soft:  rgba(5, 150, 105, 0.10);
  --warn:       #B45309;
  --warn-soft:  rgba(180, 83, 9, 0.10);
  --fail:       #DC2626;
  --fail-soft:  rgba(220, 38, 38, 0.10);
  --info:       #2563EB;

  /* WhatsApp brand */
  --wa:         #25D366;
  --wa-ink:     #04210F;

  /* Space */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* Radius */
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow:    0 4px 16px rgba(16,24,40,.08);
  --shadow-lg: 0 16px 48px rgba(16,24,40,.12);
  --glow:      0 0 0 1px var(--accent-line), 0 8px 32px rgba(2,132,199,.12);

  /* Layout */
  --wrap: 1140px;
  --wrap-narrow: 780px;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

/* ---------- Tokens: dark ---------- */
[data-theme="dark"] {
  color-scheme: dark;

  --bg:         #060A13;
  --bg-2:       #0A111F;
  --surface:    #0F1A2C;
  --surface-2:  #16233A;
  --surface-3:  #1C2C46;
  --border:     #1E2C46;
  --border-2:   #2B3D5C;

  --text:       #E9EFFA;
  --text-2:     #A6B8D4;
  --text-3:     #6E809C;

  --accent:     #38BDF8;
  --accent-2:   #818CF8;
  --accent-ink: #04121F;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-line: rgba(56, 189, 248, 0.32);

  --pass:       #34D399;
  --pass-soft:  rgba(52, 211, 153, 0.12);
  --warn:       #FBBF24;
  --warn-soft:  rgba(251, 191, 36, 0.12);
  --fail:       #F87171;
  --fail-soft:  rgba(248, 113, 113, 0.12);
  --info:       #60A5FA;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.45);
  --glow:      0 0 0 1px var(--accent-line), 0 8px 32px rgba(56,189,248,.14);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  margin: 0 0 var(--s4);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3.6vw, 2.35rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
h4 { font-size: 1.02rem; }
p  { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s5); }
.wrap-narrow { width: 100%; max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: var(--s5); }

.section { padding-block: clamp(56px, 9vw, var(--s9)); }
.section--alt { background: var(--bg-2); }
.section--tight { padding-block: clamp(40px, 6vw, var(--s7)); }

.center { text-align: center; }
.stack > * + * { margin-top: var(--s4); }

/* ---------- Eyebrow / section header ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s3);
}
.eyebrow::before {
  content: ""; width: 18px; height: 2px;
  background: var(--accent); border-radius: 2px; flex: none;
}

.section-head { max-width: 660px; margin-bottom: var(--s7); }
.section-head.center { margin-inline: auto; }
.section-head p { color: var(--text-2); font-size: 1.06rem; margin-bottom: 0; }

.lede { font-size: 1.1rem; color: var(--text-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2);
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: 0.96rem; font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .14s ease, background .14s ease,
              border-color .14s ease, box-shadow .14s ease, opacity .14s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}
.btn--primary:hover { box-shadow: var(--shadow-lg); }

.btn--ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

.btn--wa {
  background: var(--wa);
  color: var(--wa-ink);
  box-shadow: var(--shadow);
}
.btn--wa:hover { box-shadow: var(--shadow-lg); }

.btn--block { width: 100%; }
.btn--lg { padding: 16px 30px; font-size: 1.02rem; }
.btn--sm { padding: 9px 16px; font-size: 0.88rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5);
}

/* ---------- Pills / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.78rem; font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill--pass { background: var(--pass-soft); border-color: rgba(5,150,105,.3); color: var(--pass); }
.pill--warn { background: var(--warn-soft); border-color: rgba(180,83,9,.3); color: var(--warn); }
.pill--fail { background: var(--fail-soft); border-color: rgba(220,38,38,.3); color: var(--fail); }
.pill--muted { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }

/* Marks a session that teaches log-source integration directly. Dashed border
   and a flat surface so it reads as a category tag, never as a status — it
   sits beside pill--pass / pill--warn and must not be mistaken for one. */
.pill--int { background: var(--surface); border-style: dashed; }

/* ---------- Utility ---------- */
.mono { font-family: var(--mono); }
.dim { color: var(--text-2); }
.dim-2 { color: var(--text-3); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hidden, [hidden] { display: none !important; }

.grid { display: grid; gap: var(--s4); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- Brand lockup ----------
   Shared by the landing page and the portal. The ring/core selectors style
   the inline SVG mark, which inherits currentColor nowhere — it needs the
   accent tokens applied explicitly. */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 750; font-size: 1.02rem;
  color: var(--text); letter-spacing: -0.02em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__mark .ring { stroke: var(--accent); }
.brand__mark .core { fill: var(--accent); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; stroke: var(--text-2); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Icon reflects the CURRENT theme: sun in light, moon in dark. */
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px);
            transition: opacity .55s ease, transform .55s ease; }
  .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Focus / selection ---------- */
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Scrollbar ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--border-2); border-radius: 10px;
  border: 3px solid transparent; background-clip: content-box;
}
