/* ==========================================================================
   Nexix Academy — CTF-as-a-Service (ctf.html)
   Depends on base.css for tokens, background, navbar, footer, buttons,
   section primitives and the shared closing CTA.
   ========================================================================== */

/* --- Hero --- */
.ctf-hero {
    position: relative;
    text-align: center;
    padding: calc(var(--nav-h) + 5rem) 0 5rem;
    overflow: hidden;
}
.ctf-hero__orb {
    position: absolute;
    top: 30%; left: 50%;
    transform: translate(-50%, -50%);
    width: 480px; height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 86, 210, 0.09) 0%, rgba(26, 172, 172, 0.05) 50%, transparent 70%);
    filter: blur(70px);
    animation: orbPulse 7s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes orbPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.14); opacity: 1; }
}
.ctf-hero__inner { position: relative; z-index: 1; max-width: 48rem; margin: 0 auto; }
.ctf-hero .badge { margin-bottom: 1.75rem; }
.ctf-hero__title {
    font-family: var(--font-h);
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}
.ctf-hero__title em {
    font-style: italic;
    font-weight: 500;
    background: var(--gradient-img);
    background-size: cover;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.ctf-hero__desc {
    color: var(--grey);
    font-size: 1.15rem;
    line-height: 1.7;
    max-width: 38rem;
    margin: 0 auto 2.5rem;
}
.ctf-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.ctf-hero__chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    list-style: none;
}
.ctf-hero__chips li {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--grey);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.5rem 1rem;
}

/* --- Best Suited For --- */
.usecase-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.85rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.usecase-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}
.usecase-card__icon {
    width: 2.9rem; height: 2.9rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0.85rem;
    background: rgba(26, 172, 172, 0.10);
    border: 1px solid rgba(11, 110, 110, 0.22);
    color: var(--teal-ink);
    margin-bottom: 1.1rem;
}
.usecase-card__icon svg { width: 24px; height: 24px; }
.usecase-card h3 { font-family: var(--font-h); font-weight: 600; font-size: 1.15rem; margin-bottom: 0.55rem; }
.usecase-card p { color: var(--grey); font-size: 0.92rem; line-height: 1.6; }

/* ==========================================================================
   How it works (#how-it-works)
   Left: the engagement as three steps on a vertical timeline.
   Right: the eight deliverables as tiles, two columns.
   Replaces the old flat "What's Included" deliverables list — the process and
   the inventory were describing the same engagement twice.
   ========================================================================== */
.hiw {
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* --- Left: step timeline --- */
.flow {
    position: relative;
    list-style: none;
    display: grid;
    gap: 2.5rem;
}
/* The connector is a straight line, so a ::before beats an SVG path. It stops
   short of the last dot rather than running to the container edge. */
.flow::before {
    content: '';
    position: absolute;
    left: 0.34rem;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary) 0%, var(--teal) 100%);
    opacity: 0.25;
}

.flow__step {
    position: relative;
    padding-left: 2.25rem;
}
.flow__step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 0.75rem; height: 0.75rem;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border-strong);
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.flow__num {
    display: block;
    font-family: var(--font-h);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--grey-dim);
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}
.flow__step h3 {
    font-family: var(--font-h);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
}
.flow__step p { color: var(--grey); font-size: 0.95rem; line-height: 1.65; }

/* Active state is ADDITIVE ONLY. The default must be fully legible on its
   own, so that a JS failure or reduced-motion never leaves the section
   looking greyed out. Never invert this into "dim until activated". */
.flow__step.is-active::before {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}
.flow__step.is-active .flow__num { color: var(--primary); }

/* --- Challenge category chips (inside step 01) --- */
.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    margin-top: 1rem;
}
.cat-chips li {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--primary-deep);
    background: var(--primary-soft);
    border: 1px solid rgba(0, 86, 210, 0.18);
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.75rem;
}

