/* =========================
   FONTS (self-hosted, SIL Open Font Licence – see static/fonts/)
   Chakra Petch: headings, nav, buttons – squared "engineering" shapes
   Inter: body copy
========================= */

@font-face {
    font-family: 'Inter';
    src: url("../fonts/inter-latin-var.260c81a4759b.woff2") format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Chakra Petch';
    src: url("../fonts/chakra-petch-latin-500-normal.5423161597dc.woff2") format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Chakra Petch';
    src: url("../fonts/chakra-petch-latin-600-normal.27489a499469.woff2") format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Chakra Petch';
    src: url("../fonts/chakra-petch-latin-700-normal.56706b63a0f0.woff2") format('woff2');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

/* =========================
   DESIGN TOKENS
========================= */

:root {
    --kx-night: #0a1f1a;
    --kx-plum: #1e1029;
    --kx-signal: #4ade80;
    --kx-volt: #c084fc;
    --kx-mist: #d1e0d6;
    --kx-font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --kx-font-display: 'Chakra Petch', 'Inter', 'Segoe UI', system-ui, sans-serif;
    --kx-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* =========================
   RESET / GLOBAL DEFAULTS
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* The window (not <body>) must be the page's scroller, otherwise scroll
   position, sticky-header and scroll-triggered effects can't see scrolling.
   overflow-x: clip hides sideways overflow WITHOUT creating a second
   scroll container (overflow-x: hidden on html+body did). */
html {
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    overflow-x: clip;            /* prevent horizontal scroll caused by any element */
}

body {
    font-family: var(--kx-font-body);
    /* faint circuit-board dot grid across the whole site */
    background-color: var(--kx-night);
    background-image: radial-gradient(rgba(74, 222, 128, 0.07) 1px, transparent 1.4px);
    background-size: 28px 28px;
    color: #e2e8f0;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.btn,
.nav a {
    font-family: var(--kx-font-display);
}

h1, h2, h3, h4 {
    letter-spacing: -0.01em;
}

/* Visible keyboard focus everywhere */
:focus-visible {
    outline: 2px solid var(--kx-signal);
    outline-offset: 3px;
    border-radius: 6px;
}

/* =========================
   MAIN CONTENT AREA
========================= */

main {
    padding: 5vh 4vw;            /* fluid padding, prevents overflow */
    min-height: 70vh;
    width: 100%;
}

/* =========================
   RESPONSIVE TYPOGRAPHY
   (uses clamp for fluid scaling)
========================= */

h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    margin-bottom: 0.5em;
    color: #f8fafc;
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 0.5em;
    color: #f1f5f9;
}

h3 {
    font-size: clamp(1.25rem, 4vw, 1.8rem);
    margin-bottom: 0.5em;
    color: #f1f5f9;
}

p {
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: #cbd5e1;
    margin-bottom: 1em;
    line-height: 1.5;
}

a {
    background: linear-gradient(135deg, #4ade80, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* =========================
   CONTAINER CLASS – responsive + safe
========================= */

.container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 clamp(16px, 5vw, 40px);   /* fluid horizontal padding */
    box-sizing: border-box;
}

/* =========================
   UTILITY CLASSES (optional)
========================= */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* =========================
   PREVENT HORIZONTAL OVERFLOW
   (catches any image or element that might be too wide)
========================= */

img, picture, video, canvas, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================
   RESPONSIVE ADJUSTMENTS FOR SMALL SCREENS
========================= */

@media (max-width: 768px) {
    main {
        padding: 4vh 3vw;
    }
    .container {
        padding: 0 4vw;
    }
}

@media (max-width: 480px) {
    main {
        padding: 3vh 4vw;
    }
    p {
        line-height: 1.4;
    }
}
/* Skip link: hidden off-screen by default, slides into view when it
   receives keyboard focus (Tab from the top of the page). */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #c084fc;
    color: #0a1f1a;
    padding: 12px 20px;
    z-index: 1000;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}
