/* ═══════════════════════════════════════════════════════════════════
   Blue Penguin Digital — Design System v4
   theme-v4.css — The Component, Polish & Animation Layer
   
   This sits alongside Tailwind CSS. Tailwind handles utility layout;
   this file handles everything Tailwind alone cannot:
   - Design tokens as CSS custom properties
   - Multi-layered, tinted shadow system
   - Pseudo-element shadow animation (GPU-composited)
   - Component layer: buttons, forms, cards, accordions, nav, tables
   - Scroll reveals, counter animations, smooth scroll
   - content-visibility performance helpers
   - Accessibility: focus rings, reduced motion, skip-to-content
   
   Version: 4.0.0
   Updated: 2026-06-08 — All 8 research topics synthesised
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. DESIGN TOKENS ────────────────────────────────────
   All values are referenced via var(). Never hardcode colours,
   shadows, spacing, or typography in component styles.
   Project-specific tokens (brand colours, fonts) go here.
   ───────────────────────────────────────────────────────── */

:root {
  /* ── Brand colours ────────────────────────────────── */
  --brand-900: #1E3A5F;
  --brand-800: #1E40AF;
  --brand-700: #2563EB;
  --brand-600: #3B82F6;
  --brand-500: #60A5FA;
  --brand-300: #93C5FD;
  --brand-100: #DBEAFE;
  --brand-50: #EEF4FF;

  /* Accent colour (use sparingly — 60-30-10 rule) ──── */
  --accent: #CE4C11;
  --accent-hover: #DA5919;
  --accent-50: #FFF7ED;

  /* ── Neutrals ─────────────────────────────────────── */
  --white: #FFFFFF;
  --black: #0A0A0A;
  --text: #0F1B3D;
  --text-soft: #3F4D75;
  --muted: #7B85A0;
  --line: #E0E7F2;
  --line-strong: #C4D2E7;
  --line-subtle: rgba(0, 0, 0, 0.06);

  /* ── Surfaces ─────────────────────────────────────── */
  --bg-page: #FAFBFD;
  --bg-pale: #F4F7FC;
  --bg-card: #FFFFFF;

  /* ── Typography ───────────────────────────────────── */
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-heading: 'Manrope', system-ui, -apple-system, sans-serif;

  /* Fluid type scale: 9 steps, Minor Third (1.200) → Major Third (1.250) */
  --text-xs:  clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:  clamp(0.875rem, 0.8rem  + 0.3vw,  1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-md:  clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  --text-lg:  clamp(1.25rem,  1.1rem  + 0.5vw,  1.5rem);
  --text-xl:  clamp(1.5rem,   1.25rem + 0.8vw,  2rem);
  --text-2xl: clamp(1.75rem,  1.4rem  + 1.1vw,  2.5rem);
  --text-3xl: clamp(2rem,     1.5rem  + 1.5vw,  3rem);
  --text-4xl: clamp(2.5rem,   1.75rem + 2vw,    4rem);

  /* ── Spacing ──────────────────────────────────────── */
  --space-xs:  clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
  --space-sm:  clamp(0.5rem,  0.4rem + 0.5vw,  1rem);
  --space-md:  clamp(1rem,    0.8rem + 0.8vw,  1.5rem);
  --space-lg:  clamp(1.5rem,  1.2rem + 1.2vw,  2.5rem);
  --space-xl:  clamp(2rem,    1.5rem + 2vw,    4rem);
  --space-section: clamp(4rem, 3rem + 4vw, 7rem);
  --container-max: 1240px;
  --container-pad: clamp(1rem, 4vw, 2.5rem);

  /* ── Border Radius ────────────────────────────────── */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* ── Duration Tokens ──────────────────────────────── */
  --duration-fast: 150ms;
  --duration: 300ms;
  --duration-slow: 500ms;
  --duration-page: 700ms;

  /* ── Easing Tokens ────────────────────────────────── */
  --ease-standard: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0.0, 1, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  /* ── Gradients ────────────────────────────────────── */
  --grad-brand: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-800) 100%);

  /* ── Z-Index Scale ────────────────────────────────── */
  --z-base: 0;
  --z-content: 10;
  --z-sticky: 50;
  --z-drawer: 80;
  --z-modal: 90;
  --z-toast: 100;

  /* ── v4 Shadow System (4 levels, layered, brand-tinted) ──
     RGB channels extracted from --brand-900 for tinting.
     Multi-layered: tight base + progressive diffused ambient.
     Brain registers depth without consciously seeing shadow. */
  --shadow-brand-rgb: 30 58 138; /* brand-900 as RGB */

  --shadow-level-1:
    0 1px 2px rgba(var(--shadow-brand-rgb) / 0.06),
    0 2px 4px rgba(var(--shadow-brand-rgb) / 0.04);

  --shadow-level-2:
    0 1px 2px rgba(var(--shadow-brand-rgb) / 0.07),
    0 3px 6px rgba(var(--shadow-brand-rgb) / 0.05),
    0 8px 18px -8px rgba(var(--shadow-brand-rgb) / 0.08);

  --shadow-level-3:
    0 1px 2px rgba(var(--shadow-brand-rgb) / 0.08),
    0 4px 8px rgba(var(--shadow-brand-rgb) / 0.06),
    0 12px 28px -10px rgba(var(--shadow-brand-rgb) / 0.10),
    0 20px 48px -16px rgba(var(--shadow-brand-rgb) / 0.06);

  --shadow-level-4:
    0 1px 2px rgba(var(--shadow-brand-rgb) / 0.10),
    0 4px 10px rgba(var(--shadow-brand-rgb) / 0.07),
    0 16px 36px -12px rgba(var(--shadow-brand-rgb) / 0.12),
    0 28px 64px -20px rgba(var(--shadow-brand-rgb) / 0.08),
    0 40px 80px -24px rgba(var(--shadow-brand-rgb) / 0.04);

  --shadow-nav:
    0 1px 2px rgba(var(--shadow-brand-rgb) / 0.06),
    0 3px 6px rgba(var(--shadow-brand-rgb) / 0.04),
    0 6px 14px -6px rgba(var(--shadow-brand-rgb) / 0.06);
}

