/* Digital Pulse Hero Theme */
:root {
    --bg-color: #030303;
    --grid-color: rgba(255, 255, 255, 0.03);
    --accent-blue: #3da9fc;
    --accent-glow: rgba(61, 169, 252, 0.4);
    --text-white: #ffffff;
    --text-dim: #8b949e;
    --font-main: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-white);
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* --- Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Animations --- */
@keyframes slideOutLeft {
    to {
        transform: translateX(-100%);
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
    }
}

@keyframes revealFlash {
    0% {
        opacity: 0;
        transform: scaleY(0);
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
    }

    100% {
        opacity: 0;
        transform: scaleY(2);
    }
}

@keyframes pulseHeartbeat {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 8px var(--accent-blue));
    }
}

@keyframes drawECG {
    0% {
        stroke-dashoffset: 2000;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes beamRotate {
    0% {
        --beam-angle: 0deg;
    }

    100% {
        --beam-angle: 360deg;
    }
}

@keyframes scanlineMove {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotateX(10deg) rotateY(-10deg);
    }

    50% {
        transform: translateY(-15px) rotateX(10deg) rotateY(-10deg);
    }
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- Curtain Reveal --- */
.curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    display: flex;
}

.curtain-panel {
    width: 50%;
    height: 100%;
    background: #000;
}

/* Classes to trigger animations */
.curtain.active .curtain-panel.left {
    animation: slideOutLeft 1.2s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

.curtain.active .curtain-panel.right {
    animation: slideOutRight 1.2s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

.curtain-flash {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: white;
    box-shadow: 0 0 20px 5px var(--accent-blue);
    transform: translateX(-50%) scaleY(0);
    opacity: 0;
}

.curtain.active .curtain-flash {
    animation: revealFlash 1s ease-out forwards;
}

/* --- Background Grid --- */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to bottom, transparent, var(--accent-blue), transparent);
    opacity: 0.3;
    z-index: -1;
    animation: scanlineMove 6s linear infinite;
}

/* --- Navbar --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    background: rgba(3, 3, 3, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

/* --- Logo --- */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-text {
    color: #65b1ff;
    /* Accent light from style.css */
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.logo-img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 5px rgba(61, 169, 252, 0.5));
    animation: pulseHeartbeat 3s infinite ease-in-out;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav ul li a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--accent-blue);
}

/* --- Mobile Menu Toggle --- */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-white);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* --- Hero Section --- */
.hero {
    min-height: 90vh;
    /* Adjust for marquee */
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-white) 30%, var(--accent-blue) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    max-width: 500px;
    line-height: 1.6;
}

/* --- Beam Button --- */
@property --beam-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.btn-beam {
    position: relative;
    padding: 1rem 2.5rem;
    background: rgba(61, 169, 252, 0.1);
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    border-radius: 9999px;
    /* Pill shape */
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-beam::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 9999px;
    padding: 2px;
    background: conic-gradient(from var(--beam-angle), transparent 50%, var(--accent-blue));
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: beamRotate 2s linear infinite;
}

.btn-beam:hover {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 30px var(--accent-glow);
}

.btn-ghost {
    padding: 1rem 2.5rem;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-ghost:hover {
    border-color: var(--accent-blue);
    color: #fff;
    background: rgba(61, 169, 252, 0.05);
    box-shadow: 0 0 20px rgba(61, 169, 252, 0.1);
}

.cta-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* --- Hero Visual (Screenshot) --- */
.hero-visual {
    position: relative;
    perspective: 1000px;
    animation: float 6s ease-in-out infinite;
}

.hero-visual img {
    width: 100%;
    max-width: 720px;
    /* Increased by 20% */
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(61, 169, 252, 0.2);
    transform: rotateY(-5deg) rotateX(5deg);
    transition: all 0.5s ease;
}

.hero-visual:hover img {
    transform: rotateY(0) rotateX(0) scale(1.02);
    border-color: var(--accent-blue);
    box-shadow: 0 0 30px rgba(61, 169, 252, 0.2);
}

.hero-float-card {
    position: absolute;
    top: -20px;
    right: -30px;
    background: rgba(61, 169, 252, 0.15);
    border: 1px solid rgba(61, 169, 252, 0.4);
    backdrop-filter: blur(12px);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 150px;
    height: 100px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: float 5s ease-in-out infinite reverse;
    z-index: 20;
    color: #fff;
}

/* --- ECG Line --- */
.ecg-container {
    position: absolute;
    bottom: 20%;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
}

.ecg-container svg {
    width: 100%;
    height: 100%;
}

.ecg-path {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 2;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawECG 4s linear infinite;
}

/* --- Sections (Ported from index) --- */
.section {
    padding: 6rem 0;
    position: relative;
    z-index: 10;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--accent-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(61, 169, 252, 0.1), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 40px -10px rgba(61, 169, 252, 0.2);
}

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

.feature-card h3 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    position: relative;
}

.feature-card p {
    color: var(--text-dim);
    line-height: 1.7;
}

/* Features Zig-Zag Layout (matches original style.css) */
.features {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    margin-top: 2rem;
}

.feature-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    background: transparent;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: var(--accent-blue);
    background: rgba(61, 169, 252, 0.02);
}

