/* DizyDiz - Dark Modern Theme with Animations */
:root {
    --bg-primary: #0f0f13;
    --bg-secondary: #16161d;
    --bg-card: #1c1c27;
    --bg-card-hover: #22223a;
    --text-primary: #e4e4ec;
    --text-secondary: #9d9db5;
    --accent: #7c6ff7;
    --accent-glow: rgba(124, 111, 247, 0.25);
    --accent-hover: #9589ff;
    --accent-dim: #5a4fd4;
    --border: #2a2a3d;
    --radius: 12px;
    --max-width: 960px;
    --transition-speed: 0.3s;
    --green: #4ade80;
    --amber: #fbbf24;
    --red: #f87171;
    --cyan: #22d3ee;
}

[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #e8e8ed;
    --bg-card: #ffffff;
    --bg-card-hover: #f0eeff;
    --text-primary: #1a1a2e;
    --text-secondary: #555577;
    --accent: #6c5ce7;
    --accent-glow: rgba(108, 92, 231, 0.2);
    --accent-hover: #7c6ff7;
    --accent-dim: #5a4fd4;
    --border: #d4d4e0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

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

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

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
    50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px rgba(124, 111, 247, 0.1); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out both;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out both;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out both;
}

/* Stagger delays for card grids */
.card-grid .card:nth-child(1) { animation-delay: 0.1s; }
.card-grid .card:nth-child(2) { animation-delay: 0.2s; }
.card-grid .card:nth-child(3) { animation-delay: 0.3s; }
.card-grid .card:nth-child(4) { animation-delay: 0.4s; }
.card-grid .card:nth-child(5) { animation-delay: 0.5s; }
.card-grid .card:nth-child(6) { animation-delay: 0.6s; }

.blog-list .card:nth-child(1) { animation-delay: 0.1s; }
.blog-list .card:nth-child(2) { animation-delay: 0.2s; }
.blog-list .card:nth-child(3) { animation-delay: 0.3s; }
.blog-list .card:nth-child(4) { animation-delay: 0.4s; }
.blog-list .card:nth-child(5) { animation-delay: 0.5s; }

/* ===== Navigation ===== */
.navbar {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(22, 22, 29, 0.92);
    transition: background var(--transition-speed), border-color var(--transition-speed);
}

[data-theme="light"] .navbar {
    background: rgba(232, 232, 237, 0.92);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.logo:hover {
    color: var(--accent-hover);
    transform: scale(1.05);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-speed);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* Theme toggle */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-card-hover);
}

/* ===== Hero ===== */
.hero {
    padding: 5rem 0 3rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: background var(--transition-speed);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--accent-glow) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* ===== Content ===== */
main {
    flex: 1;
    padding: 3rem 0;
}

.content-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.section-title:hover::after {
    width: 100%;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all var(--transition-speed) ease;
    animation: fadeInUp 0.6s ease-out both;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.card.featured {
    border-left: 3px solid var(--accent);
    animation: glowPulse 4s ease-in-out infinite;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-hover);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card .date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* ===== Blog list ===== */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-list .card {
    cursor: default;
}

.blog-list .card h2 {
    font-size: 1.3rem;
}

/* ===== Tags ===== */
.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    margin-right: 0.4rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-archive {
    background: rgba(124, 111, 247, 0.15);
    color: var(--accent);
    border: 1px solid rgba(124, 111, 247, 0.3);
}

.tag-tech {
    background: rgba(34, 211, 238, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(34, 211, 238, 0.3);
}

.tag-homelab {
    background: rgba(74, 222, 128, 0.12);
    color: var(--green);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.tag-rant {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.tag-meta {
    background: rgba(251, 191, 36, 0.12);
    color: var(--amber);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ===== About page ===== */
.about-content {
    max-width: 700px;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

/* ===== Timeline ===== */
.timeline {
    margin-top: 2rem;
    border-left: 2px solid var(--border);
    padding-left: 1.5rem;
    position: relative;
}

.timeline-item {
    margin-bottom: 1.5rem;
    position: relative;
    animation: slideInLeft 0.6s ease-out both;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover::before {
    transform: scale(1.4);
    box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-item .year {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.9rem;
}

.timeline-item p {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.timeline-item .timeline-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
    font-style: italic;
    margin-top: 0.25rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn:hover::before {
    left: 100%;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

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

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* ===== Projects / Lab page ===== */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

.status-dot.offline {
    background: var(--red);
    animation: none;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.spec-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all var(--transition-speed);
}

.spec-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.spec-item .spec-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}

.spec-item .spec-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Network topology */
.network-diagram {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre;
}

.network-diagram .highlight {
    color: var(--accent);
    font-weight: bold;
}

/* ===== Archive callout ===== */
.archive-notice {
    background: linear-gradient(135deg, rgba(124, 111, 247, 0.08), rgba(124, 111, 247, 0.02));
    border: 1px solid rgba(124, 111, 247, 0.2);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.archive-notice .archive-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ===== Quote block ===== */
.quote-block {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    background: rgba(124, 111, 247, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: auto;
    transition: border-color var(--transition-speed);
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer .footer-sub {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 0.25rem;
}

.footer-links {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition-speed);
}

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

/* ===== Scroll-to-top ===== */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 15px var(--accent-glow);
    z-index: 99;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .card {
        padding: 1.5rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .spec-grid {
        grid-template-columns: 1fr 1fr;
    }

    .network-diagram {
        font-size: 0.65rem;
        padding: 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ===== Mobile nav toggle ===== */
@media (max-width: 500px) {
    .nav-links {
        gap: 0.75rem;
    }

    .nav-links a {
        font-size: 0.82rem;
    }
}
