/* ============================================================
   TECHBOX TECHNO SOLUTIONS — style.css
   Variables, base, typography, layout, section primitives.
   Visual hierarchy: LIGHT THEME (White -> Navy -> Slate -> Blue)
   With Dark Theme support via [data-theme="dark"]
   ============================================================ */

/* ---------- Design Tokens (Light Theme Default) ---------- */
:root {
    /* Brand palette */
    --black:        #FFFFFF;       /* Primary canvas background */
    --black-2:      #F8FAFC;       /* Secondary section background */
    --black-3:      #F1F5F9;       /* Panels / mockups background */
    --blue:         #0866FF;       /* Techbox primary blue */
    --electric:     #0062E6;       /* High-contrast electric blue */
    --silver:       #475569;       /* Slate 600 - crisp body text */
    --silver-soft:  #64748B;       /* Slate 500 - muted labels & metadata */
    --light-silver: #E2E8F0;       /* Border / separator */
    --white:        #0A0F1D;       /* Slate 950 / Ink black for headings & brand */

    /* Surfaces */
    --surface-1:    #FFFFFF;       /* Card & panel surface */
    --surface-2:    rgba(15, 23, 42, 0.03);
    --surface-3:    rgba(15, 23, 42, 0.06);
    --line:         rgba(15, 23, 42, 0.09);
    --line-strong:  rgba(15, 23, 42, 0.18);
    --line-blue:    rgba(8, 102, 255, 0.35);

    /* Typography */
    --font-sans:    "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-mono:    "JetBrains Mono", "SF Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;

    /* Sizing */
    --container:    1280px;
    --container-narrow: 980px;
    --gutter:       clamp(20px, 5vw, 64px);
    --section-y:    clamp(72px, 9vw, 140px);
    --radius:       14px;
    --radius-sm:    8px;
    --radius-lg:    22px;

    /* Motion */
    --ease:         cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --dur:          0.5s;
    --dur-fast:     0.25s;

    /* Shadows / glow */
    --glow-blue:    0 0 0 1px rgba(8,102,255,0.20), 0 14px 40px -10px rgba(8,102,255,0.22);
    --shadow-1:     0 2px 4px rgba(15,23,42,0.04), 0 12px 32px -8px rgba(15,23,42,0.08);
    --shadow-2:     0 20px 48px -16px rgba(15,23,42,0.12);
}

/* ---------- Dark Theme Tokens (when activated) ---------- */
[data-theme="dark"] {
    --black:        #05070A;
    --black-2:      #0A0E15;
    --black-3:      #10151F;
    --blue:         #0866FF;
    --electric:     #2D8CFF;
    --silver:       #AEB7C4;
    --silver-soft:  #6E7888;
    --light-silver: #E8ECF1;
    --white:        #FFFFFF;

    --surface-1:    rgba(255,255,255,0.02);
    --surface-2:    rgba(255,255,255,0.04);
    --surface-3:    rgba(255,255,255,0.06);
    --line:         rgba(174,183,196,0.14);
    --line-strong:  rgba(174,183,196,0.28);
    --line-blue:    rgba(45,140,255,0.45);

    --glow-blue:    0 0 0 1px rgba(45,140,255,0.25), 0 18px 60px -20px rgba(8,102,255,0.55);
    --shadow-1:     0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 50px -28px rgba(0,0,0,0.7);
    --shadow-2:     0 30px 80px -40px rgba(0,0,0,0.8);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--black);
    color: var(--silver);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--blue); color: #FFFFFF; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
    margin: 0;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--white);
}
h1 { font-size: clamp(2.4rem, 6.2vw, 5rem); }
h2 { font-size: clamp(1.9rem, 4.4vw, 3.4rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.85rem); }
h4 { font-size: 1.1rem; letter-spacing: 0; }

p { margin: 0 0 1rem; color: var(--silver); }
p:last-child { margin-bottom: 0; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--electric);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--electric);
    display: inline-block;
}
.eyebrow.center::after {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--electric);
    display: inline-block;
}

.lead {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    color: var(--silver);
    line-height: 1.6;
    font-weight: 400;
}
.muted { color: var(--silver); }
.dim { color: var(--silver-soft); }

.kicker-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--electric);
    letter-spacing: 0.18em;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.container-narrow {
    width: 100%;
    max-width: var(--container-narrow);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section-sm { padding-block: clamp(56px, 6vw, 90px); }

.section-head {
    max-width: 760px;
    margin-bottom: clamp(40px, 5vw, 64px);
}
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head h2 { margin-top: 18px; }
.section-head p { margin-top: 18px; }

.grid { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Section backgrounds ---------- */
.bg-black { background: var(--black); }
.bg-black-2 { background: var(--black-2); }
.bg-gradient-blue {
    background:
        radial-gradient(1100px 600px at 18% 0%, rgba(8,102,255,0.07), transparent 60%),
        radial-gradient(900px 500px at 100% 100%, rgba(0,98,230,0.05), transparent 60%),
        var(--black);
}
[data-theme="dark"] .bg-gradient-blue {
    background:
        radial-gradient(1100px 600px at 18% 0%, rgba(8,102,255,0.18), transparent 60%),
        radial-gradient(900px 500px at 100% 100%, rgba(45,140,255,0.14), transparent 60%),
        var(--black);
}
.divider-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
}

/* Technical grid backdrop */
.tech-grid {
    position: relative;
}
.tech-grid::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15,23,42,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 80%);
    pointer-events: none;
}
[data-theme="dark"] .tech-grid::before {
    background-image:
        linear-gradient(rgba(174,183,196,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(174,183,196,0.05) 1px, transparent 1px);
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.wrap { flex-wrap: wrap; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }

/* ---------- Reveal animation ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    will-change: opacity, transform;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}
[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Skip link / a11y ---------- */
.skip-link {
    position: absolute;
    left: 16px;
    top: -80px;
    background: var(--blue);
    color: #FFFFFF;
    padding: 10px 16px;
    border-radius: 6px;
    z-index: 1000;
    transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

:focus-visible {
    outline: 2px solid var(--electric);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Page header (interior pages) ---------- */
.page-hero {
    position: relative;
    padding-top: clamp(140px, 18vw, 220px);
    padding-bottom: clamp(60px, 7vw, 100px);
    background:
        radial-gradient(900px 500px at 80% 0%, rgba(8,102,255,0.09), transparent 60%),
        radial-gradient(700px 400px at 0% 100%, rgba(0,98,230,0.05), transparent 60%),
        var(--black-2);
    overflow: hidden;
}
[data-theme="dark"] .page-hero {
    background:
        radial-gradient(900px 500px at 80% 0%, rgba(8,102,255,0.18), transparent 60%),
        radial-gradient(700px 400px at 0% 100%, rgba(45,140,255,0.10), transparent 60%),
        var(--black);
}
.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15,23,42,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
    pointer-events: none;
}
[data-theme="dark"] .page-hero::after {
    background-image:
        linear-gradient(rgba(174,183,196,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(174,183,196,0.06) 1px, transparent 1px);
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { margin-top: 18px; }
.page-hero .lead { margin-top: 22px; max-width: 660px; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--silver-soft);
    text-transform: uppercase;
}
.breadcrumb a:hover { color: var(--electric); }
.breadcrumb span.sep { color: var(--silver-soft); opacity: 0.5; }
.breadcrumb span.current { color: var(--electric); }
