/* Punchlist Labs - Custom Styles */

/* CSS Custom Properties */
:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --secondary-start: #1e40af;
    --secondary-end: #0ea5e9;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --success: #10B981;
    --danger: #EF4444;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6b7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

/* Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Gradient Text for Logo */
.gradient-text {
    background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 50%, #1e3a8a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-fade-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered Animation Delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

/* Card Hover Effects */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Pricing Card Effects */
.pricing-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
}

.pricing-card.featured {
    transform: scale(1.05);
    z-index: 10;
}

.pricing-card.featured:hover {
    transform: scale(1.08);
}

/* Clickable Pricing Cards */
.pricing-card-clickable {
    position: relative;
}

.pricing-card-clickable:hover {
    transform: translateY(-5px);
}

.pricing-card-clickable.featured:hover {
    transform: scale(1.08);
}

/* Pricing Modals */
.pricing-modal {
    display: none;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pricing-modal.show {
    display: flex !important;
}

.modal-content {
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    max-height: 90vh;
    max-width: 90vw;
    overflow-y: auto;
    margin: auto;
}

/* Large Screen Modal Fixes */
@media (min-width: 1536px) {
    .modal-content {
        max-width: 1400px;
    }
}

/* Mobile Modal Fixes */
@media (max-width: 640px) {
    .pricing-modal {
        align-items: flex-start !important;
        padding-top: 1rem;
        padding-bottom: 2rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .modal-content {
        max-height: none;
        max-width: 95vw;
        margin-top: 0;
        margin-bottom: auto;
    }
    
    /* Ensure close button stays visible and accessible on mobile */
    .modal-close {
        position: absolute !important;
        top: 1rem !important;
        right: 1rem !important;
        z-index: 10;
    }
    
    /* Better text wrapping in modal headers */
    .modal-content h3 {
        word-break: break-word;
        hyphens: auto;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    transform: rotate(90deg);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    padding-right: 0;
}

/* Portfolio Card Effects */
.portfolio-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* Button Effects */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary-start) 0%, var(--secondary-end) 100%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.4);
}

.btn-secondary {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
    background-color: var(--accent);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.4);
}

/* Form Styles */
.form-input {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    outline: none;
}

/* Mobile Menu */
.mobile-menu {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu.hidden {
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
}

.mobile-menu.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header Shadow on Scroll */
.header-scrolled {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Hero Background Gradient */
.hero-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 50%, #1e3a8a 100%);
}

/* Success/Error Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #D1FAE5;
    border: 1px solid #10B981;
    color: #065F46;
}

.alert-error {
    background-color: #FEE2E2;
    border: 1px solid #EF4444;
    color: #991B1B;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

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

/* Smooth Image Loading */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 5px;
}

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

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    z-index: 9999;
    animation: slideInRight 0.3s ease, slideOutRight 0.3s ease 2.7s forwards;
}

.toast.error {
    background: var(--danger);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Questionnaire Styles */
.questionnaire-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.questionnaire-section h2 {
    color: var(--secondary-start);
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 1.5rem;
}

/* Color Theme Cards */
.theme-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.theme-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-card-inner {
    position: relative;
    background: #ffffff;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.theme-card:hover .theme-card-inner {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.theme-card input[type="radio"]:checked ~ .theme-card-inner {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.theme-swatches {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.theme-swatch {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.theme-card:hover .theme-swatch {
    transform: scale(1.1);
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed var(--gray-300);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    background: linear-gradient(to bottom, var(--gray-50), white);
    transition: all 0.2s ease;
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Terms of Service Box */
.tos-box {
    background: var(--gray-50);
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    padding: 20px;
    max-height: 320px;
    overflow-y: auto;
    font-family: inherit;
    white-space: pre-wrap;
}

/* Generator Output */
.generator-output {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--gray-50);
    word-break: break-word;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .pricing-card.featured {
        transform: scale(1);
    }
    
    .pricing-card.featured:hover {
        transform: translateY(-5px);
    }
}

/* Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #1e40af 0%, #0ea5e9 100%);
    z-index: 9999;
    transition: width 0.1s ease-out;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.5);
}

#back-to-top svg {
    width: 24px;
    height: 24px;
}

/* Typewriter Effect */
@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: currentColor;
    }
}

.typewriter {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
}

/* Allow wrapping on mobile for typewriter text */
@media (max-width: 640px) {
    .typewriter {
        white-space: normal;
    }
}

/* Fix descender clipping in hero text */
section.bg-gradient-to-br h1 {
    line-height: 1.2 !important;
    padding-bottom: 0.2em;
    overflow: visible;
}

section.bg-gradient-to-br h1 .typewriter {
    overflow: visible;
}

