/* =========================================================== */
/* KWIKO HOME PAGE STYLES */
/* Extracted from index_v8 final animated updates.html */
/* =========================================================== */


/* ─── HERO SECTION ─── */
/* ─── CSS VARIABLES ─── */
:root {
    --hero-min-height: 100svh;
    /* Small viewport height - better mobile support */
    --hero-padding-top: 120px;
    /* Reduced to move headline UP */
    --hero-padding-bottom: 80px;
}

/* ─── HERO BASE ─── */
.k-hero {
    position: relative;
    min-height: var(--hero-min-height);
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--hero-padding-top) 0 var(--hero-padding-bottom);
    overflow: hidden;

    /* Fallback for browsers without svh */
    min-height: 100vh;
    min-height: var(--hero-min-height);
}

/* ─── CANVAS WRAPPER ─── */
.hero-canvas-wrapper {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#canvas-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    contain: strict;
}

#canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Canvas fallback - shows until Three.js loads */
.hero-canvas-fallback {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    transition: opacity 1s ease;
}

.hero-canvas-fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide fallback when canvas is ready */
.k-hero.canvas-ready .hero-canvas-fallback {
    opacity: 0;
    pointer-events: none;
}

/* ─── GRAIN OVERLAY ─── */
.hero-grain {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ─── VIGNETTE ─── */
.hero-vignette {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 60% at 50% 40%,
            transparent 0%,
            rgba(5, 5, 5, 0.4) 70%,
            rgba(5, 5, 5, 0.8) 100%);
}

/* ─── GRID LINES ─── */
.hero-grid {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* ─── CONTAINER ─── */
.hero-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    /* Fill vertical space */
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ─── CONTENT LAYOUT ─── */
.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: stretch;
    /* Grow to fill container */
    flex: 1;
}

/* ─── HEADLINE ─── */
.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 4.4vw, 4.4rem) !important;
    line-height: 1.05;
    margin: 0;
    font-weight: 400;
    /* LCP FIX: Default to visible so Lighthouse sees text immediately */
    opacity: 1;
    transform: translateY(0);
    white-space: nowrap;
}

/* Animation removed for LCP stability - headline always visible */
/* body.is-loading .hero-headline { opacity: 0; ... } removed */

.hero-headline br {
    display: block;
}

.hero-headline em {
    font-style: italic;
    color: var(--k-orange);
}

/* Animation states (applied via JS) */


/* ─── SUPPORT CONTENT ─── */
.hero-support {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 32px;
    padding-bottom: 40px;
    /* Reduced to allow text to sit lower */
    align-self: stretch;
    text-align: right;
    /* Optical alignment with headline baseline */
}

.hero-support {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s,
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

.hero-support.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── LEAD TEXT ─── */
.hero-lead-wrapper {
    position: relative;
    padding-right: 24px;
    padding-left: 0;
    margin-top: 180px;
}

.hero-lead-wrapper::before {
    content: '';
    position: absolute;
    left: auto;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(to bottom, var(--k-orange), transparent);
    border-radius: 1px;
}

.hero-lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--k-grey-light);
    margin: 0;
    max-width: 520px;
}

.hero-lead strong {
    color: #fff;
    font-weight: 500;
}

/* ─── BUTTONS ─── */
.hero-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Primary Button */
.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--k-orange);
    color: #000;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.25s ease;
}

/* Shine effect */
.hero-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s ease;
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(243, 112, 33, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.hero-btn-primary:hover::before {
    left: 100%;
}

.hero-btn-primary:active {
    transform: translateY(0);
}

.hero-btn-primary .btn-icon {
    display: flex;
    transition: transform 0.25s ease;
}

.hero-btn-primary:hover .btn-icon {
    transform: translateX(3px);
}

/* Secondary Button */
.hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    background: transparent;
    color: var(--k-grey-light);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.25s ease;
}

.hero-btn-secondary::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 4px;
    right: 4px;
    height: 1px;
    background: currentColor;
    opacity: 0.3;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hero-btn-secondary:hover {
    color: #fff;
}

.hero-btn-secondary:hover::after {
    transform: scaleX(1);
    transform-origin: left;
    opacity: 0.6;
}

.hero-btn-secondary .btn-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}

.hero-btn-secondary:hover .btn-arrow {
    transform: translateX(4px);
}

/* ─── SCROLL CUE ─── */
/* ─── SCROLL CENTER ─── */
.hero-scroll-center {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease 1s;
}

.k-hero.content-visible .hero-scroll-center {
    opacity: 1;
}