/* ═══════════════════════════════════════════════════════════════════
   2. BASE RESET & UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ── Fluid Container ───────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── Section spacing ───────────────────────────────── */
.section {
  padding-block: var(--space-section);
}

.section-pale {
  background: var(--bg-pale);
}

/* ── content-visibility helper ────────────────────────
   Skips rendering for below-fold sections. Up to 7x paint boost.
   Must provide contain-intrinsic-size to prevent scrollbar jumping. */
.content-deferred {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* ── Screen reader only ─────────────────────────────── */
.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;
}

/* ── Skip to content ────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  padding: 8px 12px;
  background: var(--brand-700);
  color: var(--white);
  border-radius: var(--radius);
}

/* ── Focus visible ring utility ───────────────────────
   Double-ring: coloured ring + offset for depth.
   Apply to any interactive element. Never outline:none alone. */
.focus-ring:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--white),
    0 0 0 4px var(--brand-600);
}

/* ── Reduced motion ───────────────────────────────────
   Wraps all animations in the system. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   3. TYPOGRAPHY SYSTEM
   ═══════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); line-height: 1.1; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  margin: 0 0 1em;
  color: var(--text-soft);
  text-wrap: pretty;
}

.lede {
  font-size: var(--text-md);
  color: var(--text-soft);
  max-width: 600px;
  line-height: 1.5;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--brand-700);
  margin-bottom: 12px;
}

.eyebrow-accent { color: var(--accent); }

.section-head {
  max-width: 700px;
  margin: 0 auto 56px;
  text-align: center;
}

.section-head .lede {
  max-width: 580px;
  margin-inline: auto;
}

.inline-link {
  color: var(--brand-700);
  font-weight: 600;
  border-bottom: 2px solid var(--brand-300);
  padding-bottom: 1px;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.inline-link:hover {
  border-color: var(--brand-600);
}

/* ═══════════════════════════════════════════════════════════════════
   4. BUTTON SYSTEM
   
   Three tiers: primary, secondary, tertiary.
   All: 44px min-height (WCAG 2.5.8 AAA), 300ms bezier transitions.
   Hover: translateY lift + pseudo-element shadow animation (GPU).
   ═══════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 24px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.2;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  transition: transform var(--duration) var(--ease-standard);
  user-select: none;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  min-height: 48px;
}

/* ── Primary Button ───────────────────────────────────
   Pill shape for nav/conversion CTAs. Solid brand fill.
   Layered shadow at rest. Hover: lift + shadow expansion via
   pseudo-element opacity (GPU-composited, zero layout thrash). */