/* ═════════════════════════════════════════════════════════════════
   Dark mode overrides — auto-applied when the OS sets prefers-color-scheme: dark.
   Tailwind utilities handle the `dark:` prefixed classes; this block handles the
   hand-written custom CSS (alerts, scrollbar, and form focus-ring color) that
   Tailwind does not know about.
   ════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {

    /* Success/error alert banners — keep the intent colors, tint for dark bg */
    .alert-success {
        background-color: rgba(16, 185, 129, 0.15);
        border: 1px solid #065F46;
        color: #6EE7B7;
    }
    .alert-error {
        background-color: rgba(239, 68, 68, 0.15);
        border: 1px solid #991B1B;
        color: #FCA5A5;
    }

    /* Custom scrollbar — dark track + lighter thumb */
    ::-webkit-scrollbar-track { background: #111827; }
    ::-webkit-scrollbar-thumb { background: #374151; }
    ::-webkit-scrollbar-thumb:hover { background: #4B5563; }

    /* Form focus ring glow — lighter on dark */
    .form-input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
    }

    /* Keyboard focus outline color for accessibility */
    a:focus, button:focus, input:focus, textarea:focus, select:focus {
        outline-color: #7dd3fc;
    }
}

/* ═════════════════════════════════════════════════════════════════
   Fixed header: transparent by default, turns into a blurred solid
   bar once the user scrolls (.header-scrolled is added by script.js
   past 10px of scroll).
   ════════════════════════════════════════════════════════════════ */

/* Anchor links land below the fixed 64px header instead of under it */
html { scroll-padding-top: 5rem; }

#main-header {
    background-color: transparent;
    box-shadow: none;
}

/* ── TRANSPARENT STATE (over the dark hero) ──────────────────────── */
#main-header .nav-link       { color: rgba(255, 255, 255, 0.9); }
#main-header .nav-link:hover { color: #fb923c; }               /* orange hover accent */
#main-header .nav-hamburger  { color: #ffffff; }

/* ── SCROLLED STATE — light mode: white blur + darker nav text ───── */
#main-header.header-scrolled {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
#main-header.header-scrolled .nav-link        { color: #4b5563; }  /* gray-600 */
#main-header.header-scrolled .nav-link:hover  { color: #1e40af; }  /* primary navy */
#main-header.header-scrolled .nav-hamburger   { color: #1f2937; }  /* gray-800 */
/* Recolor the sky-300 half of the wordmark to navy so it stays readable on white */
#main-header.header-scrolled .wordmark-punch  { color: #1e40af; }

/* ── SCROLLED STATE — dark mode: gray-900 blur + lighter nav text ── */
@media (prefers-color-scheme: dark) {
    #main-header.header-scrolled {
        background-color: rgba(17, 24, 39, 0.9);                    /* gray-900/90 */
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    #main-header.header-scrolled .nav-link       { color: #d1d5db; }  /* gray-300 */
    #main-header.header-scrolled .nav-link:hover { color: #7dd3fc; }  /* sky-300 */
    #main-header.header-scrolled .nav-hamburger  { color: #e5e7eb; }
    /* Keep sky-300 on dark — it has enough contrast against gray-900 */
    #main-header.header-scrolled .wordmark-punch { color: #7dd3fc; }
}

/* ═════════════════════════════════════════════════════════════════
   HERO AMBIENT EFFECTS
   ─ Dot-matrix pattern overlaid on the hero gradient (low-opacity
     white dots, 24px grid).
   ─ Three soft glowing blobs that drift around at different speeds,
     creating gentle parallax motion behind the H1. Each blob uses
     a radial-gradient fill + blur so it glows rather than showing
     as a solid circle.
   ════════════════════════════════════════════════════════════════ */
.hero-dot-grid {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.10) 1px, transparent 1px);
    background-size: 24px 24px;
    /* Fade the dots near the edges so it does not look like wallpaper */
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
            mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
    opacity: 0.9;
}

/* Base blob style — a blurred radial glow, circular, low opacity */
.hero-blob {
    filter: blur(60px);
    opacity: 0.35;
    will-change: transform;
}
.hero-blob-1 { background: radial-gradient(circle, #60a5fa 0%, transparent 70%); animation: heroBlobDrift 14s ease-in-out infinite; }
.hero-blob-2 { background: radial-gradient(circle, #fb923c 0%, transparent 70%); animation: heroBlobDrift 18s ease-in-out infinite reverse; animation-delay: -4s; opacity: 0.28; }
.hero-blob-3 { background: radial-gradient(circle, #a5f3fc 0%, transparent 70%); animation: heroBlobDrift 16s ease-in-out infinite;          animation-delay: -7s; opacity: 0.20; }

/* The actual drift: each blob floats ~30–40px around its anchor
   and breathes in/out by ~10%. Slow enough to be calming, not jittery. */
@keyframes heroBlobDrift {
    /* --px / --py are set per-blob by initHeroParallax() in script.js when
       the cursor moves across the hero. They default to 0 so the drift
       still works fine on touch devices and when JS hasn't run yet. */
    0%, 100% { transform: translate(calc(  0px + var(--px, 0px)), calc(  0px + var(--py, 0px))) scale(1); }
    33%      { transform: translate(calc( 30px + var(--px, 0px)), calc(-35px + var(--py, 0px))) scale(1.08); }
    66%      { transform: translate(calc(-20px + var(--px, 0px)), calc( 25px + var(--py, 0px))) scale(0.94); }
}

/* Gentle pulse on the status pill above the H1 — just a subtle breathing scale */
@keyframes heroPillPulse {
    0%, 100% { transform: scale(1);    }
    50%      { transform: scale(1.03); }
}

/* Respect users who turn off motion in their OS settings — freeze everything decorative */
@media (prefers-reduced-motion: reduce) {
    .hero-blob,
    .hero-blob-1,
    .hero-blob-2,
    .hero-blob-3 { animation: none; }
}

/* ═════════════════════════════════════════════════════════════════
   LEGACY-PAGE DARK-MODE SHIM
   ────────────────────────────────────────────────────────────────
   The secondary pages (about, jobs, privacy, terms, 404, 500, etc.)
   were written against the light palette only. Rather than edit
   every page by hand to add `dark:` utilities, we scope a set of
   dark-mode overrides under `body.auto-dark` and add that class to
   each legacy page. Specificity beats plain `.bg-white` / `.text-*`
   without needing `!important`, and nothing here leaks into
   index.php (which opts out by not setting auto-dark on its body).
   ════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {

    /* Page base */
    body.auto-dark                   { background-color: #030712; color: #f3f4f6; }

    /* Background utilities */
    body.auto-dark .bg-white         { background-color: #1f2937; }   /* gray-800 */
    body.auto-dark .bg-gray-50       { background-color: #111827; }   /* gray-900 */
    body.auto-dark .bg-gray-100      { background-color: #1f2937; }
    body.auto-dark .bg-gray-200      { background-color: #374151; }

    /* Text utilities */
    body.auto-dark .text-gray-900    { color: #f9fafb; }
    body.auto-dark .text-gray-800    { color: #f3f4f6; }
    body.auto-dark .text-gray-700    { color: #e5e7eb; }
    body.auto-dark .text-gray-600    { color: #d1d5db; }
    body.auto-dark .text-gray-500    { color: #9ca3af; }
    body.auto-dark .text-gray-400    { color: #6b7280; }

    /* Borders */
    body.auto-dark .border-gray-100  { border-color: #374151; }
    body.auto-dark .border-gray-200  { border-color: #374151; }
    body.auto-dark .border-gray-300  { border-color: #4b5563; }

    /* Softer shadows — light-mode drop-shadows look harsh on dark bg */
    body.auto-dark .shadow-sm        { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); }
    body.auto-dark .shadow-md        { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5); }
    body.auto-dark .shadow-lg        { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5); }
    body.auto-dark .shadow-xl        { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6); }

    /* Form inputs — match the style used on index.php so theyre consistent */
    body.auto-dark input,
    body.auto-dark textarea,
    body.auto-dark select            { background-color: #111827; color: #f3f4f6; border-color: #374151; }
    body.auto-dark input::placeholder,
    body.auto-dark textarea::placeholder { color: #6b7280; }

    /* Header fallback for legacy sticky/white header (about.php etc.) */
    body.auto-dark header.bg-white   { background-color: rgba(17, 24, 39, 0.95); backdrop-filter: blur(10px); }
}


/* Smooth the CSS-var updates so the parallax feels liquid rather than
   snapping to each mousemove event. Short duration keeps it responsive. */
.hero-blob {
    transition: --px 0.15s ease-out, --py 0.15s ease-out;
}

/* ═════════════════════════════════════════════════════════════════
   BUTTON SHINE
   ─ A soft white gleam sweeps across the orange CTA buttons on hover.
   ─ Scoped to <a> and <button> with .bg-brand so the tiny orange logo
     tile in the header (a <div>) does not get the effect.
   ═════════════════════════════════════════════════════════════════ */
a.bg-brand,
button.bg-brand,
button[type="submit"].bg-brand {
    position: relative;
    overflow: hidden;
    isolation: isolate;     /* keep the ::after layer from bleeding over siblings */
}

a.bg-brand::after,
button.bg-brand::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;            /* start off the left edge */
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg,
                                transparent 0%,
                                rgba(255, 255, 255, 0.35) 50%,
                                transparent 100%);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
    pointer-events: none;   /* never interferes with clicks */
    z-index: 1;
}

a.bg-brand:hover::after,
button.bg-brand:hover::after {
    left: 150%;             /* sweeps across to the right */
}

/* Respect reduced-motion: no sweep, keep the button static. */
@media (prefers-reduced-motion: reduce) {
    a.bg-brand::after,
    button.bg-brand::after { display: none; }
}
