/*
Theme Name: PodStack
Theme URI: https://podstack.example
Author: PodStack
Author URI: https://podstack.example
Description: Custom WordPress theme for PodStack blog with bespoke navbar and footer.
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: podstack
*/

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Primary Orange Colors */
    --color-primary: #F97316;
    --color-primary-hover: #EA580C;
    --color-orange-light: #FB923C;
    --color-orange-lighter: #FDBA74;
    --color-orange-dark: #C2410C;
    --color-orange-darker: #9A3412;

    /* Brand Gradient */
    --gradient-brand: linear-gradient(135deg, #FB923C 0%, #F97316 50%, #EA580C 100%);

    /* Light Mode Colors */
    --color-bg-light: #ffffff;
    --color-bg-grey-light: #f9f9f9;
    --color-text-primary-light: #0F172A;
    --color-text-secondary-light: #6B7280;
    --color-text-nav-light: #374151;
    --color-border-light: #e5e7eb;

    /* Dark Mode Colors */
    --color-bg-dark: #0a0a0f;
    --color-bg-grey-dark: rgba(30, 41, 59, 1);
    --color-text-primary-dark: #FFFFFF;
    --color-text-secondary-dark: #9CA3AF;
    --color-text-nav-dark: #D1D5DB;
    --color-border-dark: rgba(225, 225, 225, 0.1);

    /* Active Colors (Dark Mode by Default) */
    --color-bg: var(--color-bg-dark);
    --color-bg-grey: var(--color-bg-grey-dark);
    --color-text: var(--color-text-primary-dark);
    --color-text-secondary: var(--color-text-secondary-dark);
    --color-text-nav: var(--color-text-nav-dark);
    --color-border: var(--color-border-dark);
    --color-muted: var(--color-text-secondary-dark);
    --color-accent: var(--color-primary);

    /* Layout Dimensions */
    --header-height: 74px;
    --sidebar-width: 280px;
    --toc-width: 250px;
    --padding-base: 12px;
    --padding-double: 24px;
    --radius: 4px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Code Block Colors */
    --code-bg-light: #f9f9f9;
    --code-bg-dark: rgba(30, 41, 59, 1);
    --code-bg: var(--code-bg-dark);

    /* Shadows */
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.35);

    /* Scroll Offset */
    --scroll-offset: 80px;
}

* {
    box-sizing: border-box;
}

/* Light Mode Support */
@media (prefers-color-scheme: light) {
    :root {
        --color-bg: var(--color-bg-light);
        --color-bg-grey: var(--color-bg-grey-light);
        --color-text: var(--color-text-primary-light);
        --color-text-secondary: var(--color-text-secondary-light);
        --color-text-nav: var(--color-text-nav-light);
        --color-border: var(--color-border-light);
        --color-muted: var(--color-text-secondary-light);
        --code-bg: var(--code-bg-light);
    }
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    scroll-padding-top: var(--scroll-offset);
    position: relative;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-hover);
}

.container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

main {
    flex: 1;
    padding: var(--padding-double) 0 48px;
}

.card {
    padding: 20px;
    background: var(--color-bg-grey);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.mono,
code,
pre {
    font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: var(--radius);
    color: var(--color-primary);
    font-size: 0.9em;
}

pre {
    background: var(--code-bg);
    padding: var(--padding-base);
    border-radius: var(--radius);
    overflow-x: auto;
    border: 1px solid var(--color-border);
}

pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.muted {
    color: var(--color-muted);
}

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

/* ===================================
   Background Decorations - Tech Theme
   =================================== */

/* Background Container */
.tech-bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Decoration Base Styles */
.tech-decoration {
    position: absolute;
    pointer-events: none;
    opacity: 0.4;
}

/* GPU Card */
.tech-gpu {
    width: 48px;
    height: 28px;
    background: var(--color-primary);
    border-radius: 2px;
    position: relative;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.tech-gpu::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 8px;
    width: 32px;
    height: 2px;
    background: var(--color-orange-lighter);
    box-shadow: 0 6px 0 var(--color-orange-lighter);
}

/* Server Rack */
.tech-server {
    width: 32px;
    height: 48px;
    background: linear-gradient(180deg, var(--color-orange-light) 0%, var(--color-primary) 100%);
    border-radius: 2px;
    position: relative;
}

.tech-server::before,
.tech-server::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    left: 6px;
    animation: blink-leds 2s ease-in-out infinite;
}

.tech-server::before {
    top: 8px;
    background: var(--color-orange-lighter);
}

