/* ============================================
   BRAINROT-ANTISLOP.COM
   Custom Styles & Animations
   ============================================ */

/* --- CSS Variables --- */
:root {
    --black: #0a0a0f;
    --dark: #12121a;
    --card: #1a1a2e;
    --border: #2a2a3e;
    --cyan: #00f5ff;
    --magenta: #ff2d55;
    --green: #39ff14;
    --purple: #7c3aed;
    --yellow: #ffd700;
    --text: #e0e0e8;
    --text-dim: #6b6b80;
}

/* --- Base --- */
::selection {
    background: rgba(0, 245, 255, 0.3);
    color: #fff;
}

::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

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

/* --- Navigation --- */
#main-nav {
    background: transparent;
    transition: all 0.3s ease;
}

#main-nav.nav-scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(42, 42, 62, 0.5);
}

.nav-link {
    color: #a0a0b0;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--cyan);
}

.btn-nav-primary {
    background: var(--green);
    color: #000;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-nav-primary:hover {
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    transform: translateY(-1px);
}

.btn-nav-outline {
    border: 1px solid var(--border);
    color: #a0a0b0;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-nav-outline:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(0, 245, 255, 0.08) 0%, transparent 40%),
                radial-gradient(ellipse at 20% 80%, rgba(255, 45, 85, 0.08) 0%, transparent 40%),
                var(--black);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 245, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-noise {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px;
    pointer-events: none;
}

.hero-scanline {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-scanline::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--cyan) 50%, transparent 100%);
    opacity: 0.15;
    animation: scanline 8s linear infinite;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 1rem;
}

.hero-logo {
    display: inline-block;
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    position: relative;
    animation: float 4s ease-in-out infinite;
}

.hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(1) drop-shadow(0 0 30px rgba(0, 245, 255, 0.4));
}

/* Brighten all logo instances on dark backgrounds */
.site-logo {
    filter: invert(1) brightness(1.1);
}

/* Glitch effect */
.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.glitch-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    line-height: 1.1;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glitch-text::before {
    color: var(--cyan);
    animation: glitch1 3s infinite linear alternate-reverse;
    clip-path: inset(0 0 65% 0);
    z-index: -1;
}

.glitch-text::after {
    color: var(--magenta);
    animation: glitch2 2s infinite linear alternate-reverse;
    clip-path: inset(65% 0 0 0);
    z-index: -1;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: #8888a0;
    margin-top: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.hero-cta {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--green);
    color: #000;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.5), 0 10px 40px rgba(57, 255, 20, 0.2);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: transparent;
    color: var(--cyan);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 245, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-outline:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.2);
    transform: translateY(-2px);
}

.btn-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--purple), var(--magenta));
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
}

.btn-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, var(--purple), var(--magenta), var(--cyan));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    filter: blur(10px);
}

.btn-glow:hover {
    transform: translateY(-2px);
}

.btn-glow:hover::before {
    opacity: 1;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    animation: float 2s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    display: block;
    margin-bottom: 0.5rem;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--text-dim);
    border-bottom: 2px solid var(--text-dim);
    transform: rotate(45deg);
    margin: 0 auto;
    animation: scrollBounce 2s ease-in-out infinite;
}

/* --- Section Background Images --- */
.section-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .section-bg-image {
        background-attachment: scroll;
    }
}

.section-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 10, 15, 0.92) 0%,
        rgba(18, 18, 26, 0.85) 40%,
        rgba(18, 18, 26, 0.88) 60%,
        rgba(10, 10, 15, 0.95) 100%
    );
    z-index: 1;
}

.section-bg-overlay--heavy {
    background: linear-gradient(
        180deg,
        rgba(10, 10, 15, 0.95) 0%,
        rgba(18, 18, 26, 0.88) 30%,
        rgba(18, 18, 26, 0.88) 70%,
        rgba(10, 10, 15, 0.95) 100%
    );
}

/* --- Section Styles --- */
.section-dark {
    background: var(--dark);
    position: relative;
}

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #fff;
    margin-bottom: 1rem;
}

