/* ============================================================
   ABAFT — Global theme stylesheet
   Tokens, fonts, base, header, footer, and animations.
   The compiled utility classes from the original site live in
   utilities.css and are loaded BEFORE this file.
   ============================================================ */

/* --- Self-hosted Plus Jakarta Sans (variable font, latin) --- */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2-variations'),
       url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
}

/* --- Brand tokens --- */
:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --color-purple-50:  #F7F4FD;
  --color-purple-100: #EEE8FB;
  --color-purple-200: #DDD0F7;
  --color-purple-300: #BDA8EE;
  --color-purple-400: #9D82E0;
  --color-purple-500: #7C5CCF;
  --color-purple-600: #5B34B5;
  --color-purple-700: #3D1499;
  --color-purple-800: #2D0A80;
  --color-purple-900: #220066;

  --color-gray-50:  #F8F8FB;
  --color-gray-100: #F0F0F6;
  --color-gray-200: #E2E2EC;
  --color-gray-300: #C4C4D4;
  --color-gray-400: #9E9EB4;
  --color-gray-500: #7E7E96;
  --color-gray-600: #5E5E78;
  --color-gray-700: #464660;
  --color-gray-800: #2D2D44;
  --color-gray-900: #1A1A2E;

  --color-status-pass: #10B981;
  --color-status-warn: #F59E0B;
  --color-status-fail: #EF4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.10);

  --hero-gradient: linear-gradient(135deg, #0F0F1A 0%, #220066 50%, #3D1499 100%);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-gray-900);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Scroll reveal (used across many sections) --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* --- Gauge fill animation --- */
.gauge-fill {
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Floating animation for hero mockup --- */
@keyframes abaft-float {
  0%, 100% { transform: translateY(0) rotateY(-4deg) rotateX(2deg); }
  50%      { transform: translateY(-12px) rotateY(-4deg) rotateX(2deg); }
}
.animate-float {
  animation: abaft-float 6s ease-in-out infinite;
}
@media (max-width: 1024px) {
  .animate-float,
  .animate-float > div {
    animation: none !important;
    transform: none !important;
  }
}

/* --- Pulse glow for primary CTA --- */
@keyframes abaft-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 52, 181, 0.4); }
  50%      { box-shadow: 0 0 0 12px rgba(91, 52, 181, 0); }
}
.pulse-glow {
  animation: abaft-pulse-glow 3s ease-in-out infinite;
}

/* --- Gradient text utility --- */
.gradient-text {
  background: linear-gradient(135deg, #7C5CCF 0%, #BDA8EE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Dot grid pattern (overlay on dark gradients) --- */
.dot-grid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* --- Mockup card primitive (used by every feature/mockup) --- */
.mockup-card {
  background: #ffffff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.mockup-card:hover {
  box-shadow: var(--shadow-lg);
}

/* --- Compliance status colors --- */
.status-pass { color: var(--color-status-pass); }
.status-warn { color: var(--color-status-warn); }
.status-fail { color: var(--color-status-fail); }
.bg-status-pass { background: #ECFDF5; }
.bg-status-warn { background: #FFFBEB; }
.bg-status-fail { background: #FEF2F2; }

/* ============================================================
   Header
   ============================================================ */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background-color 300ms ease, box-shadow 300ms ease;
}

#site-header.is-scrolled {
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
#site-header.is-scrolled .header-link {
  color: var(--color-gray-700);
}
#site-header.is-scrolled .header-link:hover {
  color: var(--color-purple-600);
}
#site-header.is-scrolled #mobile-menu-btn {
  color: var(--color-gray-900);
}

/* --- Logged-in users: offset the fixed header below the WP admin toolbar.
       WordPress adds .admin-bar to <body> for logged-in users. The admin
       toolbar is position:fixed at >600px (32px tall ≥783, 46px tall 601–782)
       and position:absolute at ≤600px (where it scrolls away with the page).
       We mirror the toolbar's positioning so the gap closes when it scrolls. --- */
body.admin-bar #site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar #site-header {
    top: 46px;
  }
}
@media screen and (max-width: 600px) {
  /* Admin bar is absolute here — it scrolls away with the page. Pin our
     header to viewport top; admin bar's higher z-index covers it at scroll 0. */
  body.admin-bar #site-header {
    top: 0;
  }
}

/* Non-home pages: push content below the fixed 72px header */
body:not(.home):not(.front-page) #site-main {
  padding-top: 72px;
}

/* ============================================================
   Footer — list resets to keep ported markup clean
   ============================================================ */

#site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================================
   Skip link (a11y)
   ============================================================ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-purple-700);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
