/* ============================================================
   BASE — Tokens · Reset · Typography · Utilities
   Light mode default. Dark mode via html[data-theme="dark"]
   ============================================================ */

/* ── Light theme (default) ── */
:root {
  --bg:         #F6F8FC;
  --surface:    #FFFFFF;
  --surface-2:  #EEF2FF;
  --ink:        #0F172A;
  --body-text:  #475569;
  --meta:       #64748B;
  --divider:    #DCE3EF;
  --primary:    #2563EB;
  --primary-strong: #1D4ED8;
  --primary-soft: #DBEAFE;
  --body-dark:  #44403C;

  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --container:  1280px;
  --radius:     14px;
  --shadow:     0 14px 36px rgba(15,23,42,0.10);

  --sp-xs:  8px;
  --sp-sm:  16px;
  --sp-md:  24px;
  --sp-lg:  40px;
  --sp-xl:  64px;
  --sp-2xl: 96px;
}

/* ── Dark theme ── */
html[data-theme="dark"] {
  --bg:        #0A0F1A;
  --surface:   #111827;
  --surface-2: #172234;
  --ink:       #F1F5F9;
  --body-text: #94A3B8;
  --meta:      #475569;
  --divider:   #1E293B;
  --body-dark: #CBD5E1;
  --primary-soft: rgba(59,130,246,0.16);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.78;
  color: var(--body-text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 1000;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
}

img { max-width: 100%; height: auto; display: block; }

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Headings ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0;
}

h1 { font-size: clamp(40px, 6vw, 74px); font-weight: 700; }
h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 700; }
h3 { font-size: 22px; font-weight: 600; }

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

/* ── Layout utilities ── */
.container {
  width: min(var(--container), calc(100% - 80px));
  margin: 0 auto;
}

.section-pad { padding: var(--sp-2xl) 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--meta);
  margin-bottom: var(--sp-sm);
  display: block;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  padding: 12px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 10px 24px rgba(37,99,235,0.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(37,99,235,0.34);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--divider);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ── alt-surface ── */
.alt-surface { background: var(--surface); }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered grid items */
.split-grid > .reveal:nth-child(1) { transition-delay: 0.0s; }
.split-grid > .reveal:nth-child(2) { transition-delay: 0.1s; }
.split-grid > .reveal:nth-child(3) { transition-delay: 0.2s; }
.split-grid > .reveal:nth-child(4) { transition-delay: 0.3s; }

.capabilities-table > .reveal:nth-child(1) { transition-delay: 0.0s; }
.capabilities-table > .reveal:nth-child(2) { transition-delay: 0.1s; }
.capabilities-table > .reveal:nth-child(3) { transition-delay: 0.2s; }
.capabilities-table > .reveal:nth-child(4) { transition-delay: 0.3s; }
.capabilities-table > .reveal:nth-child(5) { transition-delay: 0.4s; }
.capabilities-table > .reveal:nth-child(6) { transition-delay: 0.5s; }

.industry-grid > .reveal:nth-child(1) { transition-delay: 0.0s; }
.industry-grid > .reveal:nth-child(2) { transition-delay: 0.1s; }
.industry-grid > .reveal:nth-child(3) { transition-delay: 0.2s; }
.industry-grid > .reveal:nth-child(4) { transition-delay: 0.3s; }
.industry-grid > .reveal:nth-child(5) { transition-delay: 0.4s; }
.industry-grid > .reveal:nth-child(6) { transition-delay: 0.5s; }

.arch-diagram .arch-layer {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.arch-diagram.is-visible .arch-layer:nth-child(1) { opacity: 1; transform: translateX(0); transition-delay: 0.0s; }
.arch-diagram.is-visible .arch-layer:nth-child(2) { opacity: 1; transform: translateX(0); transition-delay: 0.15s; }
.arch-diagram.is-visible .arch-layer:nth-child(3) { opacity: 1; transform: translateX(0); transition-delay: 0.3s; }
.arch-diagram.is-visible .arch-layer:nth-child(4) { opacity: 1; transform: translateX(0); transition-delay: 0.45s; }

/* ── Dark surface overrides for specific elements ── */
html[data-theme="dark"] .arch-layer,
html[data-theme="dark"] .compliance-tile,
html[data-theme="dark"] .cap-row:hover,
html[data-theme="dark"] .form-card { background: var(--surface-2); }

html[data-theme="dark"] .security-section { background: #020817; }

html[data-theme="dark"] .site-header {
  background: rgba(10, 15, 26, 0.85);
  border-bottom-color: rgba(30, 41, 59, 0.9);
}

html[data-theme="dark"] .cta-section { background: var(--surface); }

html[data-theme="dark"] .hero-left { background: var(--bg); }
html[data-theme="dark"] .hero-stats { background: rgba(15, 23, 42, 0.38); }

html[data-theme="dark"] .industry-band { background: var(--surface); }

html[data-theme="dark"] .stack-row span,
html[data-theme="dark"] .cap-card,
html[data-theme="dark"] .case-card-page { background: var(--surface); }

html[data-theme="dark"] .site-footer { background: var(--bg); }

html[data-theme="dark"] .footer-bottom { background: var(--surface); }

html[data-theme="dark"] .form-card input,
html[data-theme="dark"] .form-card textarea,
html[data-theme="dark"] .form-card select { background: var(--bg); color: var(--ink); }

html[data-theme="dark"] .btn-primary { background: var(--primary); }
html[data-theme="dark"] .btn-ghost {
  background: var(--surface);
  border-color: var(--divider);
}

html[data-theme="dark"] img { filter: brightness(0.88); }
html[data-theme="dark"] .brand-mark img,
html[data-theme="dark"] .team-card img { filter: brightness(0.88) grayscale(1); }

@media (max-width: 900px) {
  .section-pad { padding: 60px 0; }
  .container { width: calc(100% - 40px); }
}

@media (max-width: 600px) {
  .container { width: calc(100% - 32px); }
}
