/* KNIGHT SQUAD — binary bg, shield-following inner mask (no logo crop), orange link, distinct service buttons */
:root {
    --bg: #0b0e14;
    --panel: rgba(255, 255, 255, .04);
    --panel-strong: rgba(255, 255, 255, .06);
    --text: #eef2f6;
    --muted: #9aa3ad;

    --ember-1: #ff8a5c;
    --ember-2: #e85f33;
    --ember-glow: rgba(255, 106, 61, .38);

    --edge: rgba(255, 255, 255, .08);
    --shadow: 0 14px 44px rgba(0, 0, 0, .55);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(1100px 560px at 18% -8%, rgba(255, 100, 50, .08), transparent 60%),
        radial-gradient(1100px 560px at 82% 108%, rgba(180, 50, 20, .10), transparent 60%),
        linear-gradient(180deg, #0a0d13 0%, #0b0e14 100%);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Better defaults */
img {
    max-width: 100%;
    height: auto;
}

:focus-visible {
    outline: 2px solid #ff8a5c;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: #0b0e14;
    color: #fff;
    padding: 8px 10px;
    border: 1px solid var(--edge);
    border-radius: 10px;
    z-index: 9999;
}

.skip-link:focus {
    left: 8px;
}

/* Background canvas overlay (binary) */
#matrix {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .22;
    pointer-events: none;
}

/* Layout */
.container {
    width: min(1100px, 92vw);
    margin-inline: auto;
}

.section {
    padding: clamp(68px, 7.5vw, 110px) 0;
    position: relative;
}

.section-head h2 {
    margin-bottom: .25rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.hack-brace {
    color: #ffb39d;
    opacity: .95;
}

.hack-title .hack-brace {
    animation: bracePulse 3.8s steps(10, end) infinite;
    text-shadow: 0 0 10px rgba(255, 150, 120, .28);
}

@keyframes bracePulse {

    0%,
    100% {
        opacity: .95;
        transform: translateY(0)
    }

    20% {
        opacity: .6
    }

    40% {
        transform: translateY(-1px)
    }

    60% {
        opacity: .95
    }

    80% {
        transform: translateY(1px)
    }
}

/* Header & Nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    overflow: visible;
    backdrop-filter: blur(8px);
    background: linear-gradient(180deg, rgba(11, 14, 20, .85), rgba(11, 14, 20, .4) 60%, transparent);
    border-bottom: 1px solid var(--edge);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 12px 4vw;
    transition: padding .25s ease;
}

.site-header.shrink {
    padding: 8px 4vw;
}

.nav {
    grid-column: 2 / 3;
    overflow: visible;
}

.nav>ul {
    list-style: none;
    display: flex;
    gap: 26px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.nav li {
    list-style: none;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    position: relative;
    padding: 6px 12px;
    border-radius: 10px;
    overflow: hidden;
    transition: color .25s ease, text-shadow .25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav .label {
    position: relative;
    z-index: 1;
}

.nav .braces {
    opacity: 0;
    transform: translateY(2px) scale(.85);
    transition: transform .2s ease, opacity .2s ease;
    color: #ffb39d;
}

.nav a:hover {
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 138, 92, .35);
}

.nav a:hover .braces {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nav a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(120deg, rgba(255, 138, 92, .16), rgba(232, 95, 51, 0) 60%);
    transform: translateX(-110%);
    opacity: 0;
    transition: opacity .2s ease;
}

.nav a:hover::after {
    opacity: 1;
    animation: sweep .7s linear;
}

@keyframes sweep {
    to {
        transform: translateX(110%);
    }
}

/* Dropdown (click to toggle) */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    z-index: 200;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #0b0f16;
    border: 1px solid var(--edge);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
    display: none;
    width: max-content;
    min-width: 220px;
    max-width: 420px;
}

.dropdown.open>.has-sub {
    color: #fff;
}

.dropdown.open>.dropdown-menu {
    display: block;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--muted);
    white-space: nowrap;
}

.dropdown-menu a:hover {
    color: #fff;
    background: rgba(255, 138, 92, .12);
}