/* Alternate order for zig-zag */
.feature-card:nth-child(even) {
    flex-direction: row-reverse;
}

.feature-text {
    flex: 1;
    max-width: 50%;
}

.feature-text h3 {
    font-size: 1.5rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.feature-text p {
    color: var(--text-dim);
    line-height: 1.7;
    font-size: 1rem;
}

/* Feature Visuals (constrained like original) */
.feature-visual {
    flex: 1;
    max-width: 50%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    background: #1c2128;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(61, 169, 252, 0.1);
    transition: all 0.3s;
}

.feature-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feature-card:hover .feature-visual {
    border-color: var(--accent-blue);
    box-shadow: 0 20px 40px rgba(61, 169, 252, 0.15);
}

.feature-card:hover .feature-visual img {
    transform: scale(1.03);
}

/* Mobile Responsiveness for Features */
@media (max-width: 900px) {

    .feature-card,
    .feature-card:nth-child(even) {
        flex-direction: column;
        gap: 2rem;
    }

    .feature-text,
    .feature-visual {
        max-width: 100%;
    }

    .feature-text {
        text-align: center;
    }
}

/* Technical Specifications Section */
.technical-specs {
    margin-top: 6rem;
    padding: 4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.technical-specs h2 {
    font-size: 2rem;
    text-align: center;
    color: var(--accent-blue);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.spec-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s;
}

.spec-item:hover {
    border-color: var(--accent-blue);
    background: rgba(61, 169, 252, 0.03);
    transform: translateY(-5px);
}

.spec-item h4 {
    color: var(--accent-blue);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.spec-item p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* CTA Section (features page uses .cta class) */
.cta,
.cta-section {
    text-align: center;
    padding: 6rem 2rem;
    margin-top: 4rem;
    background: linear-gradient(to top, rgba(61, 169, 252, 0.08), transparent);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px 24px 0 0;
}

.cta h2,
.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-white);
}

.cta p,
.cta-section p {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* CTA Buttons */
.cta .btn,
.cta-section .btn-beam {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--accent-blue);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s;
    margin: 0.5rem;
}

.cta .btn:hover {
    background: #65b1ff;
    box-shadow: 0 0 30px rgba(61, 169, 252, 0.4);
}

.cta .btn-secondary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s;
    margin: 0.5rem;
}

.cta .btn-secondary:hover {
    background: var(--accent-blue);
    color: #fff;
}

/* Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-dim);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), #000);
}

footer p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

footer a {
    color: var(--text-white);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s;
    font-size: 0.9rem;
}

footer a:hover {
    color: var(--accent-blue);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

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

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-visual img {
        max-width: 100%;
        transform: rotateY(0) rotateX(0);
        /* Flatten on mobile */
    }

    .curtain {
        display: none;
        /* Simplify on mobile if needed, or keep it */
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(3, 3, 3, 0.95);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    nav ul.active,
    nav ul.mobile-menu-open {
        right: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Hamburger Animation */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg);
    }
}

/* --- Resource Center / Reading Mode --- */
/* Apply this class to body of resource pages */
.resource-page .scanline {
    display: none;
}

.resource-page .bg-grid {
    opacity: 0.3;
    /* Quieter background */
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 6rem 1rem 4rem;
    position: relative;
    z-index: 10;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-white);
}

.page-header p {
    color: var(--text-dim);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Breadcrumbs */
.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.breadcrumb a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: opacity 0.3s;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb span {
    color: var(--text-dim);
}

/* Filter Bar */
.filter-bar {
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group label {
    color: var(--text-dim);
    font-weight: 500;
}

.filter-group select {
    background: #0d1117;
    border: 1px solid rgba(61, 169, 252, 0.2);
    color: var(--text-white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.filter-group select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(61, 169, 252, 0.2);
}

/* Resource/Article Grid */
.articles-grid,
.resource-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Article Card (Optimized for Reading) */
.article-card,
.resource-category {
    flex: 1 1 320px;
    max-width: 400px;
    width: 100%;
    background: #161b22;
    /* High opacity for readability */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.article-card:hover,
.resource-category:hover {
    transform: translateY(-4px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.article-meta {
    padding: 1.5rem 1.5rem 0.5rem;
    display: flex;
    gap: 0.8rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.article-meta span {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
}

.article-meta .category {
    background: rgba(61, 169, 252, 0.1);
    color: var(--accent-blue);
}

.article-meta .level {
    background: rgba(46, 160, 67, 0.1);
    /* Green tint */
    color: #3fb950;
}

.article-meta .read-time {
    color: var(--text-dim);
    margin-left: auto;
}

.article-card h3,
.resource-category h3 {
    margin: 1rem 1.5rem;
    font-size: 1.4rem;
    line-height: 1.4;
    color: var(--text-white);
}

.article-card p,
.resource-category p {
    padding: 0 1.5rem;
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.article-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
}

.article-footer .date {
    font-size: 0.85rem;
    color: #555;
}

.read-more {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-more:hover {
    gap: 8px;
    /* Slide arrow effect */
}

/* Resource Category Specifics */
.resource-category {
    padding: 2rem;
    align-items: center;
    text-align: center;
}

.resource-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}