/* ============================================================
   9569 SILVER KNIGHTS — design system  ·  "machined armor / HUD"
   ------------------------------------------------------------
   Identity derived from the team's own assets:
     · wordmark letterforms have chamfered (CNC-cut) corners  -> .cut panels
     · helmet logo is brushed steel + an electric-cyan visor  -> palette
     · the team is the *Silver* Knights                       -> brushed-metal type
   Loaded on every page before the page-specific stylesheet.
   ============================================================ */

/* Brand body font (local) */
@font-face {
    font-family: 'Neue Regrade';
    src: url('../fonts/nav.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Benzin';
    src: url('../fonts/benzin.ttf') format('truetype');
    font-display: swap;
}

:root {
    /* ---- Core palette: gunmetal + steel + electric cyan ---- */
    --bg: #070b14;
    --bg-soft: #0b1120;
    --bg-deep: #04060c;

    --ink: #eef4fb;
    --muted: #abb7c6;        /* secondary text — AA on dark */
    --muted-dim: #6f7c8c;    /* decorative / labels only */

    --steel: #c3cdd9;
    --silver: #dbe1e9;
    --silver-hi: #ffffff;

    /* visor cyan (logo) is the "energized" accent; light blue is brand-soft */
    --cyan: #5cd0ec;
    --cyan-dim: #2c8aa8;
    --blue: #99cdf3;
    --blue-deep: #3166bc;
    --blue-deeper: #1b3c78;
    --navy: #122742;

    --accent: var(--cyan);
    --accent-glow: rgba(92, 208, 236, 0.45);
    --blue-glow: rgba(153, 205, 243, 0.38);

    /* ---- Surfaces, plating & lines ---- */
    --surface: rgba(140, 178, 214, 0.05);
    --surface-2: rgba(140, 178, 214, 0.09);
    --panel: rgba(13, 21, 37, 0.84);       /* plate fill (mostly opaque) */
    --panel-2: rgba(18, 28, 46, 0.9);
    --panel-strong: rgba(8, 13, 24, 0.94);
    --line: rgba(120, 172, 222, 0.16);     /* hairline */
    --line-strong: rgba(120, 196, 236, 0.36);
    --grid: rgba(118, 168, 220, 0.06);     /* blueprint grid */
    --grid-strong: rgba(118, 168, 220, 0.11);

    /* sponsor tiers */
    --diamond: #b9f2ff;
    --gold: #ffd479;
    --silver-tier: #d2d9e0;

    /* ---- Type ---- */
    --font-display: 'Chakra Petch', 'Neue Regrade', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --font-body: 'Neue Regrade', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --h1: clamp(2.5rem, 6.2vw, 4rem);
    --h2: clamp(1.95rem, 4.6vw, 2.9rem);
    --h3: clamp(1.2rem, 3vw, 1.6rem);

    /* ---- Layout & rhythm ---- */
    --maxw: 1200px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --section-gap: clamp(3.75rem, 9vw, 7.5rem);
    --nav-h: 74px;

    /* ---- Chamfer (the signature shape) ---- */
    --cut: 16px;
    --cut-sm: 9px;
    --bw: 1px;

    /* ---- Elevation ---- */
    --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.5);

    /* ---- Motion ---- */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 18px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--bg);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--nav-h);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Fixed atmosphere: blueprint grid drafted over gunmetal, with two
   low radial glows for depth. Sits behind everything; never tiles on scroll. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(58% 48% at 14% 6%, rgba(49, 102, 188, 0.22), transparent 60%),
        radial-gradient(60% 55% at 88% 100%, rgba(18, 39, 66, 0.5), transparent 62%),
        linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 86px,
        linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 86px 100%,
        linear-gradient(var(--grid-strong) 1px, transparent 1px) 0 0 / 100% 344px,
        linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px) 0 0 / 344px 100%,
        var(--bg);
}

/* Vignette + faint top scan-tint for HUD depth */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(125% 100% at 50% -10%, transparent 52%, rgba(4, 6, 12, 0.7) 100%);
}

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

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--cyan);
    color: #04121a;
}

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