.section-subheading {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Stats Cards --- */
.stat-card {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    border-color: rgba(0, 245, 255, 0.3);
    transform: translateY(-4px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--cyan);
    line-height: 1;
    display: inline;
}

.stat-unit {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cyan);
    opacity: 0.7;
}

.stat-label {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* --- Feature Blocks --- */
.feature-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 4rem 0;
}

.feature-block.reverse {
    direction: rtl;
}

.feature-block.reverse > * {
    direction: ltr;
}

@media (max-width: 768px) {
    .feature-block {
        grid-template-columns: 1fr;
    }
    .feature-block.reverse {
        direction: ltr;
    }
}

.feature-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.feature-tag-cyan {
    background: rgba(0, 245, 255, 0.1);
    color: var(--cyan);
    border: 1px solid rgba(0, 245, 255, 0.2);
}

.feature-tag-green {
    background: rgba(57, 255, 20, 0.1);
    color: var(--green);
    border: 1px solid rgba(57, 255, 20, 0.2);
}

.feature-tag-purple {
    background: rgba(124, 58, 237, 0.1);
    color: var(--purple);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.feature-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: #fff;
    margin-bottom: 1rem;
}

.feature-desc {
    color: #8888a0;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Feature Demo Cards */
.demo-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
}

.demo-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
}

.demo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.demo-card-body {
    padding: 1.5rem;
}

/* Bionic Reading Styles */
.bionic b {
    color: #ffffff;
    font-weight: 700;
}

.bionic {
    color: #c8c8d8;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    line-height: 1.9;
}

/* Humanizer Before/After */
.humanizer-before {
    color: #ff6b6b;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    text-decoration: line-through;
    opacity: 0.6;
}

.humanizer-after {
    color: var(--green);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* --- Pricing Cards --- */
.pricing-card {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 245, 255, 0.3);
}

.pricing-card.featured {
    border-color: var(--purple);
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.15) 0%, rgba(26, 26, 46, 0.9) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pricing-card.featured:hover {
    border-color: var(--purple);
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.2);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--purple), var(--magenta));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #fff;
}

.pricing-amount {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 3.5rem;
    color: #fff;
    margin: 1rem 0;
    line-height: 1;
}

.pricing-amount span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-dim);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
}

.pricing-features li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #a0a0b0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-features li::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(57, 255, 20, 0.15);
    border: 1px solid rgba(57, 255, 20, 0.3);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Form Styles --- */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-dim);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #a0a0b0;
    margin-bottom: 0.5rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--magenta);
    margin-top: 0.25rem;
}

/* --- Tool Pages --- */
.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 6rem 1rem 2rem;
    transition: max-width 0.4s ease;
}

/* Expand container when stim mode is active */
.tool-container:has(.stim-mode-wrapper) {
    max-width: 1200px;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1.25rem;
    background: #16162a;
    border: 1px solid #3a3a50;
    border-radius: 1rem;
    color: #e8e8f0;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.tool-textarea:focus {
    border-color: var(--cyan);
}

.tool-output {
    background: #1e1e2e;
    border: 1px solid #3a3a50;
    border-radius: 1rem;
    padding: 1.5rem;
    min-height: 150px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
}