/* Mobile nav */
@media (max-width: 860px) {
    .nav {
        position: fixed;
        inset: 60px 0 auto 0;
        background: rgba(11, 14, 20, .97);
        border-bottom: 1px solid var(--edge);
        transform: translateY(-120%);
        transition: transform .35s;
    }

    .nav.open {
        transform: translateY(0);
    }

    .nav>ul {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
        gap: 10px;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        margin-top: 6px;
    }
}

@media (min-width: 861px) {
    .nav-toggle {
        display: none;
    }
}

.nav-toggle {
    grid-column: 1 / 2;
    width: 42px;
    height: 36px;
    border: 1px solid var(--edge);
    background: var(--panel);
    border-radius: 10px;
    cursor: pointer;
}

.nav-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    background: var(--text);
}

/* Buttons */
.btn {
    --top: var(--ember-1);
    --bottom: var(--ember-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    background: linear-gradient(180deg, var(--top) 0%, var(--bottom) 100%);
    color: #fff;
    border: 0;
    padding: .9rem 1.2rem;
    border-radius: 999px;
    font-weight: 900;
    letter-spacing: .04em;
    box-shadow: var(--shadow);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-brace {
    opacity: .7;
    transition: transform .2s ease, opacity .2s ease;
}

.btn:hover .btn-brace {
    opacity: 1;
    transform: translateY(-1px);
}

.btn::after {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .28) 18%, transparent 36%);
    transform: translateX(-120%);
    pointer-events: none;
}

.btn:hover::after {
    animation: shine .8s linear;
}

@keyframes shine {
    to {
        transform: translateX(120%);
    }
}

.btn-ghost {
    background: linear-gradient(180deg, rgba(255, 138, 92, .14), rgba(232, 95, 51, .08));
    color: var(--text);
    border: 1px solid var(--ember-glow);
}

.btn-wire {
    background: transparent;
    border: 1px dashed rgba(255, 138, 92, .55);
    color: #ffd3c6;
}

/* Distinct service button with { } vibe */
.btn-service {
    background: transparent;
    border: 1px solid rgba(255, 138, 92, .45);
    color: #ffd9ce;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
    position: relative;
    padding: .85rem 1.1rem;
}

.btn-service .btn-brace {
    color: #ffb39d;
    opacity: 1;
}

.btn-service::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(255, 138, 92, .0), rgba(255, 138, 92, .25), rgba(255, 138, 92, .0));
    transform: translateX(-120%);
}

.btn-service:hover::before {
    animation: shine .9s linear;
}

/* Links */
.text-link {
    color: var(--ember-1);
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 138, 92, .35);
    padding-bottom: 2px;
}

.text-link:hover {
    color: #ffb39d;
    border-bottom-color: rgba(255, 179, 157, .8);
}

/* HERO */
.hero {
    text-align: center;
    padding-top: 90px;
    padding-bottom: 72px;
    position: relative;
}

.title {
    font-family: "Cinzel", serif;
    font-weight: 900;
    font-size: clamp(32px, 5.4vw, 64px);
    letter-spacing: .06em;
    margin: 10px 0 0;
    color: #ffd3c6;
}

.hero .subtitle {
    color: var(--muted);
    margin-top: .45rem;
    min-height: 1.6em;
}

.cta {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

/* Crest with exact-following inner mask; bottom-safe (no logo crop) */
.hero-crest {
    --tiltX: 0deg;
    --tiltY: 0deg;
    --glowX: 50%;
    --glowY: 35%;
    width: 260px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    transform: rotateX(var(--tiltX)) rotateY(var(--tiltY));
    transition: transform .18s ease-out;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55));
    transform-style: preserve-3d;
    position: relative;
}

.shield {
    position: absolute;
    inset: -18px;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(220px 220px at var(--glowX) var(--glowY), rgba(255, 255, 255, .10), transparent 60%),
        linear-gradient(180deg, rgba(255, 106, 61, .25), rgba(255, 106, 61, 0) 60%),
        linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 60%);
    border: 1px solid var(--ember-glow);
    clip-path: polygon(50% 0%, 100% 25%, 85% 100%, 15% 100%, 0% 25%);
}

.crest-mask {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    clip-path: polygon(50% 0%, 100% 25%, 85% 100%, 15% 100%, 0% 25%);
}

