/* ========================================
   🎨 DIGITAL ALLIES GLOBAL DESIGN TOKENS
   Source: brand.digitalallies.net
   Merged from tokens.css + global.css
   ======================================== */

:root {
    /* ============================================
       🎨 BRAND COLORS (from brand.digitalallies.net)
       ============================================ */
    
    /* Primary Brand Palette */
    --blue: #2563EB;              /* Primary Blue */
    --blue-light: #60A5FA;
    --blue-dark: #1D4ED8;
    --green: #059669;             /* Ally Green */
    --green-light: #34D399;
    --purple: #7C3AED;            /* Accent Purple */
    --purple-light: #C4B5FD;
    
    /* Neutral Palette */
    --neutral-900: #111827;
    --neutral-800: #1F2937;
    --neutral-700: #374151;
    --neutral-600: #4B5563;
    --neutral-500: #6B7280;
    --neutral-300: #D1D5DB;
    --neutral-100: #F3F4F6;
    --neutral-50: #F9FAFB;
    
    /* Utility Colors */
    --error: #DC2626;
    --warning: #F59E0B;
    --success: #10B981;
    
    /* Color Shades */
    --blue-50: #E0F2FE;
    --blue-100: #DBEAFE;
    --green-100: #D1FAE5;
    --red: #EF4444;
    --gray: #414243;
    --white: #FFFFFF;
    --black: #000000;
    
    
    /* ============================================
       📐 DESIGN TOKENS (from brand guide)
       ============================================ */
    
    /* Typography */
    --font-body: "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
    --font-heading: "Segoe UI", "Source Sans Pro", sans-serif;
    
    /* Border Radius */
    --border-radius-sm: 0.375rem; /* 6px */
    --border-radius-md: 0.5rem;   /* 8px */
    --border-radius-lg: 0.75rem;  /* 12px */
    --border-radius-xl: 1rem;     /* 16px */
    --border-radius-full: 9999px; /* Pill shape */
    
    /* Shadows */
    --shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-button: 0 3px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.12);
    --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.35);
    
    /* Layout */
    --header-height: 4.5rem;
    
    
    /* ============================================
       🎯 SEMANTIC TOKENS (Applied usage)
       ============================================ */
    
    /* Text Colors */
    --text-primary: var(--neutral-900);
    --text-secondary: var(--neutral-700);
    --text-muted: var(--neutral-600);
    
    /* Link Colors */
    --link-color: var(--blue);
    --link-hover: var(--blue-dark);
    --link-visited: #1C3FAA;
    
    /* Borders */
    --border-color: #E5E7EB;
    
    /* Backgrounds */
    --bg-primary: var(--white);
    --bg-secondary: var(--neutral-50);
    
    
    /* ============================================
       🔘 BUTTON TOKENS
       ============================================ */
    
    /* Primary Button (Blue) */
    --btn-primary-bg: var(--blue);
    --btn-primary-text: var(--white);
    --btn-primary-hover: var(--blue-light);
    
    /* Secondary Button (Outline) */
    --btn-secondary-bg: var(--white);
    --btn-secondary-text: var(--blue);
    --btn-secondary-border: var(--blue);
    --btn-secondary-hover-bg: var(--blue-light);
    --btn-secondary-hover-text: var(--white);
    
    /* Success Button (Green) */
    --btn-success-bg: var(--green);
    --btn-success-text: var(--white);
    
    /* Danger Button (Red) */
    --btn-danger-bg: var(--red);
    --btn-danger-text: var(--white);
    
    /* Outline Button (Transparent) */
    --btn-outline-bg: transparent;
    --btn-outline-text: var(--blue);
    --btn-outline-border: var(--blue);
    --btn-outline-hover-bg: var(--blue-50);
    
    /* Quiet Button (Text-only) */
    --btn-quiet-bg: transparent;
    --btn-quiet-text: var(--blue);
    
    
    /* ============================================
       🎴 CARD & ICON TOKENS
       ============================================ */
    
    /* Card Border Rotation (sets of 3) */
    --card-border-1: var(--blue);
    --card-border-2: var(--green);
    --card-border-3: var(--purple);
    
    /* Icon Background Rotation (sets of 3) */
    --icon-bg-1: var(--blue-light);
    --icon-bg-2: var(--green-light);
    --icon-bg-3: var(--purple-light);
}