.mouse-icon {
    width: 24px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.wheel {
    width: 2px;
    height: 6px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: mouse-wheel 1.5s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes mouse-wheel {
    0% {
        top: 6px;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        top: 20px;
        opacity: 0;
    }
}

.scroll-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.scroll-arrows span {
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255, 255, 255, 0.4);
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
    transform: rotate(45deg);
    animation: arrow-scroll 2s infinite;
    opacity: 0;
}

.scroll-arrows span:nth-child(1) {
    animation-delay: 0s;
}

.scroll-arrows span:nth-child(2) {
    animation-delay: 0.15s;
}

.scroll-arrows span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes arrow-scroll {
    0% {
        opacity: 0;
        transform: rotate(45deg) translate(-5px, -5px);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: rotate(45deg) translate(5px, 5px);
    }
}

/* ─── FOCUS STATES ─── */
.hero-btn-primary:focus-visible,
.hero-btn-secondary:focus-visible {
    outline: 2px solid var(--k-orange);
    outline-offset: 3px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .hero-support {
        padding-bottom: 0;
        justify-content: flex-start;
        text-align: left;
    }

    .hero-lead-wrapper {
        padding-right: 0;
        padding-left: 24px;
    }

    .hero-lead-wrapper::before {
        right: auto;
        left: 0;
    }

    .hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    :root {
        --hero-padding-top: 120px;
        --hero-padding-bottom: 60px;
    }

    .hero-headline {
        font-size: clamp(2.4rem, 4.4vw, 4.4rem) !important;
        white-space: nowrap;
    }

    .hero-headline br {
        display: block;
    }

    .hero-lead {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .hero-btn-primary {
        width: 100%;
        justify-content: center;
    }

    .hero-grid {
        background-size: 40px 40px;
    }
}

/* ─── REDUCED MOTION (MOBILE) ─── */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {

    .js .hero-headline,
    .js .hero-support {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-btn-primary::before {
        display: none;
    }
}

/* ─── PRINT ─── */
@media print {
    .k-hero {
        min-height: auto;
        padding: 40px 0;
    }

    .hero-canvas-wrapper,
    .hero-grain,
    .hero-vignette,
    .hero-grid {
        display: none;
    }

    .hero-headline {
        color: #000;
    }

    .hero-headline em {
        color: #000;
        font-style: italic;
    }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {

    .js .hero-support {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-headline {
        opacity: 1;
        transform: none;
    }



    .hero-btn-primary::before {
        display: none;
    }
}

/* ─── NO-JS FALLBACK ─── */
.no-js .hero-headline,
.no-js .hero-support {
    opacity: 1;
    transform: none;
}



/* ─── PRINT ─── */
@media print {
    .k-hero {
        min-height: auto;
        padding: 40px 0;
    }

    .hero-canvas-wrapper,
    .hero-grain,
    .hero-vignette,
    .hero-grid {
        display: none;
    }

    .hero-headline {
        color: #000;
    }

    .headline-accent em {
        color: #000;
        font-style: italic;
    }
}



/* ─── TRUST BAR ─── */
.trust-bar {
    padding: 40px 0;
    background: var(--k-surface, var(--k-bg));
    border-top: 1px solid var(--k-border, rgba(255, 255, 255, 0.08));
    border-bottom: 1px solid var(--k-border, rgba(255, 255, 255, 0.08));
    overflow: hidden;
}

.trust-container {
    display: flex;
    align-items: center;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.trust-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--k-dim, var(--k-grey-mid));
    white-space: nowrap;
    flex-shrink: 0;
}

.trust-logos {
    flex: 1;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.trust-track {
    display: flex;
    align-items: center;
    gap: 48px;
    animation: marquee 25s linear infinite;
    width: max-content;
}

.trust-track img {
    height: 24px;
    width: auto;
    opacity: 0.5;
    filter: grayscale(100%) brightness(2);
    transition: opacity 0.3s, filter 0.3s;
}

.trust-track img:hover {
    opacity: 0.9;
    filter: grayscale(0%);
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@media (min-width: 768px) {
    .trust-track img {
        height: 28px;
    }

    .trust-track {
        gap: 64px;
    }
}

@media (max-width: 768px) {
    .trust-container {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .trust-label {
        white-space: normal;
    }
}



/* ─── ABOUT SECTION ─── */
.k-about {
    padding: var(--section-pad, 120px) 0;
    background: var(--k-bg);
    position: relative;
    overflow: hidden;
}

/* About Progress Bar (scroll-linked) */
.about-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 2;
}

.about-progress-bar {
    display: block;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, var(--k-orange), transparent);
    transition: height 0.1s ease-out;
}

.about-container {
    max-width: var(--container-max, 1400px);
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
}

.about-left {
    max-width: 560px;
}

.about-headline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 32px;
}

/* Enhanced text-line lighting (scroll-linked) */
.about-headline .text-line {
    display: block;
    color: var(--k-dim, var(--k-grey-dark));
    transition: color 0.4s ease, text-shadow 0.4s ease;
}

.about-headline .text-line.is-lit {
    color: var(--k-white);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.about-headline .accent {
    color: var(--k-orange);
}

.about-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--k-orange), transparent);
    margin-bottom: 32px;
}

.about-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-num {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--k-white);
}

.stat-txt {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--k-dim, var(--k-grey-mid));
}

.about-right {
    max-width: 540px;
}

.about-lead {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--k-muted, var(--k-grey-light));
    margin-bottom: 20px;
}

.about-body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--k-dim, var(--k-grey-mid));
    margin-bottom: 32px;
}

.about-body:last-of-type {
    margin-bottom: 32px;
}

/* Shared Link Arrow Style */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--k-muted, var(--k-grey-light));
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.link-arrow:hover {
    color: var(--k-white);
}

.link-arrow svg {
    transition: transform 0.3s ease;
}

.link-arrow:hover svg {
    transform: translateX(4px);
}

