/* template.css — site design layer for the new CagsTech build.
   Design grows here bit by bit. */

:root {
    --bg-base: #02060a;
    --accent-cyan: #29c6dc;
    --accent-bright: #7af0ff;
    --text: #e6f4f8;
    --text-dim: #a8c6d2;
    --font-sans: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;
    --header-h: 4.25rem;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    color: var(--text);
    font-family: var(--font-sans);
}

/* ---------------------------------------------------------------------------
   Circuit-board background
   One large SVG composition: a glowing cyan core at center with circuit traces
   and solder nodes radiating outward and fading toward the edges. Painted on a
   fixed full-viewport layer behind all content.
--------------------------------------------------------------------------- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("/content/circuit-bg.svg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

/* ---------------------------------------------------------------------------
   Site header
   Slim sticky bar: brand (logo + wordmark) left, nav right. Translucent dark
   glass over the circuit bg, a hairline cyan rule, and a soft cyan underglow
   so it sits on the page like a lit HUD panel.
--------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 clamp(1.25rem, 4vw, 3rem);
    background: linear-gradient(180deg,
        rgba(3, 11, 18, 0.92) 0%,
        rgba(3, 11, 18, 0.78) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border-bottom: 1px solid rgba(41, 198, 220, 0.22);
    box-shadow:
        0 1px 0 rgba(122, 240, 255, 0.06),
        0 12px 30px -18px rgba(0, 0, 0, 0.9);
}

/* hairline cyan glow line riding the bottom edge */
.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(41, 198, 220, 0.55) 20%,
        rgba(122, 240, 255, 0.7) 50%,
        rgba(41, 198, 220, 0.55) 80%,
        transparent);
    opacity: 0.6;
}

/* --- brand --- */
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
}

.site-brand-logo {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 6px rgba(41, 198, 220, 0.35));
    transition: filter 0.2s ease, transform 0.2s ease;
}

.site-brand:hover .site-brand-logo {
    filter: drop-shadow(0 0 10px rgba(122, 240, 255, 0.55));
    transform: translateY(-1px);
}

.site-brand-name {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
    line-height: 1;
}

.site-brand-accent {
    color: var(--accent-bright);
    text-shadow: 0 0 12px rgba(122, 240, 255, 0.4);
}

/* --- nav --- */
.site-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.site-nav-link {
    position: relative;
    padding: 0.5rem 0.9rem;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-dim);
    border-radius: 4px;
    transition: color 0.16s ease, background 0.16s ease;
}

/* animated underline that grows from center on hover */
.site-nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: 0.32rem;
    height: 1.5px;
    background: var(--accent-bright);
    box-shadow: 0 0 6px rgba(122, 240, 255, 0.6);
    transition: left 0.18s ease, right 0.18s ease;
}

.site-nav-link:hover {
    color: var(--text);
}

.site-nav-link:hover::after {
    left: 0.9rem;
    right: 0.9rem;
}

/* current page — persistent bright label + underline (not the CTA pill) */
.site-nav-link[aria-current="page"]:not(.site-nav-cta) {
    color: var(--accent-bright);
}

.site-nav-link[aria-current="page"]:not(.site-nav-cta)::after {
    left: 0.9rem;
    right: 0.9rem;
}

/* contact pill — primary action */
.site-nav-cta {
    margin-left: 0.4rem;
    color: var(--accent-bright);
    border: 1px solid rgba(41, 198, 220, 0.45);
    background: rgba(41, 198, 220, 0.06);
}

.site-nav-cta::after {
    display: none;
}

.site-nav-cta:hover {
    color: #02141a;
    background: var(--accent-bright);
    border-color: var(--accent-bright);
    box-shadow: 0 0 16px -2px rgba(122, 240, 255, 0.5);
}

/* --- mobile toggle (hidden on desktop) --- */
.site-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0 9px;
    border: 1px solid rgba(41, 198, 220, 0.3);
    border-radius: 5px;
    background: rgba(41, 198, 220, 0.05);
}

.site-nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--accent-cyan);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 720px) {
    .site-nav {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem clamp(1.25rem, 4vw, 3rem) 1rem;
        background: rgba(3, 11, 18, 0.97);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(41, 198, 220, 0.22);
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.18s ease, opacity 0.18s ease;
    }

    .site-header[data-nav-open="true"] .site-nav {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav-link {
        padding: 0.85rem 0.4rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(41, 198, 220, 0.08);
    }

    .site-nav-link::after { display: none; }

    .site-nav-cta {
        margin: 0.6rem 0 0;
        text-align: center;
        border-radius: 5px;
    }

    .site-nav-toggle {
        display: flex;
    }
}

/* ---------------------------------------------------------------------------
   Site footer
   Site-wide chrome: brand, nav, copyright. Translucent glass over the circuit
   bg with a hairline cyan top rule, mirroring the header.
--------------------------------------------------------------------------- */
.site-footer {
    position: relative;
    margin-top: auto;
    padding: clamp(1.1rem, 2.5vw, 1.5rem) clamp(1.25rem, 4vw, 3rem);
    background: linear-gradient(0deg,
        rgba(3, 11, 18, 0.92) 0%,
        rgba(3, 11, 18, 0.7) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border-top: 1px solid rgba(41, 198, 220, 0.22);
}

/* hairline cyan glow line riding the top edge */
.site-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(41, 198, 220, 0.55) 20%,
        rgba(122, 240, 255, 0.7) 50%,
        rgba(41, 198, 220, 0.55) 80%,
        transparent);
    opacity: 0.6;
}

.site-footer-inner {
    max-width: 64rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
}

.site-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.site-footer-logo {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 5px rgba(41, 198, 220, 0.3));
}

.site-footer-name {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
}

.site-footer-nav a {
    font-size: 0.88rem;
    color: var(--text-dim);
    transition: color 0.16s ease;
}

.site-footer-nav a:hover {
    color: var(--accent-bright);
}

.site-footer-copy {
    width: 100%;
    margin-top: 0.3rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(41, 198, 220, 0.08);
    font-size: 0.8rem;
    color: var(--text-dim);
    opacity: 0.8;
}
