/* ==========================================================
   TechniKAYLE — Software & Innovation
   Brand palette
     background grey  #e3e3e3
     dark green       #015134
     mid green        #397831
     light green      #5a922f
   ========================================================== */

:root {
    --tk-bg: #e3e3e3;
    --tk-green-dark: #015134;
    --tk-green-mid: #397831;
    --tk-green-light: #5a922f;

    --tk-surface: #f1f1f1;
    --tk-surface-strong: #ffffff;
    --tk-text: #1c2a22;
    --tk-text-muted: #47544c;
    --tk-border: #cfd3cf;

    --tk-radius: 14px;
    --tk-radius-sm: 8px;
    --tk-shadow: 0 1px 2px rgba(1, 81, 52, .06), 0 8px 24px rgba(1, 81, 52, .08);
    --tk-shadow-hover: 0 2px 4px rgba(1, 81, 52, .08), 0 16px 36px rgba(1, 81, 52, .14);

    --tk-font: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --tk-container: 1160px;
    --tk-header-h: 72px;
}

/* ---------- Font (self-hosted, SIL Open Font License) ---------- */

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/montserrat-latin-wght-normal.woff2') format('woff2-variations'),
         url('../fonts/montserrat-latin-wght-normal.woff2') format('woff2');
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--tk-header-h) + 16px);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    font-family: var(--tk-font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--tk-text);
    background: var(--tk-bg);
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
    font-family: var(--tk-font);
    color: var(--tk-green-dark);
    line-height: 1.15;
    margin: 0 0 .6em;
    font-weight: 800;
    letter-spacing: -.01em;
}

h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; font-weight: 700; }

p { margin: 0 0 1em; }

a { color: var(--tk-green-mid); text-underline-offset: 3px; }
a:hover { color: var(--tk-green-dark); }

h1:focus, main:focus { outline: none; }

:focus-visible {
    outline: 3px solid var(--tk-green-light);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: var(--tk-container);
    margin-inline: auto;
    padding-inline: 24px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 200;
    background: var(--tk-green-dark); color: #fff; padding: 10px 16px;
    border-radius: var(--tk-radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--tk-font); font-weight: 700; font-size: 1rem;
    padding: .85rem 1.6rem; border-radius: 999px; border: 2px solid transparent;
    text-decoration: none; cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--tk-green-dark); color: #fff; }
.btn-primary:hover { background: var(--tk-green-mid); color: #fff; box-shadow: var(--tk-shadow); }

.btn-outline { border-color: var(--tk-green-dark); color: var(--tk-green-dark); background: transparent; }
.btn-outline:hover { background: var(--tk-green-dark); color: #fff; }

.btn-light { background: #fff; color: var(--tk-green-dark); }
.btn-light:hover { background: var(--tk-bg); color: var(--tk-green-dark); }

.btn-sm { padding: .55rem 1.1rem; font-size: .9rem; }

/* ---------- Circuit trace motif (from the logo tagline) ---------- */

.eyebrow {
    display: inline-flex; align-items: center; gap: .85rem;
    font-size: .85rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--tk-text-muted); margin-bottom: 1rem;
}

.trace {
    position: relative; display: inline-block; width: 44px; height: 4px; flex: none;
    background: var(--tk-green-light); border-radius: 2px;
}
.trace::before, .trace::after {
    content: ""; position: absolute; top: 50%; width: 12px; height: 12px;
    border: 3px solid var(--tk-green-light); border-radius: 50%; background: var(--tk-bg);
    transform: translateY(-50%);
}
.trace::before { left: -6px; }
.trace::after { right: -6px; }

.section-head { text-align: center; max-width: 680px; margin: 0 auto 3rem; }
.section-head p { color: var(--tk-text-muted); font-size: 1.1rem; }

.section { padding: 96px 0; }
.section-alt { background: var(--tk-surface); }
.section-alt .trace::before, .section-alt .trace::after { background: var(--tk-surface); }

/* ---------- Blazor framework UI ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: #fff8d6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred." }

.loading-progress {
    position: absolute; display: block; width: 8rem; height: 8rem;
    inset: 20vh 0 auto 0; margin: 0 auto;
}
.loading-progress circle {
    fill: none; stroke: #cfd3cf; stroke-width: 0.6rem;
    transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--tk-green-mid);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute; text-align: center; font-weight: bold;
    color: var(--tk-green-dark); inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }
