/* ============================================
   NOSECPWN – Hacker Aesthetic Styles
   Red (#ff3c3c) + Cyan (#00ffff) + Black
   ============================================ */

/* ─── Page Transition ───────────────────────── */
@keyframes pageReveal {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

main {
    animation: pageReveal 0.4s ease-out;
}

/* ─── View Transitions API ──────────────────── */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: 0.25s ease-out both fadeOut;
}
::view-transition-new(root) {
    animation: 0.3s ease-out 0.05s both fadeSlideIn;
}

@keyframes fadeOut {
    to { opacity: 0; transform: scale(0.98); }
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Body Background ───────────────────────── */
body {
    background: #000 !important;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 50% 50%, rgba(255,60,60,0.02), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* ─── Matrix Rain Canvas ────────────────────── */
#matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.06;
}

/* ─── Scroll-to-Top Button ──────────────────── */
#scroll-top {
    position: fixed;
    bottom: 5rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    background: rgba(255,60,60,0.15);
    border: 1px solid rgba(255,60,60,0.4);
    border-radius: 0.5rem;
    color: #ff3c3c;
    font-size: 1rem;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#scroll-top:hover {
    background: #ff3c3c;
    color: #000;
    box-shadow: 0 0 20px rgba(255,60,60,0.5);
    transform: translateY(-2px);
}

/* ─── Scroll Reveal Animations ──────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s 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; }

/* ─── Floating Particles ────────────────────── */
@keyframes float-particle {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

.particle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: #ff3c3c;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    animation: float-particle linear infinite;
}

/* ─── Glow Border on Cards (hover) ──────────── */
.card-glow:hover {
    box-shadow: 0 0 25px rgba(255,60,60,0.1), 0 0 50px rgba(255,60,60,0.05);
    border-color: rgba(255,60,60,0.5) !important;
}

/* ─── Pulse Dot ─────────────────────────────── */
.pulse-dot {
    width: 8px;
    height: 8px;
    background: #ff3c3c;
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid #ff3c3c;
    animation: pulseDot 2s ease-out infinite;
}