.link-arrow:focus-visible {
    outline: 2px solid var(--k-orange);
    outline-offset: 4px;
}

@media (min-width: 900px) {
    .about-container {
        padding: 0 48px;
    }

    .about-grid {
        grid-template-columns: 1fr 1fr;
        gap: 80px;
        align-items: start;
    }

    .about-right {
        padding-top: 48px;
    }
}

@media (max-width: 768px) {
    .about-progress {
        display: none;
    }
}

/* ─── NO-JS FALLBACK ─── */
.no-js .about-headline .text-line {
    color: var(--k-white);
}



/* [NOTE] Legacy .k-services-* CSS removed. 
   See consolidated SERVICES + WORK block below (line ~1683+) */


/* ─── DIAGNOSTICS SECTION ─── */
/* ═══════════════════════════════════════════════════════
           DIAGNOSTICS CSS OVERHAUL
           ═══════════════════════════════════════════════════════ */

.k-diagnostics {
    padding: 120px 0;
    background: var(--k-bg);
    color: var(--k-white);
}

.diag-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* HEADER */
.diag-header {
    margin-bottom: 60px;
}

.diag-label {
    font-family: var(--font-mono);
    color: var(--k-orange);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1rem;
}

.diag-headline {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    font-weight: 400;
    margin-bottom: 1rem;
}

.diag-subhead {
    font-size: 1.1rem;
    color: var(--k-grey-mid);
}

/* GRID */
.diag-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* CARD 3D SETUP */
.diag-card {
    perspective: 1200px;
    cursor: pointer;
    height: 480px;
    /* Contain layout for performance */
    contain: layout style;
}

/* Focus state */
.diag-card:focus-visible {
    outline: 2px solid var(--k-orange);
    outline-offset: 4px;
    border-radius: 16px;
}

.diag-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Flip Triggers */
@media (hover: hover) {
    .diag-card:hover .diag-card-inner {
        transform: rotateY(180deg);
    }

    /* Hint for hover capable devices */
    .diag-card {
        will-change: transform;
    }
}

.diag-card.is-flipped .diag-card-inner {
    transform: rotateY(180deg);
}

/* FRONT & BACK FACES */
.diag-card-front,
.diag-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--k-border);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ─── PROBLEM STATE (FRONT) ─── */
.diag-card-front {
    background: linear-gradient(145deg, #0a0a0a 0%, #141414 100%);
    /* Desaturated feel */
    filter: grayscale(80%) brightness(0.9);
    transition: filter 0.3s ease;
}

.diag-card:hover .diag-card-front {
    filter: grayscale(60%) brightness(1);
}

/* Scanline Overlay */
.diag-card-front::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px);
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

/* Static Noise */
.diag-card-front::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
    animation: noise-drift 0.5s steps(5) infinite;
    z-index: 2;
}

@keyframes noise-drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-5%, -5%);
    }
}

/* ─── SOLUTION STATE (BACK) ─── */
.diag-card-back {
    background: linear-gradient(145deg, #0f1115 0%, #1a1d24 100%);
    transform: rotateY(180deg);
}

/* Animated Border Gradient */
.diag-card-back::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(243, 112, 33, 0.5),
            transparent 50%,
            rgba(243, 112, 33, 0.2));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ─── CARD CONTENT STYLES ─── */
.card-screen {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 240px;
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-screen--live {
    background: rgba(0, 20, 10, 0.2);
    border-color: rgba(34, 197, 94, 0.1);
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 400;
    z-index: 3;
}

.card-desc {
    font-size: 0.95rem;
    color: var(--k-grey-mid);
    z-index: 3;
}

/* Badges */
.error-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--k-red);
    border: 1px solid rgba(255, 75, 75, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 0, 0, 0.1);
}

.status-online {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-online::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px #22c55e;
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 16px #22c55e;
    }
}

/* Glitch Text */
.glitch-text {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--k-white);
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {

    0%,
    90%,
    100% {
        transform: translateX(0);
        opacity: 1;
    }

    92% {
        transform: translateX(-2px);
        opacity: 0.8;
    }

    94% {
        transform: translateX(2px);
        opacity: 1;
    }

    96% {
        transform: translateX(-1px);
        opacity: 0.9;
    }
}

/* Bars */
.broken-bar,
.live-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 12px 0;
}

.bar-fill {
    height: 100%;
    background: var(--k-red);
}

.live-bar .bar-fill {
    background: #22c55e;
    width: 0%;
    /* JS animates this */
}

