/* ==========================================================================
   kyenet — design tokens & base styles
   Palette derived from kyenet_logo.png (navy #011E52 / sky blue #02A3FB).
   System font stack used deliberately — zero font-loading cost, no
   third-party requests, best Core Web Vitals + privacy profile.
   ========================================================================== */

:root {
    /* Color */
    --color-primary: #011E52;
    --color-primary-dark: #050F2A;
    --color-accent: #02A3FB;
    --color-accent-text: #0568B3; /* AA-safe on white (~5.8:1) */
    --color-background: #FFFFFF;
    --color-surface: #F6F8FB;
    --color-surface-alt: #EEF3FA;
    --color-text: #0F172A;
    --color-muted: #57647A;
    --color-border: #DEE5EF;
    --color-success: #157A45;
    --color-warning: #B45309;
    --color-error: #C0271F;
    --color-on-primary: #FFFFFF;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 18px;

    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.06);

    /* Type */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --content-width: 1180px;
}

/* ---- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; } /* off-canvas mobile nav uses transform+position:fixed, which some
    browsers factor into scrollWidth even though the panel is visually clipped to the viewport */
body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-background);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
img, picture, svg { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--color-accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.25em; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Visually-hidden (not display:none, which would break screen-reader/tab access) without
   the large negative-offset technique, which inflates the document's scrollWidth and
   causes horizontal overflow on mobile. */
.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    top: 0;
    background: var(--color-primary);
    color: #fff;
    z-index: 1000;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    padding: 0.75rem 1.25rem;
    left: 0;
}

/* ---- Typography ------------------------------------------------------ */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; color: var(--color-primary); }
h1 { font-size: clamp(2.1rem, 1.6rem + 2.2vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 1.35rem + 1.2vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p { color: var(--color-text); }
.text-muted { color: var(--color-muted); }
.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent-text);
    margin-bottom: var(--space-sm);
}

/* ---- Layout ------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: var(--space-lg);
}
.section { padding-block: var(--space-2xl); }
.section--alt { background: var(--color-surface); }
.section-header { max-width: 640px; margin-bottom: var(--space-xl); }
.section-header--center { margin-inline: auto; text-align: center; }
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding-block: var(--space-xl); }
}

/* ---- Buttons ------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    text-decoration: none;
    min-height: 44px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-sm); }
.btn-accent { background: var(--color-accent); color: var(--color-primary); }
.btn-accent:hover { background: #35B4FC; }
.btn-outline { background: transparent; border-color: var(--color-border); color: var(--color-primary); }
.btn-outline:hover { border-color: var(--color-primary); background: var(--color-surface); }
.btn-ghost { background: transparent; color: var(--color-on-primary); border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-block { width: 100%; }

/* ---- Cards ------------------------------------------------------ */
.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card--interactive:hover, .card--interactive:focus-within {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ---- Header / Nav ------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--color-border);
}
/* backdrop-filter is desktop-only: per spec it makes the element a new
   containing block for `position: fixed` descendants (same as `transform`),
   which trapped the mobile nav drawer's fixed positioning inside this
   header's own (short) box instead of the viewport — the drawer rendered
   ~104px tall instead of full-height, effectively invisible. The mobile nav
   is `position: fixed` below 960px (see .primary-nav), so this must not
   apply there; confirmed live that removing it below 960px is what fixes
   the drawer's height. */