/* --- Right: deliverable tiles --- */
.deliv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    list-style: none;
}
.deliv-tile {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.deliv-tile:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.deliv-tile__icon {
    width: 2.35rem; height: 2.35rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0.7rem;
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    color: var(--grey);
    margin-bottom: 0.85rem;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
.deliv-tile__icon svg { width: 18px; height: 18px; }
.deliv-tile h3 {
    font-family: var(--font-h);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.3rem;
}
.deliv-tile p { color: var(--grey); font-size: 0.82rem; line-height: 1.5; }

/* Additive again — see the note on .flow__step.is-active. */
.deliv-tile.is-active {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}
.deliv-tile.is-active .deliv-tile__icon {
    background: var(--primary-soft);
    border-color: rgba(0, 86, 210, 0.22);
    color: var(--primary);
}

/* Pin the steps while the taller tile grid scrolls past. Precedent:
   .calc__summary below uses the same technique. */
@media (min-width: 900px) {
    .hiw__steps {
        position: sticky;
        top: calc(var(--nav-h) + 2.5rem);
    }
}
@media (max-width: 899px) {
    .hiw { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 580px) {
    .deliv-grid { grid-template-columns: 1fr; }
    .flow { gap: 2rem; }
}

/* --- Preset packages --- */
.packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1rem;
}
.package {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.package:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}
.package--featured {
    border-color: var(--border-hover);
    background: linear-gradient(135deg, var(--primary-soft) 0%, rgba(26, 172, 172, 0.07) 100%);
}
.package__tag {
    position: absolute;
    top: -0.75rem; left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--on-brand);
    background: var(--gradient-img);
    background-size: 150% 150%;
    background-position: center;
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.package__name { font-family: var(--font-h); font-weight: 700; font-size: 1.25rem; margin-bottom: 0.3rem; }
.package__desc { color: var(--grey); font-size: 0.85rem; line-height: 1.5; margin-bottom: 1rem; }
.package__price {
    font-family: var(--font-h);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-img);
    background-size: cover;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.package__list { list-style: none; display: grid; gap: 0.5rem; margin-bottom: 1.5rem; }
.package__list li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--grey);
    font-size: 0.88rem;
    line-height: 1.45;
}
.package__list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--teal-ink);
    font-weight: 700;
    font-size: 0.8rem;
}
.package__btn { margin-top: auto; width: 100%; justify-content: center; cursor: pointer; }
.packages__hint {
    text-align: center;
    color: var(--grey-dim);
    font-size: 0.85rem;
    margin-bottom: 2.5rem;
}

/* --- Plan your event (calculator) --- */
.calc {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.calc__controls {
    display: grid;
    gap: 1.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}
.calc__label { font-family: var(--font-h); font-weight: 600; font-size: 1rem; margin-bottom: 0.9rem; }
.calc__options { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.calc__options--stack { flex-direction: column; }

.calc__pill input, .calc__check input { position: absolute; opacity: 0; pointer-events: none; }
.calc__pill span {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--card-bg-alt);
    color: var(--grey);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.calc__pill span:hover { border-color: var(--border-hover); }
/* Checked state is a solid brand fill, not a tint. This is the only signal
   telling the user what the estimate is being calculated from, so it has to
   be unmistakable against the unchecked pill on a light surface. */
.calc__pill input:checked + span {
    border-color: var(--primary-deep);
    background: var(--primary);
    color: var(--on-brand);
    font-weight: 600;
}
.calc__pill input:focus-visible + span { outline: 2px solid var(--teal-ink); outline-offset: 2px; }

.calc__check { display: block; }
.calc__check span {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg-alt);
    color: var(--grey);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.calc__check span::before {
    content: '';
    width: 1.15rem; height: 1.15rem;
    border-radius: 0.35rem;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    color: transparent;
    transition: background 0.2s, border-color 0.2s;
}
.calc__check input:checked + span {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--ink);
    font-weight: 600;
}
.calc__check input:checked + span::before {
    content: '\2713';
    background: var(--primary);
    border-color: var(--primary-deep);
    color: var(--on-brand);
}
.calc__check input:focus-visible + span { outline: 2px solid var(--teal-ink); outline-offset: 2px; }

.calc__summary {
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
    background: linear-gradient(135deg, var(--primary-soft) 0%, rgba(26, 172, 172, 0.08) 100%);
    border: 1px solid rgba(0, 86, 210, 0.16);
    border-radius: var(--radius-lg);
    padding: 2rem;
}
.calc__badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--teal-ink);
    background: rgba(26, 172, 172, 0.10);
    border: 1px solid rgba(11, 110, 110, 0.25);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    margin-bottom: 0.9rem;
}
.calc__summary-label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--grey); font-weight: 600; }
.calc__perhead { font-size: 0.9rem; font-weight: 600; color: var(--teal-ink); margin: -0.25rem 0 0.75rem; }
.calc__payment { font-size: 0.78rem; color: var(--grey); text-align: center; margin-top: 0.9rem; line-height: 1.5; }
.calc__amount {
    font-family: var(--font-h);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.2;
    margin: 0.5rem 0;
}
.calc__note { font-size: 0.8rem; color: var(--grey); line-height: 1.5; margin-bottom: 1.25rem; }
.calc__breakdown { list-style: none; display: grid; gap: 0.5rem; margin-bottom: 1.5rem; }
.calc__breakdown li { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--grey); border-bottom: 1px dashed var(--border); padding-bottom: 0.5rem; }
.calc__breakdown li span:last-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.calc__cta { width: 100%; justify-content: center; }


/* --- Responsive --- */
@media (max-width: 980px) {
    .usecases.grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .calc { grid-template-columns: 1fr; }
    .calc__summary { position: static; }
    .packages { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 760px) {
    .usecases.grid--3 { grid-template-columns: 1fr; }
    .ctf-hero__actions { flex-direction: column; align-items: stretch; }
    .ctf-hero__actions .btn-primary, .ctf-hero__actions .btn-ghost { width: 100%; }
    .calc__controls { padding: 1.5rem; }
}