@keyframes pulseDot {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ─── Typing Cursor (enhanced) ──────────────── */
.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 0.85rem;
    background: #ff3c3c;
    margin-left: 1px;
    animation: cursorBlink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ─── Gradient Text ─────────────────────────── */
.gradient-text {
    background: linear-gradient(90deg, #ff3c3c, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Neon Underline ────────────────────────── */
.neon-underline {
    position: relative;
}

.neon-underline::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ff3c3c, #00ffff, transparent);
    box-shadow: 0 0 8px rgba(255,60,60,0.5);
}

/* ─── Status Badge ──────────────────────────── */
.status-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: #00ff88;
    font-family: 'JetBrains Mono', monospace;
}

.status-online::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 6px #00ff88;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Navigation ────────────────────────────── */
.nav-bg {
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(12px) saturate(150%);
}

.nav-link {
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #888;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover {
    color: #ff3c3c;
    text-shadow: 0 0 8px rgba(255,60,60,0.5);
    background: rgba(255,60,60,0.06);
}

.nav-link.active {
    color: #ff3c3c;
    background: rgba(255,60,60,0.1);
    text-shadow: 0 0 6px rgba(255,60,60,0.3);
}

.nav-link-mobile {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #888;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link-mobile:hover {
    color: #ff3c3c;
    background: rgba(255,60,60,0.06);
}

/* ─── Glitch Logo ───────────────────────────── */
.glitch-logo {
    position: relative;
    animation: glitchPulse 4s ease-in-out infinite;
}

.glitch-logo:hover {
    animation: glitchFlicker 0.3s infinite;
}

@keyframes glitchPulse {
    0%, 100% { text-shadow: 0 0 4px rgba(0,255,255,0.3); }
    50% { text-shadow: 0 0 12px rgba(0,255,255,0.6), 0 0 2px rgba(255,60,60,0.3); }
}

@keyframes glitchFlicker {
    0% { text-shadow: 2px 0 #ff3c3c, -2px 0 #00ffff; }
    25% { text-shadow: -2px 0 #ff3c3c, 2px 0 #00ffff; }
    50% { text-shadow: 1px -1px #ff3c3c, -1px 1px #00ffff; }
    75% { text-shadow: -1px 1px #ff3c3c, 1px -1px #00ffff; }
    100% { text-shadow: 2px 0 #ff3c3c, -2px 0 #00ffff; }
}

/* ─── Buttons ───────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1.5rem;
    background: #ff3c3c;
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid #cc0000;
    transition: all 0.2s;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 0 12px rgba(255,60,60,0.2);
}

.btn-primary:hover {
    background: #ff5555;
    box-shadow: 0 0 20px rgba(255,60,60,0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1.5rem;
    background: transparent;
    color: #00ffff;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid #1a2633;
    transition: all 0.2s;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
}

.btn-secondary:hover {
    border-color: #00ffff;
    box-shadow: 0 0 12px rgba(0,255,255,0.15);
    background: rgba(0,255,255,0.05);
}

/* ─── Filter Pills ──────────────────────────── */
.filter-pill {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
    background: #0a0a0a;
    border: 1px solid #1a2633;
    color: #888;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
}

.filter-pill:hover {
    border-color: rgba(255,60,60,0.5);
    color: #ff3c3c;
}

.filter-pill.active {
    background: rgba(255,60,60,0.1);
    border-color: rgba(255,60,60,0.5);
    color: #ff3c3c;
}

/* ─── Difficulty Badges ─────────────────────── */
.difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-easy {
    background: rgba(16,185,129,0.1);
    color: #34d399;
    border: 1px solid rgba(16,185,129,0.2);
}

.difficulty-medium {
    background: rgba(245,158,11,0.1);
    color: #fbbf24;
    border: 1px solid rgba(245,158,11,0.2);
}

.difficulty-hard {
    background: rgba(249,115,22,0.1);
    color: #fb923c;
    border: 1px solid rgba(249,115,22,0.2);
}

.difficulty-insane {
    background: rgba(255,60,60,0.1);
    color: #ff3c3c;
    border: 1px solid rgba(255,60,60,0.2);
}

/* ─── Cards ─────────────────────────────────── */
.card-nosec {
    background: #0f141c;
    border: 1px solid #1a2633;
    border-radius: 0.75rem;
    transition: all 0.3s;
}

.card-nosec:hover {
    border-color: rgba(255,60,60,0.4);
    box-shadow: 0 0 20px rgba(255,60,60,0.05);
}

/* ─── Glitch Hero Text ──────────────────────── */
.glitch-hero {
    position: relative;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 2.2rem;
    color: #00ffff;
    text-align: center;
    animation: heroGlitch 3s infinite;
}

@media (min-width: 640px) {
    .glitch-hero {
        font-size: 3rem;
    }
}

.glitch-hero::before,
.glitch-hero::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    color: #00ffff;
    background: transparent;
    overflow: hidden;
}

.glitch-hero::before {
    animation: glitchTop 2.5s infinite;
    color: #ff3c3c;
    clip-path: inset(0 0 60% 0);
}

.glitch-hero::after {
    animation: glitchBottom 2.5s infinite;
    color: #00ffff;
    clip-path: inset(60% 0 0 0);
}

@keyframes heroGlitch {
    0%, 25%, 100% { text-shadow: 0 0 8px rgba(0,255,255,0.5); }
    5%, 15% { text-shadow: 2px 0 #ff3c3c, -2px 0 #00ffff; }
    10%, 20% { text-shadow: -2px 0 #ff3c3c, 2px 0 #00ffff; }
}

@keyframes glitchTop {
    0%, 100% { transform: translate(0); }
    5% { transform: translate(-2px, -1px); }
    10% { transform: translate(2px, 1px); }
    15% { transform: translate(-1px, -1px); }
    20% { transform: translate(0); }
}

@keyframes glitchBottom {
    0%, 100% { transform: translate(0); }
    5% { transform: translate(2px, 1px); }
    10% { transform: translate(-2px, -1px); }
    15% { transform: translate(1px, 1px); }
    20% { transform: translate(0); }
}

/* ─── Terminal Box ──────────────────────────── */
.terminal-box {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0,0,0,0.8);
    border: 1px solid #1a2633;
    border-left: 3px solid #ff3c3c;
    padding: 0.75rem 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #00ff00;
    font-size: 0.8rem;
    overflow-x: auto;
    max-width: 100%;
    word-break: break-word;
}

@media (min-width: 640px) {
    .terminal-box {
        padding: 1rem 1.25rem;
        font-size: 0.85rem;
    }
}

/* ─── Typewriter Effect ─────────────────────── */
.typewriter-text {
    display: inline;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    white-space: nowrap;
    vertical-align: baseline;
    max-width: 100%;
}

@media (min-width: 640px) {
    .typewriter-text {
        font-size: 0.85rem;
    }
}

/* ─── Latest Updates Box ────────────────────── */
.updates-box {
    background: rgba(0,0,0,0.8);
    border: 1px solid #ff3c3c;
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    font-family: 'JetBrains Mono', monospace;
    color: #ff3c3c;
    box-shadow: 0 0 15px rgba(255,0,50,0.15);
    backdrop-filter: blur(4px);
    animation: fadeIn 1s ease-in-out;
}

.updates-box .updates-title {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,60,60,0.3);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
}

/* ─── Social Icons Row ──────────────────────── */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    border: 1px solid #1a2633;
    color: #888;
    transition: all 0.25s;
    font-size: 1.1rem;
}

.social-icon:hover {
    color: #fff;
    border-color: currentColor;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 10px currentColor;
}

/* ─── Writeup Content (rendered markdown) ─── */
.writeup-content {
    line-height: 1.8;
    color: #e0e0e0;
    font-family: 'Inter', system-ui, sans-serif;
}

.writeup-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
    border-bottom: 1px solid #1a2633;
    padding-bottom: 0.5rem;
}

.writeup-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #fff;
    border-bottom: 1px solid #1a2633;
    padding-bottom: 0.3rem;
}

.writeup-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.writeup-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.writeup-content p {
    margin-bottom: 1rem;
}

.writeup-content a {
    color: #00ffff;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.writeup-content a:hover {
    color: #ff3c3c;
    text-shadow: 0 0 4px rgba(255,60,60,0.3);
}

.writeup-content strong {
    color: #fff;
    font-weight: 600;
}

.writeup-content em {
    color: #bbb;
}

.writeup-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.writeup-content ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.writeup-content li {
    color: #bbb;
    margin-bottom: 0.25rem;
}

.writeup-content blockquote {
    border-left: 4px solid #ff3c3c;
    padding-left: 1rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin: 1rem 0;
    background: rgba(255,60,60,0.03);
    border-radius: 0 0.5rem 0.5rem 0;
    color: #888;
}

.writeup-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: #111;
    color: #00ffff;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.writeup-content pre {
    background: #0a0a0a;
    border: 1px solid #1a2633;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    position: relative;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
    .writeup-content pre {
        padding: 1rem;
    }
}

.writeup-content pre code {
    background: transparent;
    padding: 0;
    color: #ccc;
}

.writeup-content img {
    border-radius: 0.5rem;
    border: 1px solid #1a2633;
    margin: 1.5rem 0;
    max-width: 100%;
    height: auto;
}

.writeup-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.writeup-content th {
    background: rgba(255,255,255,0.05);
    border: 1px solid #1a2633;
    padding: 0.5rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ccc;
}

.writeup-content td {
    border: 1px solid #1a2633;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.writeup-content hr {
    border-color: #1a2633;
    margin: 2rem 0;
}

/* ─── Copy Button (code blocks) ─────────────── */
.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    background: #0f141c;
    color: #888;
    border: 1px solid #1a2633;
    border-radius: 0.25rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.writeup-content pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: #00ffff;
    border-color: #00ffff;
}