@media (min-width: 961px) {
    .site-header { backdrop-filter: saturate(180%) blur(8px); }
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.75rem;
    gap: var(--space-lg);
}
.site-logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--color-primary); }
.site-logo img { height: 38px; width: 38px; border-radius: var(--radius-sm); }
.site-logo span { font-size: 1.15rem; }
.primary-nav { display: flex; align-items: center; gap: var(--space-lg); }
.primary-nav ul { list-style: none; padding: 0; display: flex; gap: var(--space-lg); align-items: center; }
.primary-nav ul a { color: var(--color-text); font-weight: 500; }
.primary-nav ul a:hover { color: var(--color-accent-text); text-decoration: none; }
.nav-cta { display: flex; gap: var(--space-sm); align-items: center; }
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 960px) {
    .primary-nav { position: fixed; inset: 0 0 0 auto; width: min(320px, 85vw); background: #fff; flex-direction: column; align-items: stretch; padding: 5rem var(--space-lg) var(--space-lg); box-shadow: var(--shadow-md); transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
    .primary-nav.is-open { transform: translateX(0); }
    .primary-nav ul { flex-direction: column; align-items: stretch; gap: var(--space-md); }
    .nav-cta { flex-direction: column; align-items: stretch; margin-top: var(--space-lg); }
    .nav-toggle { display: block; }
}

/* ---- Hero ------------------------------------------------------ */
.hero {
    padding-block: var(--space-2xl);
    background: linear-gradient(180deg, var(--color-surface) 0%, #fff 100%);
}
.hero__inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-2xl); align-items: center; }
.hero__actions { display: flex; gap: var(--space-md); margin-top: var(--space-lg); flex-wrap: wrap; }
.hero__lede { font-size: 1.15rem; color: var(--color-muted); margin-top: var(--space-md); max-width: 52ch; }
@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; }
}

/* ---- Footer ------------------------------------------------------ */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding-block: var(--space-2xl) var(--space-lg); }
.site-footer a { color: var(--color-text); }
.site-footer h4 { font-size: 0.95rem; margin-bottom: var(--space-md); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-xl); }
.footer-grid ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-bottom { margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--color-border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); font-size: 0.85rem; color: var(--color-muted); }
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ---- Forms ------------------------------------------------------ */
.form-field { margin-bottom: var(--space-lg); }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.92rem; }
.form-field .required { color: var(--color-error); }
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.98rem;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 163, 251, 0.18);
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-field .field-error { color: var(--color-error); font-size: 0.85rem; margin-top: 0.35rem; }
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea { border-color: var(--color-error); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}
.form-hint { font-size: 0.85rem; color: var(--color-muted); margin-top: 0.35rem; }
.honeypot-field { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.alert { padding: var(--space-md) var(--space-lg); border-radius: var(--radius-sm); margin-bottom: var(--space-lg); }
.alert-success { background: #E9F7EF; color: var(--color-success); border: 1px solid #BFE6CE; }
.alert-error { background: #FBEAEA; color: var(--color-error); border: 1px solid #F1C6C3; }

/* ---- Misc components ------------------------------------------------------ */
.badge { display: inline-block; padding: 0.25rem 0.65rem; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-primary); font-size: 0.78rem; font-weight: 600; }
.tag-list { list-style: none; padding: 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.breadcrumbs { list-style: none; display: flex; gap: 0.5rem; padding: 0; font-size: 0.85rem; color: var(--color-muted); margin-bottom: var(--space-lg); flex-wrap: wrap; }
.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.5rem; }

.cta-band { background: var(--color-primary); color: #fff; border-radius: var(--radius-lg); padding: var(--space-2xl); text-align: center; }
.cta-band h2, .cta-band p { color: #fff; }
.cta-band .btn-outline { color: #fff; border-color: rgba(255,255,255,0.4); }
.cta-band .btn-outline:hover { background: rgba(255,255,255,0.1); }

.testimonial-card { border-left: 3px solid var(--color-accent); padding-left: var(--space-lg); }
.testimonial-card blockquote { font-size: 1.1rem; color: var(--color-primary); }
.testimonial-card cite { display: block; margin-top: var(--space-md); font-style: normal; color: var(--color-muted); font-size: 0.9rem; }

.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { text-align: left; padding: 0.85rem; border-bottom: 1px solid var(--color-border); }
.table-scroll { overflow-x: auto; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; }
}

.pagination { display: flex; gap: 0.5rem; list-style: none; padding: 0; margin-top: var(--space-xl); }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); }
.pagination .is-current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
