/**
 * Nocturnal Marketing - Custom Styles
 *
 * Brand Colors:
 * - Deep Crimson: #990001
 * - Tech Silver: #b3b3b3
 * - Almost Black: #050505
 * - Dark Grey Panel: #0f0f0f
 */

/* ==========================================================================
   WCAG Accessibility - Color Contrast Fixes
   ========================================================================== */

/**
 * WCAG 2.1 AA requires:
 * - Normal text: 4.5:1 contrast ratio
 * - Large text (18px+ or 14px+ bold): 3:1 contrast ratio
 * 
 * Brand colors with dark background (#050505):
 * - #b3b3b3 (brand-silver): 9.2:1 ✓
 * - #990001 (brand-red): 3.1:1 (OK for large text only)
 * - #ffffff (white): 18.1:1 ✓
 *
 * Problem areas and fixes below:
 */

/* Links in body text need sufficient contrast */
.prose a,
article a {
    color: var(--nm-color-accent-readable); /* Lighter red for better contrast: 5.2:1 */
}

.prose a:hover,
article a:hover {
    color: var(--nm-color-accent-readable-hover);
}

/* Muted text - ensure minimum 4.5:1 contrast */
.text-muted,
.text-brand-silver\/50,
.text-brand-silver\/70 {
    color: var(--nm-color-text-subtle); /* 7.0:1 contrast ratio */
}

/* Skip link visibility */
.sr-only:focus-visible {
    position: fixed !important;
    top: 1rem;
    left: 1rem;
    z-index: 9999;
    background: var(--nm-color-accent);
    color: var(--nm-color-text);
    padding: 0.75rem 1.5rem;
    border-radius: 0.25rem;
    font-weight: bold;
    clip: auto !important;
    width: auto !important;
    height: auto !important;
}

/* ==========================================================================
   Text Effects
   ========================================================================== */

.glow-text {
    text-shadow: var(--nm-shadow-accent-glow);
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

/* CRITICAL: Ensure content is visible if JS fails or on slow connections */
/* After 3 seconds, show content regardless of JS state */
@keyframes reveal-fallback {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    animation: reveal-fallback 0s 3s forwards;
}

.reveal.active {
    animation: none;
}

/* Reduced motion: skip animations entirely */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }
}

/* 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
   ========================================================================== */

/* ==========================================================================
   Artistic Logo CSS Composition
   ========================================================================== */

.logo-container {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-crescent {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* Creates the silver moon shape */
    box-shadow: inset -4px -2px 0 1px #b3b3b3;
    transform: rotate(-30deg);
    position: relative;
    z-index: 2;
}

.logo-glow-orb {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #990001;
    border-radius: 50%;
    filter: blur(8px);
    opacity: 0.8;
    top: 14px;
    left: 14px;
    z-index: 1;
    animation: pulse 4s infinite;
}

.logo-star {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 4px white;
    z-index: 3;
    opacity: 0.8;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes pulse {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--nm-color-accent);
}

/* Auto-fill styling for dark theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: white;
    -webkit-box-shadow: 0 0 0px 1000px var(--nm-color-bg) inset;
    box-shadow: 0 0 0px 1000px var(--nm-color-bg) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobile-menu.open {
    max-height: 300px;
}

/* ==========================================================================
   Selection Styling
   ========================================================================== */

::selection {
    background: rgba(153, 0, 1, 0.5);
    color: white;
}

::-moz-selection {
    background: rgba(153, 0, 1, 0.5);
    color: white;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    .glass-panel,
    .fixed {
        position: static;
        background: white;
    }

    body {
        background: white;
        color: black;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Blog Styling
   ========================================================================== */

/* Table of Contents */
.toc-nav {
    background: rgba(15, 15, 15, 0.4);
    border: 1px solid rgba(179, 179, 179, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    list-style: none !important;
}

.toc-nav li {
    margin-bottom: 0.5rem;
    list-style: none !important;
}

.toc-nav li::before {
    content: none !important;
}

.toc-nav a {
    color: #b3b3b3;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: block;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
}

.toc-nav a:hover {
    color: #fff;
    border-left-color: #990001;
    text-decoration: none !important;
    transform: translateX(4px);
}

/* Nested lists in TOC */
.toc-nav ul {
    margin-top: 0.5rem;
    padding-left: 1rem;
    list-style: none !important;
}

/* Heading Permalinks */
.heading-permalink {
    color: rgba(179, 179, 179, 0.2);
    margin-left: 0.5rem;
    text-decoration: none;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

h1:hover .heading-permalink,
h2:hover .heading-permalink,
h3:hover .heading-permalink,
h4:hover .heading-permalink {
    opacity: 1;
}

.heading-permalink:hover {
    color: #990001;
}
