/* Reset & tokens */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0b0d13;
    --surface: #131722;
    --surface-card: #191f30;
    --border: #262d42;
    --border-focus: #4b6ef6;
    --accent: #5b7cf6;
    --accent-glow: rgba(91, 124, 246, 0.15);
    --accent-dim: #3a52c4;
    --text: #f1f3f9;
    --muted: #8892b0;
    --error-bg: #221616;
    --error-text: #ff8585;
    --error-border: #442222;
    --success-bg: #112217;
    --success-text: #6ee7b7;
    --success-border: #1e3f2b;
    --radius-lg: 16px;
    --radius-md: 10px;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Base */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

    a:hover {
        color: #829fff;
    }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
    background: rgba(11, 13, 19, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.logo-a11y {
    color: var(--accent);
}

.logo-audit {
    color: var(--text);
}

.tagline {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Main Layout */
.main {
    flex: 1;
    width: 100%;
}

/* Hero Section */
.hero-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 5rem 2rem 3rem 2rem;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: var(--accent-glow);
    color: #a3b8ff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(91, 124, 246, 0.3);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #b4c3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--muted);
    font-size: 1.15rem;
    max-width: 580px;
    margin: 0 auto 2.5rem auto;
}

/* Form Card */
.audit-form-section {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.75rem;
    text-align: left;
}

.input-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.url-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 0.85rem 1.25rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .url-input::placeholder {
        color: #4e5569;
    }

    .url-input:focus {
        border-color: var(--border-focus);
        box-shadow: 0 0 0 4px var(--accent-glow);
    }

    .url-input:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.run-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.85rem 1.75rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, opacity 0.2s, box-shadow 0.15s;
    white-space: nowrap;
}

    .run-btn:hover:not(:disabled) {
        background: var(--accent-dim);
        box-shadow: 0 4px 12px rgba(91, 124, 246, 0.3);
    }

    .run-btn:active:not(:disabled) {
        transform: scale(0.98);
    }

    .run-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    .run-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.btn-icon {
    font-size: 1.1rem;
    transition: transform 0.15s;
}

.run-btn:hover .btn-icon:not(:disabled) {
    transform: translateX(2px);
}

.form-hint {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 0.75rem;
    text-align: left;
}

/* Loading Screen */
.loading-screen {
    display: none;
    margin-top: 2rem;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem 1rem;
    text-align: center;
    background: rgba(19, 23, 34, 0.5);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

    .loading-screen.is-visible {
        display: flex;
    }

.loading-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .loading-dots span {
        display: block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--accent);
        animation: dotBounce 1.2s ease-in-out infinite;
    }

        .loading-dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .loading-dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    40% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.loading-message {
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 500;
    min-height: 1.6em;
    letter-spacing: 0.01em;
}

    .loading-message::after {
        content: '\25AC';
        color: var(--accent);
        animation: blink 0.9s step-end infinite;
        margin-left: 2px;
    }

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.loading-sub {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Report & Target container */
.report-container {
    max-width: 680px;
    margin: 1.5rem auto 0 auto;
    width: 100%;
}

/* Download Card */
.download-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--surface-card);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.download-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--success-bg);
    border: 1px solid rgba(110, 231, 183, 0.2);
    color: var(--success-text);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-info {
    flex: 1;
    min-width: 0;
}

.download-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.15rem;
}

.download-url {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}

    .download-btn:hover {
        background: var(--accent-dim);
    }

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

/* Error banner */
.error-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    animation: fadeIn 0.2s ease;
}

.error-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product Info Marketing Section */
.marketing-section {
    border-top: 1px solid var(--border);
    background: rgba(19, 23, 34, 0.2);
    padding: 6rem 2rem;
    margin-top: 6rem;
}

.marketing-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.marketing-header {
    text-align: center;
    margin-bottom: 4rem;
}

.marketing-label {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    display: block;
}

.marketing-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: transform 0.2s, border-color 0.2s;
}

    .feature-card:hover {
        transform: translateY(-4px);
        border-color: #313a54;
    }

.feature-icon-box {
    width: 3rem;
    height: 3rem;
    background: var(--accent-glow);
    border-radius: 8px;
    color: var(--accent);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-weight: bold;
}

.feature-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #fff;
}

.feature-card-desc {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    background: var(--bg);
}

/* Responsive */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 560px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-section {
        padding-top: 3rem;
    }

    .input-row {
        flex-direction: column;
    }

    .run-btn {
        justify-content: center;
    }

    .download-card {
        flex-wrap: wrap;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }

    .marketing-section {
        padding: 4rem 1rem;
        margin-top: 4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-dots span, .loading-message::after, .download-card, .error-banner, .feature-card {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
}