.tech-server::after {
    top: 18px;
    background: var(--color-orange-lighter);
    animation-delay: 0.5s;
}

/* Neural Network Node */
.tech-neural {
    width: 48px;
    height: 48px;
    position: relative;
}

.tech-neural::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        -16px -16px 0 -4px var(--color-orange-light),
        16px -16px 0 -4px var(--color-orange-light),
        -16px 16px 0 -4px var(--color-orange-light),
        16px 16px 0 -4px var(--color-orange-light);
}

.tech-neural::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg, transparent 48%, var(--color-orange-lighter) 48%, var(--color-orange-lighter) 52%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, var(--color-orange-lighter) 48%, var(--color-orange-lighter) 52%, transparent 52%);
    opacity: 0.3;
}

/* Processor Chip */
.tech-chip {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 2px;
    position: relative;
}

.tech-chip::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--color-orange-dark);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1px;
}

.tech-chip::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    box-shadow:
        -4px 8px 0 -2px var(--color-orange-lighter),
        4px 8px 0 -2px var(--color-orange-lighter),
        -4px -8px 0 -2px var(--color-orange-lighter),
        4px -8px 0 -2px var(--color-orange-lighter),
        8px 4px 0 -2px var(--color-orange-lighter),
        8px -4px 0 -2px var(--color-orange-lighter),
        -8px 4px 0 -2px var(--color-orange-lighter),
        -8px -4px 0 -2px var(--color-orange-lighter);
}

/* Data Cube/Tensor */
.tech-cube {
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    transform: rotate(45deg);
    position: relative;
    border-radius: 2px;
}

.tech-cube::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--color-orange-light);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 1px;
}

/* Binary Code Stream */
.tech-binary {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--color-primary);
    line-height: 1.2;
    white-space: pre;
    opacity: 0.6;
}

/* Circuit Trace */
.tech-circuit {
    width: 40px;
    height: 24px;
    position: relative;
}

.tech-circuit::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--color-primary) 20%,
            var(--color-primary) 80%,
            transparent 100%);
    top: 50%;
}

.tech-circuit::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-orange-light);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ===================================
   Animations
   =================================== */

@keyframes float-gentle {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    25% {
        transform: translateY(-12px) translateX(6px);
    }

    50% {
        transform: translateY(-8px) translateX(-4px);
    }

    75% {
        transform: translateY(-16px) translateX(8px);
    }
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    33% {
        transform: translateY(-20px) translateX(-8px);
    }

    66% {
        transform: translateY(-10px) translateX(10px);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.4;
        filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.3));
    }

    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 16px rgba(249, 115, 22, 0.6));
    }
}

@keyframes data-flow {
    0% {
        transform: translateY(0);
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }

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

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes blink-leds {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Apply animations to decorations */
.tech-decoration:nth-child(1) {
    animation: float-gentle 8s ease-in-out infinite;
}

.tech-decoration:nth-child(2) {
    animation: float-slow 10s ease-in-out infinite;
    animation-delay: -2s;
}

.tech-decoration:nth-child(3) {
    animation: pulse-glow 4s ease-in-out infinite;
}

.tech-decoration:nth-child(4) {
    animation: float-gentle 8s ease-in-out infinite;
    animation-delay: -4s;
}

.tech-decoration:nth-child(5) {
    animation: float-slow 10s ease-in-out infinite;
    animation-delay: -6s;
}

.tech-decoration:nth-child(6) {
    animation: pulse-glow 4s ease-in-out infinite;
    animation-delay: -1s;
}

.tech-decoration:nth-child(7) {
    animation: float-gentle 8s ease-in-out infinite;
    animation-delay: -3s;
}

.tech-decoration:nth-child(8) {
    animation: float-slow 10s ease-in-out infinite;
    animation-delay: -5s;
}

.tech-decoration:nth-child(9) {
    animation: pulse-glow 4s ease-in-out infinite;
    animation-delay: -2s;
}

.tech-decoration.spin {
    animation: spin-slow 20s linear infinite;
}

.tech-decoration.flow {
    animation: data-flow 8s linear infinite;
}

/* Light mode adjustments */
@media (prefers-color-scheme: light) {
    .tech-decoration {
        opacity: 0.15;
    }

    .tech-decoration:nth-child(odd) {
        opacity: 0.08;
    }
}

/* Hide on mobile */
@media (max-width: 768px) {
    .tech-bg-decorations {
        display: none;
    }
}

/* Hide left decorations on smaller screens */
@media (max-width: 1400px) {
    .tech-decoration.left-side {
        display: none;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .tech-decoration {
        animation: none !important;
    }
}