.bar-fill--animated {
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Terminal */
.terminal-style {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #ef4444;
}

.terminal-style.clean {
    color: #22c55e;
}

.term-line {
    margin-bottom: 4px;
}

.term-block {
    background: currentColor;
    opacity: 0.5;
}

.term-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Charts */
.chart-svg {
    width: 100%;
    height: 60px;
    overflow: visible;
}

.chart-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.metric-row {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.metric-row.down {
    color: var(--k-grey-mid);
}

.metric-row.up {
    color: var(--k-white);
}

/* Checkmarks */
.checkmarks {
    display: flex;
    gap: 12px;
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--k-grey-mid);
}

.check {
    color: #22c55e;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .diag-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

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

    .diag-card {
        height: 400px;
    }

    /* Touch Hint */
    .diag-card::after {
        content: 'Tap to flip';
        position: absolute;
        bottom: 16px;
        right: 16px;
        font-size: 0.7rem;
        color: var(--k-grey-mid);
        opacity: 0.6;
        pointer-events: none;
        z-index: 5;
    }

    .diag-card.is-flipped::after {
        content: 'Tap to close';
    }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
    .diag-card-inner {
        transform: none !important;
        transition: none;
    }

    .diag-card-back {
        transform: none;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .diag-card.is-flipped .diag-card-back {
        opacity: 1;
        pointer-events: auto;
    }

    .diag-card.is-flipped .diag-card-front {
        opacity: 0;
    }
}



/* ===========================================================
   NEW SERVICES + WORK (KWIKO AIO)
   =========================================================== */

/* ─── SCOPED VARIABLES ─── */
.k-services,
.k-work {
    --k-bg: #050505;
    --k-panel: #0a0a0c;
    --k-panel-alt: #0f1115;
    --k-card-bg: #1a1a1c;
    --k-border: rgba(255, 255, 255, 0.08);
    --k-border-light: rgba(255, 255, 255, 0.12);

    --k-white: #ffffff;
    --k-grey-light: #a3a3a3;
    --k-grey-mid: #6b7280;
    --k-grey-dark: #3a3a3a;

    --k-orange: #F37021;
    --k-orange-dim: rgba(243, 112, 33, 0.15);
    --k-blue: #2e5cff;
    --k-green: #22c55e;
    --k-red: #ff4b4b;

    /* Typo */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

    /* Easings */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── UTILITIES ─── */
.section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--k-orange);
    display: block;
    margin-bottom: 20px;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--k-orange);
    transition: color 0.3s, gap 0.3s;
}

.link-arrow:hover {
    color: var(--k-white);
    gap: 12px;
}

.link-arrow svg {
    transition: transform 0.3s;
}

.link-arrow:hover svg {
    transform: translateX(4px);
}


/* ===========================================================
   SERVICES SECTION
   =========================================================== */

.k-services {
    padding: clamp(80px, 12vh, 140px) 0;
    background: var(--k-bg);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

/* Subtle gradient overlay */
.k-services::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 0% 0%, rgba(243, 112, 33, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(46, 92, 255, 0.03) 0%, transparent 50%);
}

.services-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ─── HEADER ─── */
.services-header {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: end;
    margin-bottom: 80px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--k-border);
}

.services-headline {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--k-white);
    margin: 0;
}

.services-headline em {
    font-style: italic;
    color: var(--k-grey-mid);
}

.services-header-right {
    max-width: 480px;
    justify-self: end;
}

.services-intro {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--k-grey-mid);
    margin-bottom: 24px;
}

.services-intro strong {
    color: var(--k-white);
    font-weight: 500;
}

/* ─── GRID ─── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ─── MOBILE: Stack cards vertically ─── */
@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .service-card {
        min-height: auto;
    }
}

/* ─── SERVICE CARD ─── */
.service-card {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, transparent 50%), var(--k-card-bg);
    border: 1px solid var(--k-border);
    border-top-color: var(--k-border-light);
    border-radius: 16px;
    min-height: 420px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s var(--ease-out),
        box-shadow 0.5s var(--ease-out),
        border-color 0.3s;
}

.service-card:focus-visible {
    outline: 2px solid var(--k-orange);
    outline-offset: 4px;
}

/* ─── CARD HEADER (Always Visible) ─── */
.service-card-header {
    position: relative;
    z-index: 2;
    padding: 32px;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: opacity 0.4s;
}

/* ✅ ICON FIX — hard constrain container, SVG fills container only */
.k-services .service-icon {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px;
    max-height: 56px;
    flex: 0 0 56px;
    flex-shrink: 0;
    margin-bottom: 28px;
    color: var(--k-orange);
    display: grid;
    place-items: center;
    overflow: hidden;
    transition: transform 0.5s var(--ease-out), color 0.4s;
}

.k-services .service-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.service-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.service-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--k-white);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.service-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--k-grey-light);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: opacity 0.3s;
}



/* ─── CARD FOOTER ─── */
.service-card-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--k-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.hover-hint {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--k-grey-mid);
    transition: color 0.3s;
}

.hover-dot {
    width: 6px;
    height: 6px;
    background: var(--k-orange);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s var(--ease-out);
}



.panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--k-orange);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 24px;
    display: block;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.4s ease 0.1s;
}

/* ─── DELIVERABLES LIST ─── */
.deliverables-list {
    flex: 1;
}

.deliverables-list li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--k-grey-light);
    padding: 12px 0;
    padding-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.4s ease,
        transform 0.4s var(--ease-out),
        color 0.3s,
        padding-left 0.3s;
}

.deliverables-list li:last-child {
    border-bottom: none;
}

.deliverables-list li::before {
    content: '▸';
    color: var(--k-orange);
    font-size: 0.8em;
    flex-shrink: 0;
}

/* Stagger animation delays */
.deliverables-list li:nth-child(1) {
    transition-delay: 0.05s;
}

.deliverables-list li:nth-child(2) {
    transition-delay: 0.1s;
}