html {
    font-family: var(--font-heading);
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    color: inherit;
    background: inherit;
}

a {
    color: var(--link-color);
    text-decoration: none;
    text-underline-offset: 0.125em;
    transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
    color: var(--link-hover);
}

a:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

header[role="banner"] a {
    color: var(--text-primary);
}

header[role="banner"] a:hover,
header[role="banner"] a:focus-visible {
    color: var(--link-hover);
}

footer a,
.site-footer a {
    color: var(--white);
}

footer a:hover,
footer a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
    color: rgba(224, 242, 254, 0.9);
}

/* Ensure footer text is all white */
footer,
footer p,
footer .text-gray-300,
.site-footer,
.site-footer p {
    color: var(--white) !important;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(29, 78, 216, 0.12));
    position: relative;
    min-block-size: var(--header-height);
    box-shadow: 0 20px 45px -32px rgba(37, 99, 235, 0.45);
}

.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%232563EB" fill-opacity="0.08"><circle cx="30" cy="30" r="1"/></g></g></svg>') repeat;
    pointer-events: none;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-block-size: var(--header-height);
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
    gap: 0.6rem;
}

.logo-icon {
    inline-size: 100%;
    block-size: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-light), var(--blue-dark)) !important;
    mask: url('assets/brand/logo-glyph.svg') no-repeat center / contain;
    -webkit-mask: url('assets/brand/logo-glyph.svg') no-repeat center / contain;
}

.brand-pulse {
    animation: brand-pulse 3s ease-in-out infinite;
}

.logo-dot {
    display: none;
}

@keyframes brand-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.65;
        transform: scale(1.15);
    }
}

.text-gradient {
    background: linear-gradient(135deg, var(--blue), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    -webkit-font-smoothing: antialiased;
    font-family: var(--font-heading);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 0.95rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid transparent;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition: all 0.2s ease-in-out;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* Primary Button - Blue */
.btn--primary {
    background: var(--blue);
    color: var(--white);
    border: 2px solid var(--blue);
}

.btn--primary:hover {
    background: var(--white);
    color: var(--blue);
    border-color: var(--blue);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(1px);
}

/* Secondary Button - Outline */
.btn--secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 2px solid var(--btn-secondary-border);
}

.btn--secondary:hover {
    background: var(--btn-secondary-hover-bg);
    color: var(--btn-secondary-hover-text);
    transform: translateY(-1px);
}

.btn--secondary:active {
    transform: translateY(1px);
}

/* Success Button - Green */
.btn--success {
    background: var(--btn-success-bg);
    color: var(--btn-success-text);
}

.btn--success:hover {
    filter: brightness(0.90);
    transform: translateY(-1px);
}

.btn--success:active {
    transform: translateY(1px);
}

/* Danger Button - Red */
.btn--danger {
    background: var(--btn-danger-bg);
    color: var(--btn-danger-text);
}

.btn--danger:hover {
    filter: brightness(0.90);
    transform: translateY(-1px);
}

.btn--danger:active {
    transform: translateY(1px);
}

/* Outline Button - Transparent with border */
.btn--outline {
    background: var(--btn-outline-bg);
    color: var(--btn-outline-text);
    border: 2px solid var(--btn-outline-border);
}

.btn--outline:hover {
    background: var(--btn-outline-hover-bg);
}

/* Quiet Button - Text-only */
.btn--quiet {
    background: var(--btn-quiet-bg);
    color: var(--btn-quiet-text);
    padding-inline: 0;
    border: none;
    box-shadow: none;
}

.btn--quiet:hover {
    text-decoration: underline;
}

/* Hover and depth utilities */
.gradient-shadow {
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.10), 0 2px 4px -1px rgba(37, 99, 235, 0.06);
}

.hover-lift {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.10);
}

/* Animated gradient background - archived, use static backgrounds instead */
.gradient-bg,
.animated-gradient {
    background: var(--blue-50);
    position: relative;
}

/* Cards */
.card {
    position: relative;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Card without border */
.card--no-border {
    border: none;
}

/* Rotational Card Borders (for sets of 3) */
.card:nth-of-type(3n+1) { 
    border: 2px solid var(--card-border-1); 
}
.card:nth-of-type(3n+2) { 
    border: 2px solid var(--card-border-2); 
}
.card:nth-of-type(3n+3) { 
    border: 2px solid var(--card-border-3); 
}

.card--outline-blue {
    border: 2px solid var(--blue);
}

.card--outline-green {
    border: 2px solid var(--green);
}

.card--outline-red {
    border: 2px solid var(--red);
}

.card--outline-purple {
    border: 2px solid var(--purple);
}

.card--featured {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(37, 99, 235, 0.08));
    border: 2px solid var(--blue);
}