.btn-primary {
  background: var(--brand-700);
  color: var(--white);
  border-color: var(--brand-700);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-level-2);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--shadow-level-4);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-standard);
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:active {
  transform: scale(0.97);
  transition: transform 50ms var(--ease-out);
}

/* ── Secondary (Outlined) Button ──────────────────────
   Transparent fill, 1px border, fills on hover. */
.btn-secondary {
  background: transparent;
  color: var(--brand-800);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: var(--brand-800);
  color: var(--white);
  border-color: var(--brand-800);
  transform: translateY(-1px);
  box-shadow: var(--shadow-level-2);
}

.btn-secondary:active {
  transform: scale(0.97);
  transition: transform 50ms var(--ease-out);
}

/* ── Tertiary (Text-only) Button ────────────────────── */
.btn-tertiary {
  background: transparent;
  color: var(--brand-700);
  border-color: transparent;
}

.btn-tertiary:hover {
  background: rgba(var(--shadow-brand-rgb) / 0.06);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── Accent button ──────────────────────────────────── */
.btn-accent {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-level-2);
}

.btn-accent::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--shadow-level-4);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-standard);
  pointer-events: none;
}

.btn-accent:hover {
  background: #EA580C;
  border-color: #EA580C;
  transform: translateY(-2px);
}

.btn-accent:hover::after {
  opacity: 1;
}

.btn-accent:active {
  transform: scale(0.97);
  transition: transform 50ms var(--ease-out);
}

/* Light variant (on dark backgrounds) */
.btn-light {
  background: var(--white);
  color: var(--brand-800);
  border-color: var(--white);
  border-radius: var(--radius-full);
}

.btn-light:hover {
  background: var(--brand-700);
  color: var(--white);
  border-color: var(--brand-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-level-2);
}

/* ── Disabled State ─────────────────────────────────── */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
  filter: saturate(0.3);
}

/* ── Loading State ────────────────────────────────────
   Hides text, shows spinner. Dimensions preserved = zero CLS. */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 600ms linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════
   5. FORM SYSTEM
   
   Labels always above inputs (50ms saccade vs 500ms left).
   Outlined style, double-ring focus-visible, multi-sensory validation.
   ═══════════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 400;
}

/* ── Input / Textarea / Select ────────────────────────
   Outlined: 1px border + subtle bg. 16px font minimum
   prevents iOS auto-zoom on focus. */
.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: max(16px, 1rem);
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237B85A0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* Hover */
.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--muted);
}

/* Focus: double-ring via :focus-visible (keyboard only) */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
  outline: none;
  border-color: var(--brand-600);
  box-shadow:
    0 0 0 2px var(--white),
    0 0 0 4px var(--brand-600);
}

/* ── Validation: Error ────────────────────────────────
   Multi-sensory: border + bg tint + icon + descriptive text.
   WCAG 1.4.1: colour is never the only signal. */
.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: #EF4444;
  background: #FEF2F2;
}

.form-input.error:focus-visible,
.form-textarea.error:focus-visible,
.form-select.error:focus-visible {
  box-shadow:
    0 0 0 2px var(--white),
    0 0 0 4px #EF4444;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: #DC2626;
  line-height: 1.4;
}

.form-error::before {
  content: '\26A0';
  flex-shrink: 0;
}

/* ── Validation: Success ───────────────────────────── */
.form-input.success,
.form-textarea.success,
.form-select.success {
  border-color: #10B981;
  background: #F0FDF4;
}

.form-success {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: #059669;
  line-height: 1.4;
}

.form-success::before {
  content: '\2713';
  flex-shrink: 0;
}