.deliverables-list li:nth-child(3) {
    transition-delay: 0.15s;
}

.deliverables-list li:nth-child(4) {
    transition-delay: 0.2s;
}

.deliverables-list li:nth-child(5) {
    transition-delay: 0.25s;
}

.deliverables-list li:nth-child(6) {
    transition-delay: 0.3s;
}

.deliverables-list li:hover {
    color: var(--k-white);
    padding-left: 8px;
}

/* Flash effect on appear */
.deliverables-list li::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--k-orange), transparent);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* ─── METRIC BOX ─── */
.panel-metric {
    margin-top: auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--k-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease 0.25s;
}

.metric-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--k-white);
    line-height: 1;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--k-grey-mid);
    text-align: right;
    line-height: 1.4;
}

/* ============================
   SERVICES — reliable structure
   ============================ */

/* HARD stop: never show + on desktop even if theme fights you */
@media (min-width: 901px) {
    .k-services .service-toggle {
        display: none !important;
    }
}

/* Desktop overlay panel */
.k-services .service-card-panel {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(8, 8, 10, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 32px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
    border-radius: 15px;
}

/* Hover reveals (desktop only) */
@media (hover:hover) and (pointer:fine) and (min-width:901px) {
    .k-services .service-card:hover .service-card-panel {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .k-services .service-card:hover .panel-label,
    .k-services .service-card:hover .panel-metric,
    .k-services .service-card:hover .deliverables-list li {
        opacity: 1;
        transform: none;
    }
}

/* Mobile accordion */
@media (max-width: 900px) {
    .k-services .service-toggle {
        display: grid;
        place-items: center;
        position: absolute;
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        border-radius: 999px;
        /* circular */
        border: 1px solid var(--k-border-light);
        background: rgba(255, 255, 255, 0.04);
        color: var(--k-white);
        z-index: 5;
        transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    }

    .k-services .service-toggle:focus-visible {
        outline: 2px solid var(--k-orange);
        outline-offset: 2px;
    }

    .k-services .service-toggle .toggle-icon {
        width: 14px;
        height: 14px;
        position: relative;
    }

    .k-services .toggle-icon::before,
    .k-services .toggle-icon::after {
        content: "";
        position: absolute;
        background: var(--k-grey-light);
        transition: transform 0.25s var(--ease-out), opacity 0.25s var(--ease-out), background 0.25s var(--ease-out);
    }

    .k-services .toggle-icon::before {
        width: 100%;
        height: 2px;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
    }

    .k-services .toggle-icon::after {
        width: 2px;
        height: 100%;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
    }

    /* Expanded Button State */
    .k-services .service-card.is-expanded .service-toggle {
        background: var(--k-orange);
        border-color: var(--k-orange);
    }

    .k-services .service-card.is-expanded .toggle-icon::before,
    .k-services .service-card.is-expanded .toggle-icon::after {
        background: #000;
    }

    .k-services .service-card.is-expanded .toggle-icon::after {
        transform: translateX(-50%) rotate(90deg);
        opacity: 0;
    }

    /* Panel becomes in-flow accordion (your grid-rows approach is solid) */
    .k-services .service-card-panel {
        position: relative;
        inset: auto;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.02);
        backdrop-filter: none;
        opacity: 1;
        transform: none;
        pointer-events: auto;

        display: grid;
        grid-template-rows: 0fr;
        overflow: hidden;
        transition: grid-template-rows .35s var(--ease-out), padding .25s var(--ease-out);
        padding: 0 32px;
    }

    .k-services .service-card-panel .panel-inner {
        overflow: hidden;
        min-height: 0;
        padding-bottom: 24px;
        /* Ensure padding inside inner if needed, or rely on parent padding */
    }

    /* Note: user block had padding-bottom in parent. I'll stick to user block structure. */

    .k-services .service-card.is-expanded .service-card-panel {
        grid-template-rows: 1fr;
        padding-top: 18px;
        padding-bottom: 22px;
    }

    /* Reset transitions for inner items on mobile */
    .k-services .panel-label,
    .k-services .panel-metric,
    .k-services .deliverables-list li {
        opacity: 1;
        transform: none;
        transition: none;
    }

    /* Services footer hide on mobile */
    .k-services .service-card-footer {
        display: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .k-services .service-card-panel,
    .k-services .service-toggle,
    .k-services .toggle-icon::before,
    .k-services .toggle-icon::after {
        transition: none !important;
    }
}


/* ===========================================================
   CASE STUDIES / WORK SECTION
   =========================================================== */

.k-work {
    padding: clamp(80px, 12vh, 140px) 0;
    background: var(--k-panel);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.work-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ─── HEADER ─── */
.work-header {
    margin-bottom: 60px;
}

.work-headline {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--k-white);
    margin: 0 0 16px 0;
}

.work-headline em {
    font-style: italic;
    color: var(--k-grey-mid);
}

.work-intro {
    font-size: 1rem;
    color: var(--k-grey-mid);
    max-width: 500px;
}

/* ─── SCROLLABLE GRID (Mobile) ─── */
.work-grid {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;

    /* Extend to edges */
    margin: 0 -5%;
    padding-left: 5%;
    padding-right: 5%;

    /* Hide scrollbar */
    scrollbar-width: none;
}

.work-grid::-webkit-scrollbar {
    display: none;
}

/* ─── WORK CARD ─── */
.work-card {
    flex: 0 0 340px;
    max-width: 400px;
    scroll-snap-align: center;
    background: var(--k-card-bg);
    border: 1px solid var(--k-border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.4s var(--ease-out),
        border-color 0.3s,
        box-shadow 0.4s var(--ease-out);
}

.work-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

/* ─── CTA CARD ─── */
.work-card.work-card--cta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--k-card-bg);
    border: 1px dashed var(--k-border);
    min-height: 100%;
}

.work-card.work-card--cta:hover {
    border-color: var(--k-orange);
    background: rgba(243, 112, 33, 0.05);
}

.work-card--cta .work-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 0;
}