.tool-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.char-counter {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.char-counter.warning {
    color: var(--yellow);
}

.char-counter.danger {
    color: var(--magenta);
}

.uses-badge {
    font-size: 0.8rem;
    color: var(--cyan);
    background: rgba(0, 245, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 245, 255, 0.2);
}

/* Style selector pills */
.style-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.style-pill {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: transparent;
    color: #a0a0b0;
    cursor: pointer;
    transition: all 0.2s;
}

.style-pill:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.style-pill.active {
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* --- Reader specific --- */
.reader-output {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    line-height: 2;
    color: #d0d0dd;
    transition: all 0.3s ease;
}

.reader-output b {
    color: #ffffff;
    font-weight: 700;
}

.reader-modes {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Book mode (light/warm theme for reader) */
.reader-book .tool-output,
.reader-book .tool-output.reader-output {
    background: #f5f0e8 !important;
    border-color: #d4cbbe !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.reader-book .reader-output,
.reader-book .reader-output.bionic,
.reader-book .tool-output {
    color: #4a4540 !important;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.2rem;
    line-height: 2.1;
}

.reader-book .reader-output b,
.reader-book .bionic b {
    color: #1a1815 !important;
    font-weight: 700;
}

.reader-book .highlight-sentence {
    color: #4a4540 !important;
}

.reader-book .highlight-sentence:hover {
    background: rgba(180, 140, 80, 0.15) !important;
    color: #1a1815 !important;
}

.reader-book .reader-output p,
.reader-book p.mb-6,
.reader-book p.mb-4 {
    color: #4a4540 !important;
}

.reader-book .tool-textarea {
    background: #faf6ee !important;
    border-color: #d4cbbe !important;
    color: #2c2520 !important;
}

.reader-book .tool-textarea::placeholder {
    color: #a09585 !important;
}

/* Sepia mode */
.reader-sepia .tool-output,
.reader-sepia .tool-output.reader-output {
    background: #f4ecd8 !important;
    border-color: #d4c9a8 !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.reader-sepia .reader-output,
.reader-sepia .reader-output.bionic,
.reader-sepia .tool-output {
    color: #5b4636 !important;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.2rem;
    line-height: 2.1;
}

.reader-sepia .reader-output b,
.reader-sepia .bionic b {
    color: #2c1e10 !important;
    font-weight: 700;
}

.reader-sepia .highlight-sentence {
    color: #5b4636 !important;
}

.reader-sepia .reader-output p,
.reader-sepia p.mb-6,
.reader-sepia p.mb-4 {
    color: #5b4636 !important;
}

.reader-sepia .tool-textarea {
    background: #f9f0dc !important;
    border-color: #d4c9a8 !important;
    color: #3a2a1a !important;
}

.reader-sepia .tool-textarea::placeholder {
    color: #a09070 !important;
}

/* Theme toggle switch */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.2rem;
}

.theme-toggle button {
    padding: 0.3rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #6b6b80;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle button.active {
    background: var(--border);
    color: #fff;
}

.reader-book .theme-toggle,
.reader-sepia .theme-toggle {
    background: #e8e0d0;
    border-color: #d4cbbe;
}

.reader-book .theme-toggle button.active,
.reader-sepia .theme-toggle button.active {
    background: #c4b89a;
    color: #2c1e10;
}

/* --- Dashboard --- */
.dashboard-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
}

/* --- Stim Mode Toggle Button --- */
.stim-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid rgba(255, 45, 85, 0.3);
    background: transparent;
    color: var(--magenta);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stim-toggle-btn:hover {
    border-color: var(--magenta);
    background: rgba(255, 45, 85, 0.1);
    box-shadow: 0 0 15px rgba(255, 45, 85, 0.2);
}

.stim-toggle-btn.active {
    background: rgba(255, 45, 85, 0.15);
    border-color: var(--magenta);
    color: var(--magenta);
    box-shadow: 0 0 20px rgba(255, 45, 85, 0.3);
    animation: stimPulse 2s ease-in-out infinite;
}

@keyframes stimPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 45, 85, 0.2); }
    50% { box-shadow: 0 0 25px rgba(255, 45, 85, 0.4); }
}

/* --- Stim Mode Layout --- */
.stim-mode-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stim-mode-wrapper .stim-video-panel {
    width: 100%;
    position: sticky;
    top: 4.5rem;
    z-index: 5;
}

.stim-mode-wrapper .stim-reading-panel,
.stim-mode-wrapper .tool-output {
    flex: 1;
    min-width: 0;
}

/* --- Stim Video Panel --- */
.stim-video-panel {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: #000;
    border: 2px solid #333;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 45, 85, 0.1);
    aspect-ratio: 9 / 18;
    max-height: 580px;
}

/* Widescreen mode (for landscape videos like subway surfers HD) */
.stim-video-panel.stim-widescreen {
    aspect-ratio: 16 / 9;
    max-height: 400px;
    border-radius: 1rem;
}

