/* ============================================================
   Technology section (home page).

   Three chamfered feature cards on the left (the product, the flagship
   simulator, the learning material) and a flat "everything" list on the right,
   so every tool is one click away. Sized to fit a desktop viewport without
   scrolling. Near-black cards with a cyan-to-violet edge, after the reference
   art; shares the hero's tokens declared on .qubibyte-home.
   ============================================================ */

#Tech.tech-v2,
#Media.media-v2,
#Company.company-v2,
#Career.career-v2 {
    --tk-bg: #0a0a19;
    --tk-card: #0f1024;
    --tk-card-2: #0b0c1d;
    --tk-edge: linear-gradient(135deg, rgba(125, 211, 252, 0.7) 0%, rgba(167, 139, 250, 0.55) 45%, rgba(125, 211, 252, 0.18) 100%);
    --tk-edge-hover: linear-gradient(135deg, rgba(125, 211, 252, 0.95) 0%, rgba(167, 139, 250, 0.85) 45%, rgba(125, 211, 252, 0.4) 100%);
    --tk-text: #f1f4ff;
    --tk-muted: #a7afd6;
    --tk-line: rgba(150, 170, 255, 0.16);
    --tk-row-hover: rgba(150, 170, 255, 0.07);
    --tk-tile: rgba(150, 170, 255, 0.07);
    --tk-tile-border: rgba(150, 170, 255, 0.22);
    --tk-btn-border: rgba(210, 220, 255, 0.28);
    --tk-btn-bg: rgba(255, 255, 255, 0.03);
    --tk-fill: #ffffff;
    --tk-fill-text: #0f1024;
    --tk-fill-shadow: rgba(0, 0, 0, 0.35);
    --tk-glow: rgba(140, 120, 255, 0.35);
    background: var(--tk-bg);
    color: var(--tk-text);
    padding: 30px 0 28px;
    position: relative;
    overflow: hidden;
}

html[data-theme="light"] #Tech.tech-v2,
html[data-theme="light"] #Media.media-v2,
html[data-theme="light"] #Company.company-v2,
html[data-theme="light"] #Career.career-v2 {
    --tk-bg: #eef0fb;
    --tk-card: #ffffff;
    --tk-card-2: #f7f8ff;
    --tk-edge: linear-gradient(135deg, rgba(56, 140, 220, 0.7) 0%, rgba(124, 92, 255, 0.55) 45%, rgba(56, 140, 220, 0.25) 100%);
    --tk-edge-hover: linear-gradient(135deg, rgba(56, 140, 220, 1) 0%, rgba(124, 92, 255, 0.9) 45%, rgba(56, 140, 220, 0.5) 100%);
    --tk-text: #171b33;
    --tk-muted: #5b6285;
    --tk-line: rgba(40, 50, 120, 0.12);
    --tk-row-hover: rgba(40, 50, 120, 0.05);
    --tk-tile: rgba(40, 50, 120, 0.05);
    --tk-tile-border: rgba(40, 50, 120, 0.16);
    --tk-btn-border: rgba(40, 50, 120, 0.3);
    --tk-btn-bg: rgba(255, 255, 255, 0.6);
    --tk-fill: #1e2748;
    --tk-fill-text: #ffffff;
    --tk-fill-shadow: rgba(30, 39, 72, 0.25);
    --tk-glow: rgba(120, 100, 255, 0.22);
}

/* Faint drafting grid behind everything. */
#Tech.tech-v2::before,
#Media.media-v2::before,
#Company.company-v2::before,
#Career.career-v2::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(140, 150, 230, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 150, 230, 0.07) 1px, transparent 1px);
    background-size: 54px 54px;
}

html[data-theme="light"] #Tech.tech-v2::before,
html[data-theme="light"] #Media.media-v2::before,
html[data-theme="light"] #Company.company-v2::before,
html[data-theme="light"] #Career.career-v2::before {
    background-image:
        linear-gradient(rgba(60, 70, 160, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(60, 70, 160, 0.08) 1px, transparent 1px);
}

.tk-wrap {
    position: relative;
    width: min(1280px, 100% - 48px);
    margin: 0 auto;
}

.section-header.tk-heading {
    font-size: 2.5em;
    margin-bottom: 24px;
    color: var(--tk-text);
}

.section-header.tk-heading::after {
    display: none;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.tk-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
    gap: 24px;
    align-items: stretch;
    text-align: left;
}

/* Three equal rows that together are exactly as tall as the list. */
.tk-cards {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 12px;
    min-width: 0;
}

.tk-cards > .tk-card,
.tk-cards > .tk-stack,
.tk-stack > .tk-card {
    height: 100%;
}