/* ─── Admonition (markdown extension) ──────── */
.admonition {
    border: 1px solid #1a2633;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* ─── MkDocs imported content overrides ──────── */
.writeup-content .md-annotation__index,
.writeup-content .headerlink,
.writeup-content .md-typeset__scrollwrap {
    display: none;
}

.writeup-content .language-bash,
.writeup-content .language-python,
.writeup-content .language-json,
.writeup-content .language-sql,
.writeup-content .language-powershell,
.writeup-content .language-xml {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* Hide duplicate H1 from imported content since template header already shows title */
.writeup-content > h1:first-child,
.writeup-content > h1:first-of-type {
    display: none;
}

/* Style the metadata block (Platform/IP/Difficulty/Author) from imported writeups */
.writeup-content > p:first-of-type strong,
.writeup-content > p:nth-of-type(2) strong,
.writeup-content > p:nth-of-type(3) strong,
.writeup-content > p:nth-of-type(4) strong {
    color: #ff3c3c;
}


.admonition.note {
    background: rgba(59,130,246,0.05);
    border-color: rgba(59,130,246,0.3);
    border-left: 3px solid #3b82f6;
}

.admonition.warning {
    background: rgba(245,158,11,0.05);
    border-color: rgba(245,158,11,0.3);
    border-left: 3px solid #f59e0b;
}

.admonition.danger {
    background: rgba(255,60,60,0.05);
    border-color: rgba(255,60,60,0.3);
    border-left: 3px solid #ff3c3c;
}

.admonition.tip {
    background: rgba(0,255,255,0.03);
    border-color: rgba(0,255,255,0.2);
    border-left: 3px solid #00ffff;
}

.admonition-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Hacker Quote ──────────────────────────── */
.hacker-quote {
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 0.85rem;
    position: relative;
}

.hacker-quote::before {
    content: '"';
    color: #ff3c3c;
    font-size: 1.2rem;
    margin-right: 0.25rem;
}

.hacker-quote::after {
    content: '"';
    color: #ff3c3c;
    font-size: 1.2rem;
    margin-left: 0.25rem;
}

/* ─── Scanline overlay ──────────────────────── */
.scanlines::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* ─── Profile image glow ────────────────────── */
.profile-glow {
    box-shadow: 0 0 15px rgba(255,0,0,0.3), 0 0 30px rgba(255,0,0,0.15);
    transition: box-shadow 0.3s;
}

.profile-glow:hover {
    box-shadow: 0 0 20px rgba(255,0,0,0.5), 0 0 40px rgba(255,0,0,0.25);
}

/* ─── Red glow text ─────────────────────────── */
.text-glow-red {
    text-shadow: 0 0 8px rgba(255,60,60,0.4);
}

.text-glow-cyan {
    text-shadow: 0 0 8px rgba(0,255,255,0.4);
}

/* ─── Animations ────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes iconFadeIn {
    from { opacity: 0; transform: translateY(8px) rotate(-8deg); }
    to   { opacity: 1; transform: translateY(0) rotate(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-icon-1 { opacity: 0; animation: iconFadeIn 0.4s 0.1s forwards; }
.animate-icon-2 { opacity: 0; animation: iconFadeIn 0.4s 0.2s forwards; }
.animate-icon-3 { opacity: 0; animation: iconFadeIn 0.4s 0.3s forwards; }
.animate-icon-4 { opacity: 0; animation: iconFadeIn 0.4s 0.4s forwards; }
.animate-icon-5 { opacity: 0; animation: iconFadeIn 0.4s 0.5s forwards; }
.animate-icon-6 { opacity: 0; animation: iconFadeIn 0.4s 0.6s forwards; }

/* ─── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #1a2633;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff3c3c;
}

/* ─── Line Clamp ────────────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Toggle Switch (admin) ─────────────────── */
.peer:checked ~ div > div {
    transform: translateX(1.25rem);
}

/* ─── Selection color ───────────────────────── */
::selection {
    background: rgba(255,60,60,0.3);
    color: #fff;
}

/* ─── Red accent link ───────────────────────── */
a.accent-link {
    color: #ff3c3c;
    text-decoration: none;
    transition: all 0.2s;
}

a.accent-link:hover {
    color: #00ffff;
    text-shadow: 0 0 6px rgba(0,255,255,0.3);
}

/* ─── Counter Up Animation ──────────────────── */
.counter-value {
    display: inline-block;
}

/* ─── Subtle Grid Background ────────────────── */
.grid-bg {
    background-image:
        linear-gradient(rgba(255,60,60,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,60,60,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ─── Card Shimmer Effect ───────────────────── */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.card-nosec::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255,60,60,0.03), transparent);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.card-nosec {
    position: relative;
    overflow: hidden;
}

.card-nosec:hover::before {
    opacity: 1;
    animation: shimmer 2s linear infinite;
}

/* ─── Stats Counter Animation ───────────────── */
@keyframes countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.stat-number {
    animation: countPulse 3s ease-in-out infinite;
    display: inline-block;
}

/* ─── Promo Banner ──────────────────────────── */
.promo-banner {
    background: linear-gradient(90deg, #ff3c3c, #cc0000);
    color: #fff;
    text-align: center;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.promo-banner::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: promoShine 3s linear infinite;
}

@keyframes promoShine {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* ─── Footer enhanced ───────────────────────── */
footer {
    position: relative;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff3c3c, transparent);
    box-shadow: 0 0 10px rgba(255,60,60,0.3);
}

/* ─── Tooltip ───────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    background: #0f141c;
    color: #e0e0e0;
    border: 1px solid #1a2633;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ─── Kbd Tag ───────────────────────────────── */
kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    background: #0a0a0a;
    border: 1px solid #1a2633;
    border-radius: 0.25rem;
    color: #888;
    box-shadow: 0 1px 0 #1a2633;
}

/* ─── Mobile Responsive Overrides ───────────── */
@media (max-width: 639px) {
    /* Smaller social icons on mobile */
    .social-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Filter pills */
    .filter-pill {
        padding: 0.35rem 0.75rem;
        font-size: 0.7rem;
    }

    /* Writeup content headings */
    .writeup-content h1 {
        font-size: 1.4rem;
        margin-top: 2rem;
    }
    .writeup-content h2 {
        font-size: 1.2rem;
        margin-top: 1.5rem;
    }
    .writeup-content h3 {
        font-size: 1.05rem;
        margin-top: 1rem;
    }

    /* Code blocks */
    .writeup-content code {
        font-size: 0.75rem;
        word-break: break-word;
    }
    .writeup-content pre code {
        font-size: 0.72rem;
        word-break: normal;
    }

    /* Buttons on mobile */
    .btn-primary, .btn-secondary {
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    /* Difficulty badges */
    .difficulty-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.5rem;
    }

    /* Nav-link-mobile */
    .nav-link-mobile {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Promo banner */
    .promo-banner {
        font-size: 0.65rem;
        padding: 0.3rem 0.75rem;
    }

    /* Tooltips hidden on touch devices */
    [data-tooltip]::after {
        display: none;
    }

    /* Updates box */
    .updates-box {
        padding: 1rem;
    }

    /* Stat number pulse */
    .stat-number {
        font-size: 1.5rem !important;
    }
}

/* ─── Touch device improvements ─────────────── */
@media (hover: none) {
    [data-tooltip]::after {
        display: none;
    }

    .social-icon:hover {
        transform: none;
    }

    .card-nosec:hover {
        transform: none;
    }
}

/* ─── Terminal widget mobile fullscreen ──────── */
@media (max-width: 639px) {
    #term-window {
        border-radius: 1rem 1rem 0 0 !important;
        max-height: 75vh !important;
    }
}

/* ─── GDPR Cookie Banner ────────────────────── */
.cookie-box {
    backdrop-filter: blur(12px);
    background: rgba(15, 20, 28, 0.95) !important;
}

@keyframes cookieSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes cookieSlideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

/* ─── Cursor Glow Trail ─────────────────────── */
#cursor-glow {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,60,60,0.06) 0%, rgba(0,255,255,0.03) 30%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

/* ─── Konami Code ───────────────────────────── */
@keyframes konamiShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.konami-flash {
    animation: konamiPulse 0.5s ease-in-out 3;
}

@keyframes konamiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── Now Hacking Footer Widget ─────────────── */
.now-hacking-pulse {
    animation: nowHackingGlow 3s ease-in-out infinite;
}

@keyframes nowHackingGlow {
    0%, 100% { border-color: rgba(255, 60, 60, 0.2); box-shadow: none; }
    50% { border-color: rgba(255, 60, 60, 0.4); box-shadow: 0 0 12px rgba(255, 60, 60, 0.1); }
}

/* ─── Enhanced Card Hover Glow ──────────────── */
.card-nosec {
    transition: all 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-nosec:hover {
    border-color: rgba(255, 60, 60, 0.3);
    box-shadow:
        0 0 20px rgba(255, 60, 60, 0.05),
        inset 0 0 20px rgba(255, 60, 60, 0.02);
}

/* ─── Animated nav link underline ───────────── */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #ff3c3c, #00ffff);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
    left: 10%;
}

/* ─── Social icon enhanced bounce ───────────── */
.social-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 60, 60, 0.2);
}

/* ─── Glitch text on hover ──────────────────── */
@keyframes glitchText {
    0% { text-shadow: 2px 0 #ff3c3c, -2px 0 #00ffff; }
    25% { text-shadow: -2px 0 #ff3c3c, 2px 0 #00ffff; }
    50% { text-shadow: 2px -1px #ff3c3c, -2px 1px #00ffff; }
    75% { text-shadow: -1px 2px #ff3c3c, 1px -2px #00ffff; }
    100% { text-shadow: 2px 0 #ff3c3c, -2px 0 #00ffff; }
}

/* ─── Scan line effect on hover for cards ───── */
.card-nosec::before {
    content: "";
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 60, 60, 0.03) 50%,
        transparent 100%
    );
    transition: top 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.card-nosec:hover::before {
    top: 100%;
}

/* ─── Typing cursor blink enhancement ───────── */
.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #ff3c3c;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorPulse 0.8s ease-in-out infinite;
}

@keyframes cursorPulse {
    0%, 50% { opacity: 1; box-shadow: 0 0 4px #ff3c3c; }
    51%, 100% { opacity: 0; box-shadow: none; }
}

/* ─── Protected Content Lock Box ────────────── */
.protected-lock-box {
    background: linear-gradient(135deg, rgba(255, 60, 60, 0.03), rgba(0, 0, 0, 0.5));
    border: 1px solid rgba(255, 60, 60, 0.2);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

.protected-lock-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff3c3c, transparent);
    animation: protectedScan 3s ease-in-out infinite;
}

@keyframes protectedScan {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Subtle scan line inside protected box */
.protected-lock-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 60, 60, 0.01) 2px,
        rgba(255, 60, 60, 0.01) 4px
    );
    pointer-events: none;
}

/* ─── Telegram CTA Banner ───────────────────── */
.telegram-cta {
    animation: telegramPulse 4s ease-in-out infinite;
}

@keyframes telegramPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(38, 165, 228, 0); }
    50% { box-shadow: 0 0 20px 0 rgba(38, 165, 228, 0.1); }
}