.stim-video-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 6px;
    background: #222;
    border-radius: 0 0 8px 8px;
    z-index: 5;
}

.stim-video-panel video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Stim Text Overlay --- */
.stim-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1rem 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85) 40%);
    z-index: 4;
    pointer-events: none;
}

.stim-overlay-text {
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
    max-height: 6em;
    overflow: hidden;
    transition: opacity 0.4s ease;
}

.stim-overlay-text .stim-highlight {
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Stim mode active state label */
.stim-active-label {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--magenta);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 45, 85, 0.3);
}

/* Responsive stim mode */
@media (max-width: 900px) {
    .stim-mode-wrapper {
        flex-direction: column;
    }

    .stim-mode-wrapper .stim-video-panel {
        flex: none;
        width: 200px;
        max-height: 400px;
        margin: 0 auto;
        position: relative;
        top: 0;
    }
}

@media (max-width: 640px) {
    .stim-mode-wrapper .stim-video-panel {
        width: 160px;
        max-height: 320px;
    }
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Loading Spinner --- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes glitch1 {
    0% { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 0); }
    10% { clip-path: inset(60% 0 10% 0); transform: translate(3px, 0); }
    20% { clip-path: inset(40% 0 30% 0); transform: translate(-2px, 0); }
    30% { clip-path: inset(80% 0 5% 0); transform: translate(1px, 0); }
    40% { clip-path: inset(5% 0 70% 0); transform: translate(-1px, 0); }
    50% { clip-path: inset(50% 0 30% 0); transform: translate(2px, 0); }
    60% { clip-path: inset(30% 0 40% 0); transform: translate(-3px, 0); }
    70% { clip-path: inset(70% 0 15% 0); transform: translate(1px, 0); }
    80% { clip-path: inset(10% 0 60% 0); transform: translate(3px, 0); }
    90% { clip-path: inset(45% 0 25% 0); transform: translate(-2px, 0); }
    100% { clip-path: inset(25% 0 50% 0); transform: translate(1px, 0); }
}

@keyframes glitch2 {
    0% { clip-path: inset(65% 0 0% 0); transform: translate(2px, 0); }
    15% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 0); }
    30% { clip-path: inset(70% 0 10% 0); transform: translate(1px, 0); }
    45% { clip-path: inset(15% 0 55% 0); transform: translate(-3px, 0); }
    60% { clip-path: inset(55% 0 20% 0); transform: translate(3px, 0); }
    75% { clip-path: inset(40% 0 35% 0); transform: translate(-1px, 0); }
    100% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
}

@keyframes scanline {
    0% { top: -10%; }
    100% { top: 110%; }
}

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

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 1; }
    50% { transform: rotate(45deg) translateY(6px); opacity: 0.5; }
}

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

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

.animate-slideIn {
    animation: slideIn 0.3s ease forwards;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.animate-wiggle {
    animation: wiggle 0.5s ease;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(57, 255, 20, 0.3); }
    50% { box-shadow: 0 0 25px rgba(57, 255, 20, 0.6), 0 0 50px rgba(57, 255, 20, 0.2); }
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 5px rgba(0, 245, 255, 0.3); }
    50% { text-shadow: 0 0 20px rgba(0, 245, 255, 0.6), 0 0 40px rgba(0, 245, 255, 0.2); }
}

/* Animated gradient border */
.gradient-border {
    position: relative;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--cyan), var(--purple), var(--magenta), var(--green));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Typewriter cursor */
.typewriter-cursor::after {
    content: '|';
    animation: blink 0.8s infinite;
    color: var(--cyan);
    font-weight: 300;
}

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

/* Animated counter */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stim mode mockup animation */
@keyframes stimFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(1deg); }
    50% { transform: translateY(-10px) rotate(0deg); }
    75% { transform: translateY(-5px) rotate(-1deg); }
}

/* Mobile responsiveness for tool pages */
@media (max-width: 640px) {
    .tool-container {
        padding-top: 5rem;
    }

    .tool-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
}