/* ============================================================
   Signature shapes — chamfered "machined plate"
   ------------------------------------------------------------
   .cut       : top-left + bottom-right corners cut (directional)
   .panel     : a .cut plate with a 1px beveled edge + dark fill,
                drawn with a single ::before (works on JS-built cards,
                no markup changes needed).
   ============================================================ */

.cut {
    clip-path: polygon(var(--c, 16px) 0, 100% 0, 100% calc(100% - var(--c, 16px)),
            calc(100% - var(--c, 16px)) 100%, 0 100%, 0 var(--c, 16px));
}

.panel {
    --c: var(--cut);
    position: relative;
    isolation: isolate;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background: linear-gradient(135deg, var(--line-strong), var(--line));
}

.panel::before {
    content: '';
    position: absolute;
    inset: var(--bw);
    z-index: -1;
    clip-path: polygon(calc(var(--c) - var(--bw)) 0, 100% 0,
            100% calc(100% - var(--c) + var(--bw)),
            calc(100% - var(--c) + var(--bw)) 100%, 0 100%, 0 calc(var(--c) - var(--bw)));
    background: var(--panel);
}

/* ---------- Layout helpers ---------- */

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.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: fixed;
    top: -120px;
    left: 1rem;
    z-index: 10001;
    background: var(--cyan);
    color: #04121a;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.7rem 1.2rem;
    transition: top 0.25s var(--ease);
}

.skip-link:focus {
    top: 0;
}

/* ---------- Brushed-metal display text ---------- */

.metal-text {
    background: linear-gradient(176deg, var(--silver-hi) 4%, var(--steel) 38%,
            #8b97a6 52%, var(--silver) 70%, var(--blue) 110%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

/* ---------- Section headings ---------- */

.section-head {
    text-align: center;
    margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

/* mono "telemetry tag" — used for every eyebrow */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 1rem;
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan));
}

.eyebrow::after {
    content: '';
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--h2);
    line-height: 1.06;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.section-title .accent {
    color: var(--cyan);
    text-shadow: 0 0 28px var(--accent-glow);
}

/* technical rule with center notch + ticks */
.section-head .rule,
.rule {
    position: relative;
    width: 132px;
    height: 1px;
    margin: 1.4rem auto 0;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--line-strong) 18%,
            var(--line-strong) 82%, transparent);
}

.section-head .rule::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 7px;
    height: 7px;
    transform: translateX(-50%) rotate(45deg);
    background: var(--cyan);
    box-shadow: 0 0 12px var(--accent-glow);
}

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

.btn {
    --c: var(--cut-sm);
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    padding: 1rem 1.7rem;
    cursor: pointer;
    text-align: center;
    border: 0;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    transition: transform 0.25s var(--ease), filter 0.25s var(--ease),
        background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.btn svg {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    transition: transform 0.25s var(--ease);
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--blue-deep));
    color: #051320;
    filter: drop-shadow(0 8px 20px rgba(49, 102, 188, 0.4));
}

.btn-primary:hover {
    transform: translateY(-3px);
    filter: brightness(1.08) drop-shadow(0 0 16px var(--accent-glow));
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

/* Ghost = dark plate with a beveled edge that follows the chamfer
   (drawn as a 1px frame via ::before, not a clipped box-shadow). */
.btn-ghost {
    background: var(--line-strong);
    color: var(--ink);
}

.btn-ghost::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    clip-path: polygon(calc(var(--c) - 1px) 0, 100% 0,
            100% calc(100% - var(--c) + 1px), calc(100% - var(--c) + 1px) 100%, 0 100%, 0 calc(var(--c) - 1px));
    background: var(--bg-soft);
    transition: background-color 0.25s var(--ease);
}

.btn-ghost:hover {
    transform: translateY(-3px);
    color: var(--cyan);
    background: var(--cyan);
}