/* ── Checkbox / Radio ───────────────────────────────── */
.form-check-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand-600);
  flex-shrink: 0;
}

.form-check-label {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
   6. CARD SYSTEM
   
   Multi-layered shadows, subtle border for edge definition,
   white bg on off-white canvas.
   Interactive cards: GPU lift + shadow expansion on hover.
   ═══════════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-level-2);
  position: relative;
}

.card-padded-lg {
  padding: 32px 24px;
}

/* ── Interactive Card ─────────────────────────────────
   Shadow expands + lifts on hover. Images inside scale.
   Pseudo-element shadow animation = GPU, zero layout thrash. */
.card-interactive {
  position: relative;
  transition: transform var(--duration) var(--ease-standard);
  overflow: hidden;
}

.card-interactive::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--shadow-level-4);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-standard);
  pointer-events: none;
}

.card-interactive:hover {
  transform: translateY(-4px);
}

.card-interactive:hover::after {
  opacity: 1;
}

/* Image inside interactive card: scale on group hover */
.card-interactive .card-image-wrap {
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
  margin: -24px -24px 16px -24px;
}

.card-interactive .card-image-wrap img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-standard);
}

.card-interactive:hover .card-image-wrap img {
  transform: scale(1.05);
}

/* ── Card content ───────────────────────────────────── */
.card-body {
  position: relative;
  z-index: 1;
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.card-text {
  font-size: var(--text-sm);
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 16px;
}

.card-meta {
  font-size: 13px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════════
   7. ACCORDION (CSS Grid height animation)
   
   Uses <details>/<summary> for semantic baseline.
   CSS Grid 0fr → 1fr for smooth auto-height animation.
   Zero JavaScript for the animation core.
   ═══════════════════════════════════════════════════════════════════ */

.accordion details {
  border-bottom: 1px solid var(--line);
  transition: background var(--duration) var(--ease-out);
}

.accordion details[open] {
  background: var(--bg-pale);
}

.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

/* Chevron icon — rotates 180deg on expand */
.accordion summary::after {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--muted);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
  transition: transform var(--duration) var(--ease-standard);
}

.accordion details[open] summary::after {
  transform: rotate(180deg);
}

/* Grid animation: 0fr (collapsed) → 1fr (expanded) */
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration) var(--ease-standard);
}

.accordion details[open] .accordion-content {
  grid-template-rows: 1fr;
}

.accordion-content > div {
  overflow: hidden;
}

.accordion-body {
  padding: 0 0 20px 0;
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════════
   8. TESTIMONIAL CARDS
   
   Anatomy: 48px avatar, 5 SVG stars, name + role, quote.
   Minimum 3 displayed simultaneously. Grid or masonry.
   ═══════════════════════════════════════════════════════════════════ */

.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-level-2);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.testimonial-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.testimonial-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.testimonial-meta {
  display: flex;
  flex-direction: column;
}

.testimonial-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.testimonial-role {
  font-size: 13px;
  color: var(--muted);
}

.testimonial-stars {
  display: flex;
  gap: 2px;
  color: #F59E0B;
}

.testimonial-stars svg {
  width: 16px;
  height: 16px;
}

.testimonial-quote {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.7;
  font-style: italic;
  position: relative;
  padding-left: 16px;
  border-left: 3px solid var(--brand-300);
}

.testimonial-quote strong {
  color: var(--text);
  font-style: italic;
}

.testimonial-verified {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* Grid: 3-column minimum, auto-fit */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 24px;
}

/* ═══════════════════════════════════════════════════════════════════
   9. RESPONSIVE DATA TABLES
   
   Desktop: standard <table> with minimal row borders.
   Mobile (<768px): stacked card layout with data-label pseudos.
   Never overflow-x-auto horizontal scroll.
   ═══════════════════════════════════════════════════════════════════ */

.table-responsive table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-responsive thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}

.table-responsive tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background var(--duration-fast) var(--ease-out);
}

.table-responsive tbody tr:hover {
  background: var(--bg-pale);
}

.table-responsive tbody td {
  padding: 14px 16px;
  color: var(--text-soft);
  vertical-align: top;
}

/* ── Mobile (<768px): Rows become stacked cards ─────── */
@media (max-width: 768px) {
  .table-responsive thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .table-responsive tbody,
  .table-responsive tr,
  .table-responsive td {
    display: block;
  }

  .table-responsive tbody tr {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--bg-card);
    box-shadow: var(--shadow-level-1);
  }

  .table-responsive tbody td {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 8px;
  }

  .table-responsive tbody td:last-child {
    border-bottom: none;
  }

  .table-responsive tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    width: 100px;
  }
}

   11. FOOTER
   
   Desktop: 4-5 column grid. Mobile: single column.
   Sub-footer separated by 1px border for legal/copyright.
   ═══════════════════════════════════════════════════════════════════ */

.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  padding-top: var(--space-section);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 48px;
  padding-bottom: 48px;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.footer-brand-text {
  font-size: 14px;
  line-height: 1.7;
  margin-top: 12px;
  max-width: 280px;
}

.footer-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-links a:hover {
  color: var(--white);
}

.footer-sub {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-sub a {
  color: rgba(255, 255, 255, 0.4);
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-sub a:hover {
  color: rgba(255, 255, 255, 0.7);
}

.footer-sub-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════
   12. HERO & LAYOUT PATTERNS
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hero ───────────────────────────────────────────── */
.hero {
  padding: 100px 0 90px;
  background: linear-gradient(180deg, var(--bg-pale) 0%, var(--bg-page) 70%);
  position: relative;
  overflow: hidden;
}

/* Decorative background orbs (brand-tinted radial gradients) */
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--shadow-brand-rgb) / 0.25) 0%,
    rgba(var(--shadow-brand-rgb) / 0.08) 35%,
    rgba(var(--shadow-brand-rgb) / 0.01) 55%,
    transparent 68%
  );
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(249, 115, 22, 0.2) 0%,
    rgba(249, 115, 22, 0.06) 30%,
    rgba(249, 115, 22, 0.01) 48%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 70px;
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.hero-copy h1 {
  margin: 0 0 24px;
}

.hero-copy .gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy .lede {
  margin-bottom: 32px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ── Page Hero (shorter, for inner pages) ───────────── */
.page-hero {
  padding: 80px 0 60px;
  background: linear-gradient(180deg, var(--bg-pale) 0%, var(--bg-page) 80%);
  position: relative;
  overflow: hidden;
}

.page-hero h1 {
  margin-bottom: 16px;
}

/* ── Grid Layouts ───────────────────────────────────── */

/* Auto-fit card grid (services, features, etc.) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 24px;
}

/* 3-column static grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

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

/* 2-column grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

/* Stat grid (4-across, auto-fit) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  text-align: center;
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--brand-700);
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Bento / feature grid ───────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

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

/* Featured item spans 2 cols */
.feature-grid .feature-featured {
  grid-column: span 2;
}

@media (max-width: 560px) {
  .feature-grid .feature-featured {
    grid-column: span 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   13. ANIMATION & SCROLL REVEALS
   
   All animations use composite-friendly properties only
   (transform + opacity). GPU-composited, zero main thread.
   JS adds .revealed class on scroll. CSS handles the transition.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Scroll Reveal Base ────────────────────────────────
   Elements start hidden and translateY(20px).
   When .revealed is added by IntersectionObserver, they animate in. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-page) var(--ease-standard),
              transform var(--duration-page) var(--ease-standard);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-page) var(--ease-standard),
              transform var(--duration-page) var(--ease-standard);
}

.reveal-stagger > *.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Directional variants ───────────────────────────── */
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity var(--duration-page) var(--ease-standard),
              transform var(--duration-page) var(--ease-standard);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity var(--duration-page) var(--ease-standard),
              transform var(--duration-page) var(--ease-standard);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ── Fade only (no movement) ────────────────────────── */
.reveal-fade {
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-standard);
}

.reveal-fade.revealed {
  opacity: 1;
}

/* ── Counter animation ──────────────────────────────── */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* ── Chevrone hint (scroll indicator) ───────────────── */
.scroll-hint {
  animation: bounce-down 2s ease infinite;
}

@keyframes bounce-down {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(8px); }
  60% { transform: translateY(4px); }
}