.tk-card-inner {
    height: 100%;
}

/* ── Chamfered cards ────────────────────────────────────────────────────
   The card is the gradient edge; the inner box is the fill, clipped to the
   same polygon one pixel in, which leaves a 1px gradient border along every
   edge including the cuts. */

.tk-card {
    --cut: 30px;
    --cut-big: var(--cut);
    position: relative;
    padding: 1px;
    background: var(--tk-edge);
    clip-path: polygon(var(--cut-big) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut-big));
    transition: transform var(--transition-fast);
}

.tk-card:hover {
    background: var(--tk-edge-hover);
    transform: translateY(-2px);
}

.tk-card-inner {
    position: relative;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    min-height: 192px;
    padding: 16px 28px 16px 20px;
    background:
        radial-gradient(ellipse at 18% 50%, rgba(120, 140, 255, 0.10) 0%, rgba(0, 0, 0, 0) 55%),
        linear-gradient(160deg, var(--tk-card) 0%, var(--tk-card-2) 100%);
    clip-path: polygon(var(--cut-big) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut-big));
}

/* Bracket ticks in the two uncut corners, like the reference. */
.tk-card-inner::before,
.tk-card-inner::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 0 solid rgba(160, 190, 255, 0.45);
    pointer-events: none;
}

.tk-card-inner::before {
    top: 10px;
    right: 10px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.tk-card-inner::after {
    bottom: 10px;
    left: 10px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

/* Product card: a deep top-left cut, the render sits in it. */
.tk-card--quadra {
    --cut-big: 64px;
}

/* Art on the right for the other two. */
.tk-card--art-right .tk-card-inner {
    grid-template-columns: minmax(0, 1fr) 320px;
    padding: 16px 20px 16px 28px;
}

.tk-card--art-right .tk-card-art {
    order: 2;
}

.tk-stack {
    position: relative;
}

/* ── Card content ───────────────────────────────────────────────────── */

.tk-card-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

/* The render is square; cap its height so the card stays one row tall. */
.tk-card-art > img {
    width: auto;
    max-width: 100%;
    max-height: 200px;
    height: auto;
    display: block;
    filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 24px rgba(130, 110, 255, 0.25));
}

html[data-theme="light"] .tk-card-art > img {
    filter: drop-shadow(0 12px 18px rgba(40, 50, 100, 0.28));
}

.tk-sim-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 12px var(--tk-glow));
}

/* The circuit is generated with the hero's dark palette; recolour on light. */
html[data-theme="light"] .tk-sim-svg .viz-wire { stroke: rgba(76, 64, 160, 0.5); }
html[data-theme="light"] .tk-sim-svg .viz-label { fill: #334155; }
html[data-theme="light"] .tk-sim-svg .viz-ctrl { stroke: #f4f5fc; }
html[data-theme="light"] .tk-sim-svg .viz-meas { stroke: #fff; }

/* Learning art: the Qubi certificate. */
.tk-learn-art {
    position: relative;
    width: 240px;
    height: 168px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tk-learn-art .tk-certart {
    width: 230px;
    height: auto;
    transform: rotate(-3deg);
    filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.5));
}

html[data-theme="light"] .tk-learn-art .tk-certart {
    filter: drop-shadow(0 10px 16px rgba(40, 50, 100, 0.25));
}

.tk-card-body {
    min-width: 0;
}

.tk-card-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 2.2vw, 2.4rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0.01em;
    color: var(--tk-text);
    margin: 0 0 4px;
}

.tk-card-sub {
    font-family: var(--font-display);
    font-size: 1.22rem;
    font-weight: 400;
    line-height: 1.3;
    color: var(--tk-muted);
    margin: 0 0 14px;
    max-width: 52ch;
}

.tk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tk-chip {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 7px;
    font-family: var(--font-display);
    font-size: 0.98rem;
    color: var(--tk-muted);
    border: 1px solid var(--tk-line);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.tk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--tk-btn-border);
    background: var(--tk-btn-bg);
    color: var(--tk-text);
    font-family: var(--font-display);
    font-size: 1.06rem;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast),
        transform var(--transition-fast), box-shadow var(--transition-fast);
}