.work-card--cta .work-card-type {
    margin: 0;
    color: var(--k-orange);
}

.work-card--cta .work-card-title {
    margin: 0;
}

.work-card--cta .work-card-arrow {
    margin-top: 16px;
    font-size: 2rem;
    color: var(--k-orange);
}

/* ─── CARD IMAGE ─── */
.work-card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--k-panel-alt);
}

.work-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.6s ease, transform 0.6s ease;
}

.work-card:hover .work-card-image img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.work-card-year {
    position: absolute;
    top: 12px;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--k-grey-light);
}

/* ─── CARD CONTENT ─── */
.work-card-content {
    padding: 24px;
}

.work-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.work-card-type {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--k-grey-mid);
}

.work-card-arrow {
    font-size: 1.25rem;
    color: var(--k-grey-mid);
    transition: color 0.3s, transform 0.3s;
}

.work-card-arrow--large {
    font-size: 2rem;
}

.work-card:hover .work-card-arrow {
    color: var(--k-orange);
    transform: translateX(4px);
}

.work-card-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--k-white);
    margin: 0 0 20px 0;
    line-height: 1.2;
}

/* ─── RESULT METRIC ─── */
.work-card-result {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--k-border);
}

.result-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--k-white);
    line-height: 1;
}

.result-unit {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--k-orange);
}

/* ─── FOOTER WITH DOTS ─── */
.work-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--k-border);
}

.swipe-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.swipe-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--k-grey-mid);
}

.swipe-dots {
    display: flex;
    gap: 4px;
}

.swipe-dots .dot {
    /* 44x44 touch target */
    appearance: none;
    -webkit-appearance: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
}

/* Visual dot via pseudo-element */
.swipe-dots .dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--k-grey-mid);
    opacity: 0.4;
    transition: background 0.3s, transform 0.3s, opacity 0.3s;
}

.swipe-dots .dot.active::after {
    background: var(--k-orange);
    opacity: 1;
    transform: scale(1.3);
}

.swipe-dots .dot:hover::after {
    opacity: 0.8;
}

/* ─── BUTTON ─── */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: transparent;
    color: var(--k-white);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--k-border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, gap 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    gap: 14px;
}

.btn-secondary svg {
    transition: transform 0.3s;
}

.btn-secondary:hover svg {
    transform: translateX(3px);
}

/* ─── DESKTOP GRID ─── */
@media (min-width: 900px) {
    .work-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .work-card {
        flex: none;
        max-width: none;
    }

    .swipe-indicator {
        display: none;
    }
}

/* ─── TABLET ─── */
@media (max-width: 900px) and (min-width: 600px) {
    .work-card {
        flex: 0 0 300px;
    }
}

/* ─── MOBILE ─── */
@media (max-width: 600px) {
    .work-card {
        flex: 0 0 85%;
        max-width: 320px;
    }

    .work-footer {
        flex-direction: column;
        gap: 24px;
    }

    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {

    .work-card,
    .work-card-image img,
    .work-card-arrow {
        transition: none !important;
    }

    .work-card:hover {
        transform: none;
    }

    .work-card:hover .work-card-image img {
        transform: none;
    }
}

/* ─── TEAM SECTION (k-team) ─── */
.k-team {
    padding: var(--section-pad) 0;
    background: var(--k-bg);
}

.team-container {
    max-width: var(--container-max, 1400px);
    margin: 0 auto;
    padding: 0 24px;
}

.team-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
    align-items: end;
}

.team-headline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--k-white);
    margin: 0;
}