.crest-inner {
    position: absolute;
    inset: 8% 8% 18% 8%;
    clip-path: polygon(50% 0%, 100% 25%, 85% 100%, 15% 100%, 0% 25%);
}

.logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-shine {
    position: absolute;
    inset: -2px;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .28) 18%, transparent 36%);
    transform: translateX(-120%);
    animation: logoShine 7.2s linear infinite;
}

@keyframes logoShine {
    0% {
        transform: translateX(-120%);
    }

    10% {
        transform: translateX(120%);
    }

    100% {
        transform: translateX(120%);
    }
}

.sweep {
    position: absolute;
    inset: -28px;
    background: conic-gradient(from 0deg, rgba(255, 106, 61, 0), rgba(255, 106, 61, .3), rgba(255, 106, 61, 0) 40%);
    filter: blur(24px);
    opacity: .32;
    pointer-events: none;
    animation: spin 9s linear infinite;
    z-index: 0;
}

@keyframes spin {
    to {
        transform: rotate(1turn);
    }
}

.scanline {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .04) 1px, transparent 3px, transparent 5px);
    opacity: .06;
    mix-blend-mode: overlay;
}

/* About grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: clamp(20px, 4vw, 48px);
}

.about-panel {
    background: var(--panel-strong);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: 18px;
}

@media (max-width: 920px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.cards>.card {
    grid-column: span 6;
}

@media (max-width: 920px) {
    .cards>.card {
        grid-column: span 12;
    }
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: .75rem;
    background: rgba(255, 138, 92, .16);
    color: #ff8a5c;
    border: 1px solid var(--ember-glow);
    padding: 4px 8px;
    border-radius: 999px;
}

.card .meta {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    color: var(--muted);
}

.card .meta li {
    margin-bottom: 6px;
}

.meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 6px;
}

/* CTF cards */
.ctf .ctf-head {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 10px;
}

.event-logo-square {
    width: 120px;
    height: 120px;
    object-fit: contain;
    display: block;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--edge);
    border-radius: 12px;
    padding: 8px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35));
}

.ctf h3 {
    margin: 0;
}

/* Services layout */
.cards.services .card {
    grid-column: span 6;
}

.cards.services .service-wide {
    grid-column: span 12;
}

/* HackZone slider */
.hz-wrap {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 20px;
    align-items: stretch;
}

.hz-slider {
    position: relative;
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
    min-height: 320px;
    max-height: 560px;
}

.slides {
    position: absolute;
    inset: 0;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .5s;
    margin: 0;
}

.slide.active {
    opacity: 1;
}

.slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hz-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    background: rgba(0, 0, 0, .45);
    border: 1px solid var(--edge);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    line-height: 38px;
    text-align: center;
    user-select: none;
}

.hz-prev {
    left: 10px;
}

.hz-next {
    right: 10px;
}

.hz-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 5;
}

.hz-dots button {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 1px solid var(--edge);
    background: rgba(255, 255, 255, .25);
    cursor: pointer;
}

.hz-dots button.active {
    background: #ff8a5c;
    border-color: #ff8a5c;
}

.hz-side {
    background: var(--panel-strong);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Sessions */
.session-card.one {
    background: var(--panel-strong);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: none;
    margin: 0;
}

.session-card.one ul {
    margin: 8px 0 16px;
    padding-left: 1.1rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--edge);
    padding: 26px 0;
    background: #0a0d14;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-links,
.social {
    list-style: none;
    display: flex;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    position: relative;
    padding: 3px 6px;
}

.footer-links a .fl {
    opacity: .0;
    transition: opacity .25s, transform .25s;
    color: #ffb39d;
}

.footer-links a:hover .fl {
    opacity: 1;
    transform: translateY(-1px);
}

.social .icon {
    color: #9aa3ad;
    display: inline-flex;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--edge);
    background: rgba(255, 255, 255, .02);
}

.social .icon:hover {
    color: #fff;
    border-color: #ff8a5c;
    box-shadow: 0 0 0 1px rgba(255, 106, 61, .25) inset;
}

/* Reveal */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Small screens */
@media (max-width: 980px) {
    .hz-wrap {
        grid-template-columns: 1fr;
    }
}