.tk-btn:hover,
.tk-btn:focus-visible {
    color: var(--tk-text);
    border-color: rgba(167, 139, 250, 0.9);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Solid: white with dark text on dark, navy with white text on light. */
.tk-btn--fill {
    background: var(--tk-fill);
    border-color: transparent;
    color: var(--tk-fill-text);
    font-weight: 600;
    box-shadow: 0 6px 18px var(--tk-fill-shadow);
}

.tk-btn--fill:hover,
.tk-btn--fill:focus-visible {
    color: var(--tk-fill-text);
    border-color: transparent;
    box-shadow: 0 8px 22px var(--tk-fill-shadow);
}

.tk-btn--sm {
    padding: 6px 13px;
    font-size: 0.98rem;
}

/* ── The full list ───────────────────────────────────────────────────── */

.tk-list {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tk-list-panel {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    padding: 1px;
    background: var(--tk-edge);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%);
}

.tk-list-inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(170deg, var(--tk-card) 0%, var(--tk-card-2) 100%);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%);
    padding-bottom: 14px;
}

.tk-group + .tk-group {
    border-top: 1px solid var(--tk-line);
}

.tk-group summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display);
    font-size: 1.28rem;
    font-weight: 600;
    color: var(--tk-text);
    user-select: none;
}

.tk-group summary::-webkit-details-marker {
    display: none;
}

.tk-group summary:hover {
    background: var(--tk-row-hover);
}

.tk-group-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.tk-count {
    color: var(--tk-muted);
    font-weight: 400;
}

.tk-chev {
    margin-left: auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--tk-muted);
    border-bottom: 2px solid var(--tk-muted);
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
    margin-top: -4px;
}

.tk-group[open] .tk-chev {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.tk-rows {
    list-style: none;
    margin: 0;
    padding: 0 14px 6px 22px;
}

.tk-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.tk-row:hover {
    background: var(--tk-row-hover);
}

.tk-row-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--tk-tile);
    border: 1px solid var(--tk-tile-border);
}

.tk-row-icon .site-icon-colored {
    width: 20px;
    height: 20px;
}

.tk-row-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.tk-row-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tk-row-name {
    font-family: var(--font-display);
    font-size: 1.16rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--tk-text);
}

.tk-row-sub {
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--tk-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1399.98px) {
    .tk-card-inner {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .tk-card--art-right .tk-card-inner {
        grid-template-columns: minmax(0, 1fr) 240px;
    }

}

@media (max-width: 1199.98px) {
    .tk-layout {
        grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
    }

    .tk-card-inner {
        grid-template-columns: 200px minmax(0, 1fr);
        min-height: 0;
    }

    .tk-card--art-right .tk-card-inner {
        grid-template-columns: minmax(0, 1fr) 200px;
    }

    .tk-learn-art {
        transform: scale(0.8);
        transform-origin: center;
    }
}

@media (max-width: 991.98px) {
    .tk-layout {
        grid-template-columns: 1fr;
    }

    /* Stacked: each card takes its natural height again. */
    .tk-cards {
        grid-template-rows: auto;
    }

    .tk-cards > .tk-card,
    .tk-cards > .tk-stack,
    .tk-stack > .tk-card,
    .tk-card-inner {
        height: auto;
    }

}

@media (max-width: 767.98px) {
    #Tech.tech-v2,
    #Media.media-v2,
    #Company.company-v2,
    #Career.career-v2 {
        padding: 36px 0 32px;
    }

    .tk-wrap {
        width: min(1760px, 100% - 32px);
    }

    .tk-card,
    .tk-card--quadra {
        --cut: 22px;
        --cut-big: 22px;
    }

    .tk-card-inner,
    .tk-card--art-right .tk-card-inner {
        grid-template-columns: 1fr;
        gap: 12px;
        /* Extra room at the bottom keeps the buttons off the corner tick. */
        padding: 18px 16px 38px;
    }

    .tk-card--art-right .tk-card-art {
        order: 0;
    }

    .tk-card-art {
        min-height: 130px;
    }

    .tk-card-art > img {
        max-width: 210px;
    }

    .tk-sim-svg {
        max-width: 240px;
    }

    .tk-learn-art {
        transform: scale(0.72);
        height: 132px;
        margin-top: 10px;
        transform-origin: center top;
    }

    .tk-card-title {
        font-size: 1.75rem;
    }

    .tk-card-sub {
        font-size: 1.1rem;
    }


    .tk-actions .tk-btn {
        flex: 1 1 auto;
    }

    /* Quadra: the button takes its own line so the three tags share the next. */
    .tk-card--quadra .tk-actions .tk-btn {
        flex: 1 1 100%;
    }

    .tk-rows {
        padding: 0 8px 6px 10px;
    }

    .tk-row {
        gap: 10px;
    }

    .tk-row-sub {
        white-space: normal;
    }

    .tk-group summary {
        padding: 11px 14px;
        font-size: 1.16rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tk-card,
    .tk-btn,
    .tk-chev {
        transition: none;
    }
}
