/*
Theme Name: Zyviolabs
Theme URI: https://zyviolabs.com
Author: Zyviolabs
Author URI: https://zyviolabs.com
Description: One-page studio site for Zyviolabs — the independent software studio behind Unda. Dark, neon, glassmorphic. Pure hand-written CSS/JS, self-hosted Inter, no page builder, no tracker.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zyviolabs
*/

/* ============================================================================
   0. Self-hosted Inter (no Google Fonts CDN — privacy + works under a strict CSP)
   url() is resolved relative to this file (the theme root), so the paths below
   point at /assets/fonts/* inside the theme.
   ========================================================================== */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap; /* show fallback text immediately, swap when Inter is ready */
    src: url("assets/fonts/inter-latin-400.woff2") format("woff2");
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("assets/fonts/inter-latin-600.woff2") format("woff2");
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("assets/fonts/inter-latin-700.woff2") format("woff2");
}

/* ============================================================================
   1. Design tokens (mirror docs/marketing/zyviolabs-website-spec.md §6.1)
   ========================================================================== */
:root {
    --bg: #0A0E1A;          /* page background — deep navy */
    --bg-elev: #0D0D2B;     /* cards / elevated surfaces */
    --primary: #7F77DD;     /* violet accent */
    --secondary: #00D4FF;   /* cyan accent */
    --neon-cyan: #00F5FF;   /* gradient start (logo, headings) */
    --neon-violet: #A855F7; /* gradient end */
    --text: #E6E8F0;        /* body text */
    --text-muted: #9AA0B4;  /* secondary text */

    --grad: linear-gradient(135deg, var(--neon-cyan), var(--neon-violet));
    --maxw: 1100px;         /* content max width */
    --radius: 18px;
    --nav-h: 64px;          /* sticky nav height, also the scroll-margin offset */

    /* fluid type scale (clamp = min, preferred-vw, max) */
    --fs-h1: clamp(2.5rem, 6vw, 4rem);
    --fs-h2: clamp(1.75rem, 4vw, 2.5rem);
    --fs-body: clamp(1rem, 1.4vw, 1.125rem);
}

/* ============================================================================
   2. Reset / base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;        /* anchor nav glides instead of jumping */
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: var(--fs-body);
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    /* Subtle, performance-cheap ambiance: two fixed radial glows behind content.
       Fixed (not animated) by default; the slow drift is opt-in below. */
    background-image:
        radial-gradient(60vw 60vw at 12% -10%, rgba(0, 245, 255, 0.10), transparent 60%),
        radial-gradient(55vw 55vw at 100% 8%, rgba(168, 85, 247, 0.12), transparent 60%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }

/* Keyboard accessibility: a clearly visible focus ring everywhere. */
:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Skip link (a11y): hidden until focused, then floats over the nav. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--bg-elev);
    color: var(--text);
    border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ============================================================================
   3. Layout helpers
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2rem);
}

section { padding-block: clamp(3.5rem, 9vw, 6rem); }

/* Anchored sections must clear the sticky nav when scrolled to. */
[id] { scroll-margin-top: calc(var(--nav-h) + 12px); }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
    margin: 0 0 0.75rem;
}

/* Gradient text used for the wordmark and section accents. */
.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ============================================================================
   4. Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
    background: var(--grad);
    color: #06121f;                 /* dark text on bright gradient = AA contrast */
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.25);
}
.btn-primary:hover { box-shadow: 0 12px 38px rgba(168, 85, 247, 0.40); }

.btn-ghost {
    background: rgba(127, 119, 221, 0.08);
    border-color: rgba(127, 119, 221, 0.45);
    color: var(--text);
}
.btn-ghost:hover { border-color: var(--neon-cyan); }

/* ============================================================================
   5. Glassmorphic card (products, values)
   ========================================================================== */
.card {
    position: relative;
    background: linear-gradient(180deg, rgba(13, 13, 43, 0.85), rgba(10, 14, 26, 0.85));
    border: 1px solid rgba(127, 119, 221, 0.22);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2rem);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
