/**
 * BLADE BOSS — BASE STYLES
 * Reset + Typography + Shared Components + Utilities
 * 
 * Loaded on every public page via head.php.
 * Depends on: design-tokens.css
 */


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESET — Modern, minimal
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

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

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--bb-charcoal);
    line-height: 1.6;
    background: var(--bb-white);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

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

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    text-wrap: balance;
}

p {
    overflow-wrap: break-word;
    text-wrap: pretty;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TYPOGRAPHY
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    color: var(--bb-charcoal);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p + p {
    margin-top: var(--space-4);
}

strong, b {
    font-weight: 700;
}

small {
    font-size: var(--text-sm);
}

.text-display {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LAYOUT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.bb-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (max-width: 768px) {
    .bb-container {
        padding: 0 var(--space-4);
    }
}

.bb-section {
    padding: var(--space-12) 0;
    position: relative;
}

@media (max-width: 768px) {
    .bb-section {
        padding: var(--space-8) 0;
    }
}

.bb-main {
    /* Push content below fixed nav */
    padding-top: var(--nav-height);
}

@media (max-width: 768px) {
    .bb-main {
        padding-top: var(--nav-height-mobile);
    }
}

/* Content visibility for off-screen sections (huge perf win) */
.bb-section:not(:first-child) {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SECTION HEADERS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.section-header {
    text-align: center;
    max-width: var(--max-width-sm);
    margin: 0 auto var(--space-8);
}

.section-title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--bb-mid-gray);
    line-height: 1.6;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BUTTONS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    outline: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    line-height: 1;
    transition:
        transform var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out),
        background-color var(--duration-normal) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}

/* Touch target minimum (44px) for accessibility */
.btn {
    min-height: 48px;
    min-width: 48px;
}

.btn:active {
    transform: scale(0.97);
}

/* Primary — Orange CTA */
.btn-primary {
    background: var(--bb-orange);
    color: var(--bb-white);
    box-shadow: 0 4px 14px rgba(245, 120, 66, 0.3);
}

.btn-primary:hover {
    background: var(--bb-orange-hover);
    box-shadow: 0 6px 20px rgba(245, 120, 66, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--bb-orange-active);
    transform: translateY(0) scale(0.97);
}

/* Secondary — Green outline */
.btn-secondary {
    background: transparent;
    color: var(--bb-green);
    border: 2px solid var(--bb-green);
}

.btn-secondary:hover {
    background: var(--bb-green);
    color: var(--bb-white);
    transform: translateY(-1px);
}

/* Ghost — For dark backgrounds */
.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: var(--bb-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Large variant */
.btn-lg {
    padding: 1.25rem 2.5rem;
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

/* Small variant */
.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: var(--text-sm);
    min-height: 40px;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CARDS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.bb-card {
    background: var(--bb-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bb-light-gray);
    padding: var(--space-6);
    transition: 
        transform var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out);
}

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

.bb-card-glass {
    background: var(--bb-glass-bg-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bb-glass-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SCROLL ANIMATIONS — CSS-only reveal
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.bb-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.9s var(--ease-out),
        transform 0.9s var(--ease-out);
}

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

/* Stagger children — wider gaps so each one is noticeable */
.bb-stagger > .bb-reveal:nth-child(1) { transition-delay: 0ms; }
.bb-stagger > .bb-reveal:nth-child(2) { transition-delay: 150ms; }
.bb-stagger > .bb-reveal:nth-child(3) { transition-delay: 300ms; }
.bb-stagger > .bb-reveal:nth-child(4) { transition-delay: 450ms; }
.bb-stagger > .bb-reveal:nth-child(5) { transition-delay: 600ms; }
.bb-stagger > .bb-reveal:nth-child(6) { transition-delay: 750ms; }

/* Load fade-in — for above-the-fold elements that can't wait for scroll */
.bb-fade-in-delayed {
    opacity: 0;
    transform: translateY(30px);
    animation: bb-fade-in 0.9s var(--ease-out) 0.5s forwards;
}

@keyframes bb-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HIGHLIGHT / ACCENT TEXT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.text-green   { color: var(--bb-green); }
.text-orange  { color: var(--bb-orange); }
.text-muted   { color: var(--bb-mid-gray); }
.text-white   { color: var(--bb-white); }
.text-center  { text-align: center; }

.text-gradient {
    background: linear-gradient(135deg, var(--bb-green) 0%, var(--bb-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BACKGROUND VARIANTS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.bg-dark {
    background: var(--bb-navy);
    color: var(--bb-white);
}

.bg-dark .section-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.bg-green {
    background: var(--bb-green);
    color: var(--bb-white);
}

.bg-light {
    background: var(--bb-off-white);
}

.bg-smoke {
    background: var(--bb-smoke);
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ACCESSIBILITY
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--bb-orange);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip link */
.bb-skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    background: var(--bb-green);
    color: var(--bb-white);
    padding: var(--space-3) var(--space-5);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: var(--z-toast);
    font-weight: 700;
    transition: top var(--duration-fast) var(--ease-out);
}

.bb-skip-link:focus {
    top: 0;
}

/* 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-width: 0;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SELECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

::selection {
    background: var(--bb-green);
    color: var(--bb-white);
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SCROLLBAR (subtle, premium)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

::-webkit-scrollbar {
    width: 8px;
}

/* ━━━ Scroll Progress Bar ━━━ */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.08);
    z-index: calc(var(--z-nav) + 1);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 767px) {
    .progress-bar {
        top: 60px;
    }
    .progress-bar.nav-hidden {
        transform: translateY(-60px);
    }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bb-orange) 0%, var(--bb-green) 100%);
    width: 0%;
    will-change: width;
    transition: width 150ms linear;
    box-shadow: 0 0 8px var(--bb-orange-glow);
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bb-ash);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bb-mid-gray);
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--bb-ash) transparent;
}