/* ─── Challenge Terminal ────────────────────── */
.challenge-terminal {
    box-shadow:
        0 0 30px rgba(34, 197, 94, 0.08),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.challenge-terminal::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(34, 197, 94, 0.015) 2px,
        rgba(34, 197, 94, 0.015) 4px
    );
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
}

.challenge-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.challenge-scrollbar::-webkit-scrollbar-track {
    background: rgba(34, 197, 94, 0.05);
}
.challenge-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, 0.2);
    border-radius: 3px;
}
.challenge-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 197, 94, 0.35);
}

/* ═══════════════════════════════════════════════════════
   PAGE TRANSITION LOADER
   ═══════════════════════════════════════════════════════ */
#page-loader {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

/* Scan line sweeping top → bottom */
.page-loader-scanline {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ffff, transparent);
    box-shadow: 0 0 12px #00ffff, 0 0 24px rgba(0, 255, 255, 0.3);
    animation: scanSweep 1.2s ease-in-out infinite;
    z-index: 2;
}

@keyframes scanSweep {
    0%   { top: -2px; opacity: 1; }
    100% { top: 100%; opacity: 0.4; }
}

/* Horizontal glitch bars */
.page-loader-glitch-bar {
    position: absolute;
    left: 0;
    width: 100%;
    background: rgba(255, 60, 60, 0.15);
    animation: glitchFlash 0.8s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes glitchFlash {
    0%   { opacity: 0; transform: scaleX(1); }
    40%  { opacity: 1; transform: scaleX(1.02); }
    60%  { opacity: 0.7; transform: scaleX(0.98) translateX(2px); }
    100% { opacity: 0; transform: scaleX(1); }
}

/* Center loading indicator */
.page-loader-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.page-loader-text {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: textGlitch 2s ease-in-out infinite;
}

@keyframes textGlitch {
    0%, 100% { opacity: 1; transform: translateX(0); }
    10%      { opacity: 0.8; transform: translateX(-2px); color: #ff3c3c; }
    12%      { opacity: 1; transform: translateX(2px); color: #00ffff; }
    30%      { opacity: 1; transform: translateX(0); }
    50%      { opacity: 0.9; }
    52%      { opacity: 1; transform: translateX(1px); }
}

/* Animated dots ... */
.page-loader-dots::after {
    content: '';
    animation: loaderDots 1.5s steps(4, end) infinite;
}

@keyframes loaderDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}