@media (max-width: 480px) {
    .btn {
        font-size: 0.8rem;
        letter-spacing: 0.04em;
        padding: 0.9rem 1.25rem;
    }
}

/* ---------- Reveal-on-scroll + boot-in stagger ---------- */

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    /* Explicit identity transform (not `none`) so Safari interpolates the slide
       instead of popping straight to the end state. */
    transform: translateY(0);
}

@keyframes bootIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bracketDraw {
    from {
        opacity: 0;
        transform: scale(1.35);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scanSweep {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    14% {
        opacity: 1;
    }

    60%,
    100% {
        transform: translateY(900%);
        opacity: 0;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.15;
    }
}

/* ---------- Back-to-top ---------- */

.to-top {
    --c: 8px;
    position: fixed;
    isolation: isolate;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    border: 0;
    background: var(--line-strong);
    color: var(--cyan);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
        background-color 0.3s var(--ease), color 0.3s var(--ease), filter 0.3s var(--ease);
    z-index: 900;
}

.to-top::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px),
            calc(100% - 7px) 100%, 0 100%, 0 7px);
    background: var(--panel-strong);
    transition: background-color 0.3s var(--ease);
}

.to-top svg {
    width: 20px;
    height: 20px;
}

.to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.to-top:hover {
    background: var(--cyan);
    color: #04121a;
    filter: drop-shadow(0 0 18px var(--accent-glow));
}

.to-top:hover::before {
    background: var(--cyan);
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    margin-top: var(--section-gap);
    position: relative;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, rgba(4, 6, 12, 0.6));
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: clamp(120px, 30%, 280px);
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    box-shadow: 0 0 14px var(--accent-glow);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-block: clamp(2.75rem, 6vw, 4.25rem) 2rem;
}

@media (min-width: 760px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 3rem;
    }
}

.footer-brand .footer-logos {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}

.footer-brand .footer-logos img.f-logo {
    height: 44px;
    width: auto;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.footer-brand .footer-logos img.f-word {
    height: 26px;
    width: auto;
}

.footer-brand p {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 36ch;
}

.footer-brand .footer-loc {
    margin-top: 0.9rem;
    color: var(--muted-dim);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
}

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 1.2rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--line);
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.footer-col a {
    position: relative;
    color: var(--muted);
    font-size: 0.95rem;
    padding-left: 0;
    transition: color 0.22s var(--ease), padding-left 0.22s var(--ease);
}

.footer-col a::before {
    content: '›';
    color: var(--cyan);
    opacity: 0;
    margin-right: 0.4rem;
    margin-left: -0.9rem;
    transition: opacity 0.22s var(--ease), margin-left 0.22s var(--ease);
}

.footer-col a:hover {
    color: var(--ink);
    padding-left: 0.2rem;
}

.footer-col a:hover::before {
    opacity: 1;
    margin-left: -0.4rem;
}

.footer-socials {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.4rem;
}

.footer-socials a {
    --c: 7px;
    position: relative;
    isolation: isolate;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background: var(--line);
    color: var(--muted);
    transition: color 0.25s var(--ease), background-color 0.25s var(--ease),
        transform 0.25s var(--ease), filter 0.25s var(--ease);
}

.footer-socials a::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px),
            calc(100% - 6px) 100%, 0 100%, 0 6px);
    background: var(--bg-soft);
    transition: background-color 0.25s var(--ease);
}

.footer-socials a svg {
    width: 19px;
    height: 19px;
}

.footer-socials a:hover {
    color: #04121a;
    background: var(--cyan);
    transform: translateY(-3px);
    filter: drop-shadow(0 0 14px var(--accent-glow));
}

.footer-socials a:hover::before {
    background: var(--cyan);
}

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-block: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--muted-dim);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.03em;
}

.footer-quote {
    color: var(--cyan);
    font-family: 'Benzin', var(--font-body);
    font-style: italic;
    opacity: 0.85;
    text-align: right;
}

/* ---------- Loading spinner ---------- */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(92, 208, 236, 0.18);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    box-shadow: 0 0 22px var(--accent-glow);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
