/* ==========================================================================
   CSS VARIABLES - Color Palette & Spacing
   ========================================================================== */
:root {
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent-blue: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e2e8f0;
    
    --max-width: 900px;
    --nav-height: 70px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ==========================================================================
   RESET & BASE TYPOGRAPHY
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1.25rem;
}

.container {
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ==========================================================================
   DYNAMIC NAVIGATION
   ========================================================================== */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
}

.brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-main);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.4s ease;
}

#nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

#nav-links a:hover {
    color: var(--accent-blue);
}

#mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.nav-state-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.nav-state-title-only,
.nav-state-full {
    transform: translateY(0);
    opacity: 1;
}

.nav-state-full .brand {
    left: 0;
    transform: translateX(0);
}

.nav-state-full #nav-links {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ==========================================================================
   HERO SECTION & BUTTONS
   ========================================================================== */
.hero-section {
    padding: 8rem 0 4rem;
    text-align: center;
    background: linear-gradient(to bottom, var(--bg-alt), var(--bg-color));
}

#hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 500;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.intro-text {
    font-size: 1.1rem;
    max-width: 750px;
    margin: 0 auto 2.5rem;
    text-align: left;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    background-color: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--bg-alt);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

/* ==========================================================================
   CONTENT SECTIONS
   ========================================================================== */
.content-section {
    padding: 4rem 0;
}

.content-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.content-section h3 {
    font-size: 1.15rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

#press ul {
    list-style-type: disc;
    padding-left: 1.5rem; 
    margin-bottom: 2rem;
}

#press li {
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: 1.6;
}

#press li strong {
    color: var(--text-muted);
    font-weight: 600;
}

.lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.section-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ==========================================================================
   FINDINGS GRID & CARDS
   ========================================================================== */
.findings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 1.5rem;
    margin-top: 2rem;
}

.finding-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.finding-card h3 {
    display: flex;
    align-items: center; 
    gap: 10px;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.inline-icon {
    width: 1.1em;
    height: 1.1em;
    stroke-width: 2.5px;
    color: #71717a;
    flex-shrink: 0;
}

.critical {
    color: #e11d48; 
}

.finding-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    margin-top: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
    background-color: #eff6ff; 
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    width: max-content;
}

.finding-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--accent-blue);
}

.finding-card:hover .read-more {
    background-color: var(--accent-blue);
    color: #ffffff;
    padding-left: 1.25rem;
    padding-right: 0.75rem;
}

.finding-card:active {
    transform: translateY(-2px); 
    box-shadow: var(--shadow-sm); 
    background-color: #f1f5f9; 
    transition: all 0.05s ease; 
    border-color: var(--accent-hover);
}

@keyframes beaconPulseAlert {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.alert-card .read-more {
    position: relative; /* Allows the pulse layer to attach */
}

.alert-card .read-more::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    animation: beaconPulseAlert 2s infinite; /* Runs continuously */
    pointer-events: none; 
    transition: opacity 0.2s ease;
}

.alert-card:hover .read-more::after {
    opacity: 0; 
}

/* ==========================================================================
   MODAL OVERLAYS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 3rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.note {
    border-left: 4px solid var(--accent-blue);
    padding: 1.25rem;
    background: var(--bg-alt);
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.note p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   ATTACK DEMONSTRATION LAYOUTS
   ========================================================================== */
.attack-demo-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0; 
    row-gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.demo-col-left, .demo-col-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.demo-col-left {
    border-right: 1px dashed var(--border-color);
    padding-right: 1.5rem;
}

.demo-col-right {
    padding-left: 1.5rem;
}

.demo-pair {
    text-align: center;
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    box-sizing: border-box;
}

.demo-pair img, .demo-pair canvas {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 1 / 1; 
    object-fit: fill; 
    background: #eef1f5;
    border-radius: 6px;
    margin: 0 auto;
    display: block;
}

.action-wrapper {
    position: relative;
    width: 100%;
}

.action-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    border-radius: 8px;
    transition: opacity 0.4s ease;
}

.action-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.demo-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.demo-hash-box {
    width: 100%;
    max-width: 260px;
    margin: 0.85rem auto 0 auto;
    background: var(--bg-alt);
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    box-sizing: border-box;
}

.hash-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.hash-value {
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.match-success {
    color: #16a34a !important;
}

.image-success-border {
    box-shadow: 0 0 0 4px #16a34a !important;
    transition: box-shadow 0.3s ease;
}

.evasion-success {
    color: #dc2626 !important;
}

.extra-examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

@keyframes bounceVertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.bounce-hint {
    animation: bounceVertical 1.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    padding: 3rem 0;
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

footer p {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (All combined into one block)
   ========================================================================== */
@media (max-width: 925px) {
    /* Nav Adjustments */
    .nav-state-full #mobile-menu-toggle {
        display: block;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-state-full #nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
    }

    .nav-state-full #nav-links.mobile-open {
        display: flex;
    }
}

@media (max-width: 768px) {
    /* Layout Adjustments */
    .hero-section {
        padding: 6rem 0 3rem;
    }
    
    .button-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }

    .findings-grid,
    .attack-demo-container {
        grid-template-columns: 1fr;
    }
    .extra-examples-grid {
        grid-template-columns: 1fr;
    }

    .demo-col-left {
        border-right: none;
        border-bottom: 1px dashed var(--border-color);
        padding-right: 0;
        padding-bottom: 2rem;
    }

    .demo-col-right {
        padding-left: 0;
    }

    .modal-content {
        padding: 2rem 1.5rem;
        width: 95%;
    }
}

/* ==========================================================================
   LAZY LOADING SPINNER
   ========================================================================== */
.img-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes spinner-rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   IMAGE COMPARISON SLIDER HANDLE
   ========================================================================== */
.slider-divider {
    position: relative; 
    z-index: 5;
}

.slider-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    background-image: url('data:image/svg+xml;utf8,<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2364748b" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M9 18l-6-6 6-6"/><path d="M15 6l6 6-6 6"/></svg>');
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Lucid icons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; 
    padding: 0.75rem 1.25rem; 
    transition: all 0.2s ease;
}

.btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.nav-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
}

#nav-links a {
    display: flex;
    align-items: center;
    /* other existing styles */
}