.team-headline em {
    font-style: italic;
    color: var(--k-muted, #888);
}

.team-intro {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--k-muted, #888);
    max-width: 480px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.team-card {
    background: var(--k-card, #111);
    border: 1px solid var(--k-border);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.4s var(--ease-out), box-shadow 0.4s;
}

.team-card:hover {
    border-color: var(--k-border-hover, rgba(255, 255, 255, 0.2));
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

.team-photo {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--k-elevated, #0a0a0a);
}

/* Scanner hover wrapper */
.scan-hover {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Image base state */
.scan-hover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 600ms ease, filter 600ms ease;
    filter: grayscale(100%) saturate(0.95) contrast(1.02);
}

/* Scanline texture + vignette */
.scan-hover::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 1px,
            rgba(0, 0, 0, 0) 3px),
        radial-gradient(circle at 50% 30%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 70%);
    opacity: 0;
    transition: opacity 250ms ease;
    mix-blend-mode: overlay;
}

/* Moving scanner beam */
.scan-hover::after {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    top: -35%;
    height: 26%;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(to bottom,
            rgba(243, 112, 33, 0) 0%,
            rgba(243, 112, 33, 0.12) 35%,
            rgba(243, 112, 33, 0.28) 50%,
            rgba(243, 112, 33, 0.12) 65%,
            rgba(243, 112, 33, 0) 100%);
    opacity: 0;
    transform: translateY(0);
    filter: blur(0.2px);
}

/* Hover triggers */
.scan-hover:hover::before,
.scan-hover:focus-within::before {
    opacity: 1;
}

.scan-hover:hover::after,
.scan-hover:focus-within::after {
    opacity: 1;
    animation: kwiko-scan 900ms ease-in-out forwards;
}

.scan-hover:hover img,
.scan-hover:focus-within img {
    transform: scale(1.05);
    filter: grayscale(0%) contrast(1.08) saturate(1.05);
}

/* Beam motion */
@keyframes kwiko-scan {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(520%);
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .scan-hover::after {
        animation: none !important;
    }
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.6));
    pointer-events: none;
    z-index: 1;
}

.team-info {
    padding: 24px;
}

.team-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--k-dim, #555);
    margin-bottom: 12px;
}

.team-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--k-white);
    margin: 0 0 4px 0;
}

.team-role {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--k-orange);
    display: block;
    margin-bottom: 16px;
}

.team-bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--k-muted, #888);
    margin-bottom: 16px;
}

.team-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--k-muted, #888);
    text-decoration: none;
    transition: color 0.3s;
}

.team-link:hover {
    color: var(--k-orange);
}

/* Responsive */
@media (max-width: 900px) {
    .team-header {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .team-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}



/* ─── CERTS / DEPLOY SECTION ─── */
#kwiko-certs-scope {
    /* Variables */
    --k-bg: #050505;
    --k-card: #0F1115;
    --k-border: rgba(255, 255, 255, 0.08);
    --k-orange: #ff7d00;
    --k-green: #00E676;
    --k-white: #ffffff;
    --k-muted: #888888;

    /* Fonts - Mapping to global fonts to ensure consistency */
    --f-serif: var(--font-display);
    --f-sans: var(--font-body);
    --f-mono: var(--font-mono);

    background-color: var(--k-bg);
    padding: 120px 5%;
    font-family: var(--f-sans);
    color: var(--k-white);
    position: relative;
    overflow: hidden;
}

#kwiko-certs-scope *,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- LAYOUT --- */
.kc-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 80px;
    align-items: center;
}

/* --- LEFT COLUMN --- */
.kc-content {
    padding-right: 40px;
}

.kc-label {
    font-family: var(--f-mono);
    color: var(--k-orange);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: block;
}

.kc-headline {
    font-family: var(--f-serif);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    line-height: 1.1;
    font-weight: 400;
    margin: 0 0 24px 0;
}

.kc-headline em {
    color: var(--k-muted);
    font-style: normal;
}

.ks-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--k-muted);
    margin-bottom: 0;
}

.kc-stat-row {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--k-border);
}

.kc-stat {
    display: flex;
    flex-direction: column;
}

.kc-stat .val {
    font-family: var(--f-mono);
    font-size: 1.5rem;
    color: var(--k-white);
}

.kc-stat .lbl {
    font-size: 0.85rem;
    color: var(--k-muted);
    margin-top: 4px;
}

/* --- RIGHT COLUMN (LIST) --- */
.kc-modules {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--k-border);
}

/* No span needed for list */
.kc-card:nth-child(1) {
    grid-column: auto;
}

/* --- CARD DESIGN (ROW STYLE) --- */
.kc-card {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--k-border);
    height: 80px;
    border-radius: 0;
    position: relative;
    cursor: default;
    transition: background-color 0.3s ease;
    overflow: hidden;
}

.kc-card:last-child {
    border-bottom: none;
}

.kc-card:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.kc-card-inner {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    /* Horizontal alignment */
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}

/* Logo */
.kc-logo {
    height: 48px;
    width: auto;
    max-width: 160px;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.4s ease;
}

/* Invert colored SVGs to white */
.kc-logo.invert-to-white {
    filter: grayscale(100%) brightness(0) invert(1);
    opacity: 0.6;
}

.kc-card:hover .kc-logo {
    opacity: 1;
    filter: grayscale(0%);
}

.kc-card:hover .kc-logo.invert-to-white {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* Status Tag */
.kc-status {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.kc-card:hover .kc-status {
    opacity: 1;
}

/* --- ANIMATION UTILS --- */
.reveal-cert {
    opacity: 0;
    transform: translateY(20px);
    transition: 0.6s ease;
}

.reveal-cert.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.kc-status span {
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--k-green);
}

.kc-status .dot {
    width: 6px;
    height: 6px;
    background-color: var(--k-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--k-green);
}

/* --- ANIMATION UTILS --- */
.reveal-cert {
    opacity: 0;
    transform: translateY(20px);
    transition: 0.6s ease;
}

.reveal-cert.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .kc-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .kc-content {
        padding-right: 0;
        text-align: left;
    }

    .kc-headline br {
        display: block;
        /* Force break on mobile */
        content: "";
        /* Ensure it renders */
        margin-bottom: 8px;
        /* Add slight spacing */
    }
}

