/**
 * FILE: frontend/css/style.css
 * Core Brutalist Aesthetics. Fluid Geometry via clamp(). Zero Tailwind.
 * LAST MODIFICATION: 2026-03-31
 */

:root {
    --paper: #fff1e5;
    --ink: #1a1a1a;
    --accent: #e31b23;
    --border: #d8c8b8;
    --white: #ffffff;
    
    /* Fluid Geometry */
    --spacing-sm: clamp(0.5rem, 1vw, 1rem);
    --spacing-md: clamp(1rem, 2vw, 2rem);
    --spacing-lg: clamp(2rem, 4vw, 4rem);
    --spacing-xl: clamp(4rem, 8vw, 8rem);
    
    --text-xs: clamp(0.7rem, 0.8vw, 0.85rem);
    --text-base: clamp(1rem, 1.2vw, 1.15rem);
    --text-lg: clamp(1.2rem, 1.5vw, 1.5rem);
    --text-xl: clamp(2rem, 3vw, 2.5rem);
    --text-xxl: clamp(3rem, 6vw, 5rem);
}

/* RESET & BASE */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    background-color: var(--paper); 
    color: var(--ink); 
    font-family: 'Libre Baskerville', serif;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

/* GLOBAL TEXT CONSTRAINTS: Prevent long strings from blowing out the viewport */
h1, h2, h3, h4, h5, h6, p, span, div, .mono, .oswald {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, .oswald { 
    font-family: 'Oswald', sans-serif; 
    text-transform: uppercase; 
    line-height: 1.1; 
}

.mono { 
    font-family: 'JetBrains Mono', monospace; 
    text-transform: uppercase; 
}

/* SPACING UTILITIES */
.mt-md { margin-top: var(--spacing-md); }
.mt-xl { margin-top: var(--spacing-xl); }
.mt-auto { margin-top: auto; }

/* BRUTALIST COMPONENTS */
.brutalist-border { border: 2px solid var(--ink); border-radius: 0; }
.brutalist-shadow { box-shadow: 6px 6px 0 var(--ink); transition: transform 0.2s, box-shadow 0.2s; }
.brutalist-shadow:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }

.brutalist-button {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    border: 2px solid var(--ink);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--text-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
    border-radius: 0;
}
.brutalist-button:hover {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    transform: translate(4px, 4px);
    box-shadow: -4px -4px 0 var(--ink);
}
.brutalist-button.inverse {
    background: var(--paper);
    color: var(--ink);
}
.brutalist-button.inverse:hover {
    background: var(--ink);
    color: var(--paper);
}

/* TICKER */
.ticker-wrap {
    background: var(--accent);
    color: var(--white);
    padding: var(--spacing-sm) 0;
    overflow: hidden;
    border-bottom: 2px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 100;
}
.ticker-content {
    display: inline-block;
    white-space: nowrap;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: ticker 50s linear infinite;
}
@keyframes ticker { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }

/* LAYOUT */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
}

.masthead {
    text-align: center;
    border-bottom: 8px solid var(--ink);
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}
.masthead-meta {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--ink);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: var(--text-xs);
}
.masthead-title { font-size: var(--text-xxl); font-weight: 700; letter-spacing: -2px; }

/* SECTIONS */
.section-header { margin-bottom: var(--spacing-lg); }
.section-label { color: var(--accent); font-weight: 700; margin-bottom: var(--spacing-sm); display: block; font-size: var(--text-xs); }
.section-title { font-size: var(--text-xl); margin-bottom: var(--spacing-md); }
.section-content { font-size: var(--text-lg); margin: var(--spacing-md) 0; }
.section-content p { margin: var(--spacing-md) 0; }

/* EXTRACTION CALL CTA */
.action-wrapper { margin-top: 3rem; }
.btn-hero { max-width: 600px; font-size: 2rem; }

/* GRID SYSTEMS */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: var(--spacing-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--spacing-lg); }

/* TOOL CARDS */
.card {
    background: var(--white);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}
.card-meta { font-size: var(--text-xs); color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.tool-description { font-size: 1.1rem; line-height: 1.6; }
.tool-status { font-weight: bold; color: var(--accent); }

/* FOOTER */
.site-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--ink);
    text-align: center;
    font-size: var(--text-xs);
}

/* MODALS & WIZARD */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 5vw; 
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
    background: var(--paper);
    width: 100%;
    max-width: 1200px;
    height: auto;
    min-height: min-content;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: auto;
    flex-shrink: 0;
}

.modal-close {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: var(--white);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    z-index: 10;
}
.modal-close:hover { background: var(--ink); }

.wizard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    min-height: 60vh;
}

/* GRID BLOWOUT PREVENTION: Critical for text-heavy layouts */
.modal-grid > * {
    min-width: 0;
}

@media (max-width: 900px) {
    .wizard-layout { grid-template-columns: 1fr; }
    .vsl-container { min-height: 300px; }
    
    /* MOBILE BRUTALIST CONSTRAINT: Core Container */
    .modal-container { 
        width: 90%; 
        max-width: 90%; 
        margin: 5vh auto; 
    }
    
    /* MODAL GRID ALIGNMENT: Stack vertically without forcing rigid widths */
    .modal-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md) !important;
    }

    /* THE FORM CONSTRAINT: Fix for horizontal spill */
    #suspect-capture-form {
        /* Unset rigid 100% width. Let standard block flow handle width */
        width: auto !important; 
        height: auto !important;
        /* Make room for the brutalist 8px shadow so it doesn't clip or trigger horizontal scroll */
        margin-right: 8px !important; 
        margin-bottom: var(--spacing-md) !important;
        /* Reduce inline padding on small screens to save space */
        padding: var(--spacing-md) !important;
    }
}

.vsl-container {
    background: var(--ink);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.vsl-frame {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border: 4px solid var(--white);
}

.wizard-container {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
}

.wizard-step { display: none; animation: fadeIn 0.4s ease; }
.wizard-step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* FORMS & CAPTURE */
.form-input {
    width: 100%;
    max-width: 100%; /* Safety lock */
    padding: var(--spacing-md);
    background: var(--paper);
    border: 2px solid var(--ink);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-base);
    margin-bottom: var(--spacing-md);
    color: var(--ink);
    border-radius: 0;
    outline: none;
    box-sizing: border-box; /* Redundant but secure */
}
.form-input:focus { border-color: var(--accent); box-shadow: 4px 4px 0 var(--accent); }

/* CLOUDFLARE TURNSTILE RESPONSIVE CONSTRAINTS */
.cf-turnstile {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
    /* REMOVED: overflow: hidden; -> This causes the chopping effect */
}

/* Ensure the widget visually scales down gracefully on ultra-small screens */
@media (max-width: 380px) {
    .cf-turnstile {
        transform: scale(0.85);
        transform-origin: center center;
    }
}

.wizard-progress {
    display: flex;
    gap: 5px;
    margin-bottom: var(--spacing-lg);
}
.progress-dot {
    height: 8px;
    flex-grow: 1;
    background: var(--border);
}
.progress-dot.active { background: var(--ink); }

/* IFRAME LOADER (TOOLS) */
.tool-iframe-container {
    width: 100%;
    height: calc(90vh - 50px);
    border: none;
}