/* =====================================================================
   base.css — shared site chrome for siddhant-singh.com
   Palette, reset, animated background, navigation, and footer.
   Loaded on every page BEFORE mobile-header.css and before the page's
   own <style>, so page-specific rules always win in the cascade.
   ===================================================================== */

:root {
    /* Canonical palette — single source of truth for every page. */
    --color-black: #0a0a0a;
    --color-dark-teal: #1a4d4f;
    --color-light-teal: #2fb8aa;
    --color-white: #f5f5f5;
    --color-gray: #cccccc;
    --color-yellow: #e8c547;
    --color-yellow-dim: rgba(232, 197, 71, 0.3);
    --color-red: #ff6b6b;
    --color-blue: #4a90e2;
    /* Semantic state colors (forms, banners) */
    --color-success: #51cf66;
    --color-error: #ff6b6b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-black);
    color: var(--color-white);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Static-image background — a no-JS fallback. When JavaScript runs,
   mobile-header.js hides these layers and draws the animated canvas.
   The image is a high-res still of that same quantum stabilizer network,
   served locally. Path is relative to THIS stylesheet (css/ -> ../images/). */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/quantum_network_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 0;
    animation: stabilizersweep 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes stabilizersweep {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.75; }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 40%, rgba(47, 184, 170, 0.02) 0%, transparent 60%),
        radial-gradient(circle at 70% 60%, rgba(26, 77, 79, 0.01) 0%, transparent 60%);
    z-index: 0;
    animation: measurementPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes measurementPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.05); opacity: 0.5; }
}

main,
nav,
footer {
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------------------
   Navigation
   --------------------------------------------------------------------- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(90deg, rgba(8, 12, 12, 0.95) 0%, rgba(26, 77, 79, 0.85) 50%, rgba(8, 12, 12, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    padding: 0.7rem 2rem;
    border-bottom: 1px solid rgba(47, 184, 170, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--color-light-teal);
    text-decoration: none;
    transition: color 0.3s ease;
}

nav .logo:hover {
    color: var(--color-white);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
}

nav a {
    color: var(--color-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

nav a:hover {
    color: var(--color-white);
    background-color: var(--color-dark-teal);
    box-shadow: 0 4px 12px rgba(47, 184, 170, 0.2);
}

/* Current page — set by js/site-chrome.js */
nav a.active {
    color: var(--color-light-teal);
    background-color: rgba(47, 184, 170, 0.12);
    font-weight: 600;
}

/* ---------------------------------------------------------------------
   Back link (used on sub-pages: tools, blog posts, etc.)
   --------------------------------------------------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-light-teal);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--color-white);
    transform: translateX(-3px);
}

/* ---------------------------------------------------------------------
   Footer
   (mobile-header.js overrides background/padding/border at runtime;
   these rules are the pre-JS baseline and provide .social-links.)
   --------------------------------------------------------------------- */
footer {
    background-color: var(--color-dark-teal);
    padding: 1rem 0;
    text-align: center;
    border-top: 3px solid var(--color-light-teal);
    margin-top: 3rem;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 77, 79, 0.5), rgba(10, 10, 10, 0.5));
    z-index: 0;
}

footer p,
.social-links {
    position: relative;
    z-index: 1;
}

footer p {
    color: var(--color-white);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--color-light-teal);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: var(--color-white);
    filter: drop-shadow(0 0 8px var(--color-light-teal));
    transform: scale(1.1);
}

.social-links svg {
    width: 24px;
    height: 24px;
}

/* ---------------------------------------------------------------------
   Shared content utilities (used across multiple pages)
   --------------------------------------------------------------------- */

.tag {
    display: inline-block;
    background-color: var(--color-dark-teal);
    color: var(--color-light-teal);
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
}

.tag:hover {
    background-color: var(--color-light-teal);
    color: var(--color-black);
}

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