@media (max-width: 600px) {
    #kwiko-certs-scope {
        padding: 80px 24px;
    }

    .kc-modules {
        grid-template-columns: 1fr;
    }

    .kc-card:nth-child(1) {
        grid-column: span 1;
    }
}



/* ─── CONTACT CTA SECTION ─── */
.section-pad {
    padding: 120px 5%;
}

#contact {
    background: var(--k-bg);
    padding: 120px 5%;
}

/* Global container for section content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ─── CONTACT CTA ─── */
.cta-box {
    background: #121212;
    /* Sleek dark grey */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

/* ATMOSPHERIC GLOW */
.cta-glow-mesh {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 140, 26, 0.08), transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(147, 51, 234, 0.06), transparent 40%);
    filter: blur(80px);
    animation: rotate-glow 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotate-glow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 6vw, 6rem);
    line-height: 1;
    margin: 32px 0;
    letter-spacing: -0.02em;
}

.cta-title em {
    color: var(--k-orange);
    font-style: italic;
    background: linear-gradient(to right, var(--k-orange), #ff6b6b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-text {
    font-size: 1.25rem;
    color: var(--k-grey-light);
    line-height: 1.6;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.large-cta {
    background: var(--k-white);
    color: #000;
    padding: 20px 48px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
}

.large-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    background: var(--k-white);
}

.cta-subtext {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--k-grey-mid);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}



/* ─── FLOATING ACTION BUTTON ─── */
.k-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 990;
    display: flex;
    align-items: center;
    padding: 16px;
    /* Glassmorphism effect */
    background: rgba(243, 112, 33, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(243, 112, 33, 0.3);
    color: #ffffff;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(243, 112, 33, 0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    max-width: 56px;
    /* Initial width (icon only) */
    white-space: nowrap;
    /* Hidden by default - shown via JavaScript */
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.k-fab.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.k-fab:hover {
    max-width: 200px;
    /* Expanded width */
    padding-right: 24px;
    background: rgba(243, 112, 33, 0.25);
    border-color: rgba(243, 112, 33, 0.5);
    box-shadow: 0 12px 40px rgba(243, 112, 33, 0.3);
}

.k-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.k-fab-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.k-fab-text {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    margin-left: 12px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.k-fab:hover .k-fab-text {
    opacity: 1;
    transform: translateX(0);
}

/* Hide FAB when modal is open */
body:has(.k-modal[open]) .k-fab {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .k-fab {
        bottom: 24px;
        right: 24px;
    }
}



/* ─── MODAL ─── */
.k-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: transparent;
    border: none;
    padding: 24px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
}

.k-modal[open] {
    opacity: 1;
    pointer-events: auto;
}

.k-modal::backdrop {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.k-modal-wrap {
    width: 100%;
    max-width: 900px;
    background: var(--k-panel);
    border: 1px solid var(--k-border);
    border-radius: 24px;
    padding: 48px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s var(--ease-expo);
}

.k-modal[open] .k-modal-wrap {
    transform: scale(1) translateY(0);
}

.k-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--k-border);
    color: var(--k-grey-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.k-modal-close:hover {
    background: var(--k-red);
    border-color: var(--k-red);
    color: #fff;
}

.k-modal-close svg {
    width: 20px;
    height: 20px;
}

.k-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
}

.k-modal-label {
    font-family: var(--font-mono);
    color: var(--k-orange);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
}

.k-modal-head {
    font-family: var(--font-display);
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 24px;
    color: var(--k-white);
    /* Fix readability */
}

.k-modal-head em {
    color: var(--k-grey-mid);
    font-style: italic;
}

.k-modal-desc {
    color: var(--k-grey-light);
    line-height: 1.6;
    margin-bottom: 40px;
}

.k-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-lbl {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--k-grey-mid);
    text-transform: uppercase;
}

.meta-val {
    font-size: 0.95rem;
    color: var(--k-white);
}

.status-online {
    color: var(--k-green);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--k-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--k-green);
}

.k-modal-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--k-grey-mid);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--k-border);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--k-white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--k-orange);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.k-btn-submit {
    background: var(--k-white);
    color: #000;
    padding: 16px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    transition: 0.2s;
}

.k-btn-submit:hover {
    background: var(--k-orange);
    color: #fff;
}

@media (max-width: 800px) {
    .k-modal-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .k-modal-info {
        display: none;
    }

    /* Hide info on mobile to save space */
    .k-modal-wrap {
        padding: 32px;
        margin: 20px;
    }
}

/* ─── MOBILE OVERRIDES (HERO SPACING) ─── */
@media (max-width: 768px) {
    .k-hero {
        padding-top: 140px;
    }

    .hero-lead-wrapper {
        margin-top: 60px;
        /* Reset from 180px */
    }

    .hero-support {
        padding-bottom: 80px;
        /* Increase from 40px for mobile thumb zone */
        text-align: left;
    }

    .hero-container {
        width: 90%;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-headline {
        white-space: normal;
        /* Allow wrapping */
        font-size: 3rem !important;
    }
}