/* 1px gradient top edge — the "neon rim" without an expensive full border-image. */
.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: var(--grad);
    opacity: 0.7;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 245, 255, 0.45);
    box-shadow: 0 16px 50px rgba(168, 85, 247, 0.22);
}

/* ============================================================================
   6. Sticky nav
   ========================================================================== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: rgba(10, 14, 26, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(127, 119, 221, 0.15);
}
.site-nav .container { display: flex; align-items: center; justify-content: space-between; }

.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 28px; height: 28px; }
.brand:hover { text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.nav-links a { color: var(--text-muted); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ============================================================================
   7. Hero
   ========================================================================== */
.hero { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
.hero .mark { width: clamp(64px, 12vw, 96px); margin: 0 auto 1.5rem; }
.hero h1 { font-size: var(--fs-h1); max-width: 16ch; margin-inline: auto; }
.hero .subline {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--text-muted);
    max-width: 56ch;
    margin: 1rem auto 2rem;
}
.hero .cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================================
   8. About
   ========================================================================== */
.about p { font-size: clamp(1.1rem, 2vw, 1.35rem); max-width: 60ch; color: var(--text); }
.about .muted { color: var(--text-muted); }

/* ============================================================================
   9. Products grid
   ========================================================================== */
.section-head { max-width: 60ch; margin-bottom: 2.5rem; }
.section-head h2 { font-size: var(--fs-h2); }
.section-head p { color: var(--text-muted); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.product-card { display: flex; flex-direction: column; gap: 1rem; }
.product-card .icon { width: 72px; height: 72px; }
.product-card h3 { font-size: 1.5rem; margin: 0; }
.product-card .tagline { color: var(--secondary); font-weight: 600; margin: 0; }
.product-card .desc { color: var(--text-muted); margin: 0; flex: 1; }
.product-card .links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

/* ============================================================================
   10. Values
   ========================================================================== */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
.value h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.value p { color: var(--text-muted); margin: 0; }
.value .dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--grad); margin-bottom: 0.9rem;
    box-shadow: 0 0 16px rgba(0, 245, 255, 0.5);
}

/* ============================================================================
   11. Contact
   ========================================================================== */
.contact { text-align: center; }
.contact h2 { font-size: var(--fs-h2); }
.contact p { color: var(--text-muted); max-width: 50ch; margin-inline: auto; }
.contact .email-btn { margin-top: 1.5rem; font-size: 1.15rem; }
.contact .support { margin-top: 1rem; font-size: 0.95rem; }

/* ============================================================================
   12. Footer
   ========================================================================== */
.site-footer {
    border-top: 1px solid rgba(127, 119, 221, 0.15);
    padding-block: 2.5rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); text-decoration: none; }

/* ============================================================================
   13. Legal / generic page (privacy.php, terms.php via page.php)
   ========================================================================== */
.page-body { padding-block: clamp(3rem, 8vw, 5rem); }
.page-body .container { max-width: 760px; }
.page-body h1 { font-size: var(--fs-h2); margin-bottom: 1.5rem; }
.page-body h2 { font-size: 1.35rem; margin-top: 2rem; }
.page-body a { color: var(--secondary); }
.page-body ul { padding-left: 1.25rem; }
.page-body .updated { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

/* ============================================================================
   14. Motion: one tasteful drift, disabled under prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
    body { animation: bgDrift 24s ease-in-out infinite alternate; }
    @keyframes bgDrift {
        from { background-position: 0% 0%, 100% 0%; }
        to   { background-position: 6% 4%, 94% 6%; }
    }
}

/* ============================================================================
   15. Small screens
   ========================================================================== */
@media (max-width: 600px) {
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.9rem; }
    .hero .cta-row { flex-direction: column; align-items: stretch; }
    .hero .cta-row .btn { justify-content: center; }
    .site-footer .container { flex-direction: column; align-items: flex-start; }
}