/* Deprecated - remove gradient shadow effects */
.card--shadow-gradient::before,
.card--shadow-solid::before {
    content: "";
    position: absolute;
    inset: -8px;
    z-index: -1;
    border-radius: inherit;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.card--shadow-gradient::before {
    background: radial-gradient(120% 120% at 20% 10%, var(--blue-100) 0%, var(--blue-light) 45%, var(--blue) 100%);
}

.card--shadow-solid::before {
    background: radial-gradient(100% 100% at 50% 50%, var(--blue), var(--blue));
    filter: blur(18px);
    opacity: 0.45;
}

.card[data-elevate="hover"]:hover::before {
    opacity: 0.7;
}

.section--gradient .card--shadow-gradient::before {
    opacity: 0.35;
}

.card:focus-within {
    outline: none;
    box-shadow: var(--shadow-focus), 0 1px 2px rgba(17, 24, 39, 0.08);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2C2D2E, var(--gray));
    color: var(--white);
}

footer .logo {
    color: var(--white);
}

footer .logo:hover {
    opacity: 0.9;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100%;
    background: var(--blue);
    color: var(--white);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-full);
    z-index: 100;
    transition: top 0.2s ease-in-out;
    box-shadow: 0 10px 25px -10px rgba(37, 99, 235, 0.4);
}

.skip-link:focus {
    top: 1rem;
}

/* Floating shapes */
.floating-shapes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1); /* Faster transition for more responsive feel */
    transform-style: preserve-3d;
    opacity: 0.6;
}

.floating-shape svg,
.floating-shape img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Animations & utilities */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-delay-1 {
    animation-delay: 0.2s;
}

.fade-in-delay-2 {
    animation-delay: 0.4s;
}

.fade-in-delay-3 {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Sticky CTA */
.sticky-cta {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.75rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    border-radius: var(--border-radius-full);
    box-shadow: 0 25px 45px -20px rgba(29, 78, 216, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sticky-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 50px -15px rgba(29, 78, 216, 0.55);
}

.sticky-cta:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

@media (max-width: 640px) {
    .sticky-cta {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        padding-inline: 1.25rem;
    }
}

/* Form errors */
.form-error {
    display: none;
}

.form-error.active {
    display: block;
    color: var(--error);
}

/* Knowledge base typography */
.prose h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.prose p,
.prose li {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.prose li {
    margin-left: 1.5rem;
}

.prose strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* Icon utilities */
.icon {
    width: 28px;
    height: 28px;
    display: inline-block;
}

.icon--blue {
    color: var(--blue);
}

.icon--green {
    color: var(--green);
}

.icon--purple {
    color: var(--purple);
}

.icon--red {
    color: var(--red);
}

/* Icon Backgrounds - Rotational (sets of 3) */
.icon-bg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-lg);
    padding: 0.5rem;
    width: 4rem;
    height: 4rem;
}

.icon-bg:nth-of-type(3n+1) { 
    background: var(--icon-bg-1); 
}
.icon-bg:nth-of-type(3n+2) { 
    background: var(--icon-bg-2); 
}
.icon-bg:nth-of-type(3n+3) { 
    background: var(--icon-bg-3); 
}

/* Card icon backgrounds matching border colors at 75% opacity */
.card:nth-of-type(3n+1) > div.w-16,
.card:nth-of-type(3n+1) > div.w-20 {
    background: rgba(37, 99, 235, 0.75) !important; /* Blue at 75% */
}

.card:nth-of-type(3n+2) > div.w-16,
.card:nth-of-type(3n+2) > div.w-20 {
    background: rgba(5, 150, 105, 0.75) !important; /* Green at 75% */
}

.card:nth-of-type(3n+3) > div.w-16,
.card:nth-of-type(3n+3) > div.w-20 {
    background: rgba(124, 58, 237, 0.75) !important; /* Purple at 75% */
}

/* Reduced motion */
@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;
    }

    .gradient-bg,
    .animated-gradient {
        animation: none !important;
    }
}
