.projects-page {
    background:
        linear-gradient(180deg, rgba(6, 19, 34, 0.92), var(--bg) 30rem),
        var(--bg);
}

.projects-page .site-nav a.is-active {
    color: var(--text);
}

.projects-page .site-nav a.is-active::after {
    transform: scaleX(1);
}

.projects-hero {
    position: relative;
    min-height: 620px;
    display: grid;
    align-items: center;
    padding: 130px 0 76px;
    overflow: hidden;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background:
        linear-gradient(90deg, rgba(2, 8, 23, 0.98) 0%, rgba(2, 8, 23, 0.84) 48%, rgba(2, 8, 23, 0.58) 100%),
        url("../assets/images/kernel-codes-hero.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.projects-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(87, 240, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(87, 240, 255, 0.055) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: linear-gradient(90deg, transparent, #000 24%, #000 82%, transparent);
}

.projects-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 28%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(2, 8, 23, 0.98));
}

.projects-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.8fr);
    gap: clamp(38px, 7vw, 90px);
    align-items: center;
}

.projects-hero-copy h1 {
    max-width: 760px;
    font-size: clamp(3rem, 6.4vw, 5.7rem);
}

.projects-hero-copy > p:not(.eyebrow) {
    max-width: 680px;
    margin: 24px 0 0;
    color: var(--muted-strong);
    font-size: clamp(1rem, 1.7vw, 1.22rem);
}

.projects-hero-visual {
    position: relative;
    min-height: 390px;
}

.hero-panel,
.hero-signal,
.hero-connection {
    position: absolute;
    display: block;
}

.hero-panel {
    border: 1px solid rgba(87, 240, 255, 0.2);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(37, 167, 255, 0.13), rgba(138, 92, 255, 0.08)),
        rgba(10, 20, 36, 0.64);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(12px);
}

.hero-panel--main {
    inset: 44px 42px 46px 0;
}

.hero-panel--main::before,
.hero-panel--main::after,
.hero-panel--side::before,
.hero-panel--side::after {
    content: "";
    position: absolute;
    border-radius: var(--radius);
    background: rgba(248, 251, 255, 0.1);
}

.hero-panel--main::before {
    left: 28px;
    right: 120px;
    top: 34px;
    height: 12px;
}

.hero-panel--main::after {
    left: 28px;
    right: 28px;
    bottom: 34px;
    height: 120px;
    background:
        linear-gradient(90deg, rgba(87, 240, 255, 0.24), rgba(138, 92, 255, 0.2)),
        rgba(248, 251, 255, 0.06);
}

.hero-panel--side {
    right: 0;
    top: 104px;
    width: 145px;
    height: 170px;
}

.hero-panel--side::before {
    left: 18px;
    right: 18px;
    top: 22px;
    height: 10px;
}

.hero-panel--side::after {
    left: 18px;
    right: 18px;
    bottom: 24px;
    height: 72px;
    background: rgba(94, 240, 161, 0.16);
}

.hero-signal {
    z-index: 2;
    width: 68px;
    height: 68px;
    border: 1px solid rgba(87, 240, 255, 0.32);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(87, 240, 255, 0.4), rgba(37, 167, 255, 0.12) 42%, rgba(10, 20, 36, 0.72) 72%);
    box-shadow: 0 0 40px rgba(37, 167, 255, 0.26);
}

.hero-signal--one {
    left: 16px;
    top: 4px;
}

.hero-signal--two {
    right: 44px;
    top: 34px;
    width: 46px;
    height: 46px;
}

.hero-signal--three {
    right: 96px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    background:
        radial-gradient(circle, rgba(94, 240, 161, 0.4), rgba(94, 240, 161, 0.12) 42%, rgba(10, 20, 36, 0.72) 72%);
}

.hero-connection {
    height: 1px;
    background: linear-gradient(90deg, rgba(87, 240, 255, 0.55), rgba(138, 92, 255, 0.1));
    transform-origin: left;
}

.hero-connection--one {
    left: 76px;
    top: 68px;
    width: 300px;
    transform: rotate(14deg);
}

.hero-connection--two {
    left: 170px;
    bottom: 76px;
    width: 230px;
    transform: rotate(-18deg);
}

.projects-intro {
    padding-bottom: 72px;
}

.project-index-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.project-index-card {
    min-height: 190px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: space-between;
    gap: 18px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
        rgba(10, 20, 36, 0.78);
    box-shadow: var(--shadow);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-index-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    background:
        linear-gradient(145deg, rgba(37, 167, 255, 0.1), rgba(138, 92, 255, 0.045)),
        rgba(10, 20, 36, 0.92);
}

.project-index-number {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(87, 240, 255, 0.34);
    border-radius: var(--radius);
    background: rgba(37, 167, 255, 0.1);
    color: var(--cyan);
    font-weight: 950;
}

.project-index-card p {
    margin: 0 0 8px;
    color: var(--muted);
}

.project-index-card h3 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.project-index-card a {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--cyan);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.project-index-card a i {
    width: 18px;
    height: 18px;
}

.project-case {
    position: relative;
    padding: clamp(78px, 9vw, 126px) 0;
    scroll-margin-top: 96px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.project-case::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(10, 20, 36, 0.36), transparent 36%),
        linear-gradient(90deg, rgba(37, 167, 255, 0.05), transparent 42%, rgba(138, 92, 255, 0.04));
}

.project-case--ancora::before {
    background:
        linear-gradient(180deg, rgba(10, 20, 36, 0.28), transparent 36%),
        linear-gradient(90deg, rgba(94, 240, 161, 0.045), transparent 42%, rgba(37, 167, 255, 0.05));
}

.case-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.case-kicker {
    margin: 0;
    color: var(--cyan);
    font-size: 0.82rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.case-header span {
    color: var(--muted);
    font-size: 0.92rem;
}

.case-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
    gap: clamp(30px, 6vw, 72px);
    align-items: center;
}

.case-layout--reverse {
    grid-template-columns: minmax(420px, 1.06fr) minmax(0, 0.94fr);
}

.project-case--ancora .case-copy {
    align-self: center;
    padding-top: clamp(22px, 3.2vw, 46px);
    padding-left: clamp(16px, 2.8vw, 42px);
}

.case-copy h2 {
    font-size: clamp(2.4rem, 5vw, 4.6rem);
}

.case-copy > p:not(.eyebrow) {
    max-width: 680px;
    margin: 20px 0 0;
    color: var(--muted-strong);
    font-size: 1.06rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 28px;
}

.feature-grid--compact {
    grid-template-columns: 1fr;
}

.feature-grid span {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius);
    background: rgba(15, 28, 49, 0.62);
    color: var(--muted-strong);
    font-size: 0.92rem;
    font-weight: 750;
}

.feature-grid i {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--cyan);
}

.project-preview {
    margin: 0;
}

.project-preview figcaption {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.project-preview-link {
    width: fit-content;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    border: 1px solid rgba(87, 240, 255, 0.28);
    border-radius: var(--radius);
    padding: 0 12px;
    background: rgba(37, 167, 255, 0.1);
    color: var(--cyan);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-preview-link i {
    width: 16px;
    height: 16px;
}

.project-preview-link:hover {
    transform: translateY(-2px);
    border-color: rgba(87, 240, 255, 0.7);
    background: rgba(37, 167, 255, 0.16);
}

.mock-window {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(87, 240, 255, 0.22);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
        rgba(7, 19, 34, 0.86);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.42),
        0 0 50px rgba(37, 167, 255, 0.12);
}

.project-preview--large .mock-window {
    min-height: 430px;
    aspect-ratio: 16 / 10;
}

.project-preview--small .mock-window {
    min-height: 260px;
    aspect-ratio: 16 / 11;
}

.mock-window::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(87, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(87, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, #000, transparent 86%);
}

.mock-window-bar {
    position: relative;
    z-index: 1;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 8, 23, 0.48);
}

.mock-window-bar span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.5);
}

.mock-window-bar span:first-child {
    background: var(--warning);
}

.mock-window-bar span:nth-child(2) {
    background: var(--green);
}

.mock-window-bar span:nth-child(3) {
    background: var(--blue);
}

.mock-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 18px;
    height: calc(100% - 42px);
    min-height: 388px;
    padding: 18px;
}

.mock-sidebar,
.mock-content,
.mock-board,
.mock-list-lines,
.mock-chart,
.mock-flow,
.mock-detail-lines {
    position: relative;
    z-index: 1;
}

.mock-sidebar {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    background: rgba(2, 8, 23, 0.5);
}

.mock-sidebar span,
.mock-heading,
.mock-metrics span,
.mock-table span,
.mock-list-lines span,
.mock-detail-lines span {
    display: block;
    border-radius: var(--radius);
    background: rgba(248, 251, 255, 0.1);
}

.mock-sidebar span {
    height: 12px;
}

.mock-sidebar span:first-child {
    width: 68%;
    background: rgba(87, 240, 255, 0.28);
}

.mock-content {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 16px;
}

.mock-heading {
    width: 48%;
    height: 20px;
    background: rgba(87, 240, 255, 0.24);
}

.mock-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mock-metrics span {
    min-height: 74px;
    background:
        linear-gradient(135deg, rgba(37, 167, 255, 0.22), rgba(138, 92, 255, 0.1)),
        rgba(15, 28, 49, 0.78);
}

.mock-table {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(2, 8, 23, 0.42);
}

.mock-table span {
    height: 38px;
}

.case-insights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 34px;
}

.insight-card {
    min-height: 190px;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018)),
        rgba(10, 20, 36, 0.72);
}

.insight-card span {
    display: block;
    margin-bottom: 12px;
    color: var(--cyan);
    font-size: 0.82rem;
    font-weight: 950;
    text-transform: uppercase;
}

.insight-card p {
    margin: 0;
    color: var(--muted-strong);
}

.case-support {
    display: grid;
    grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
    gap: 28px;
    align-items: start;
    margin-top: 34px;
}

.case-support--split {
    grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
}

.case-stack {
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius);
    background: rgba(10, 20, 36, 0.66);
}

.case-stack h3 {
    margin-bottom: 14px;
}

.case-stack p {
    margin: 0 0 16px;
    color: var(--muted);
}

.stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stack-tags span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(87, 240, 255, 0.22);
    border-radius: 999px;
    padding: 6px 11px;
    background: rgba(15, 28, 49, 0.72);
    color: var(--muted-strong);
    font-size: 0.84rem;
    font-weight: 750;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.mock-list-lines,
.mock-detail-lines {
    display: grid;
    gap: 14px;
    padding: 26px;
}

.mock-list-lines span {
    height: 34px;
}

.mock-list-lines span:first-child {
    width: 58%;
    background: rgba(87, 240, 255, 0.24);
}

.mock-chart {
    height: calc(100% - 42px);
    min-height: 218px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
    gap: 14px;
    padding: 26px;
}

.mock-chart span {
    display: block;
    min-height: 74px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(94, 240, 161, 0.72), rgba(37, 167, 255, 0.24));
}

.mock-chart span:nth-child(2) {
    min-height: 130px;
}

.mock-chart span:nth-child(3) {
    min-height: 104px;
}

.mock-chart span:nth-child(4) {
    min-height: 168px;
}

.mock-board {
    height: calc(100% - 42px);
    min-height: 388px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
}

.mock-board span {
    display: block;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(94, 240, 161, 0.15), rgba(37, 167, 255, 0.08)),
        rgba(15, 28, 49, 0.76);
}

.mock-board span:nth-child(2),
.mock-board span:nth-child(5) {
    transform: translateY(22px);
}

.mock-flow {
    min-height: 218px;
    display: grid;
    align-content: center;
    gap: 18px;
    padding: 26px;
}

.mock-flow span {
    position: relative;
    display: block;
    height: 52px;
    border: 1px solid rgba(87, 240, 255, 0.2);
    border-radius: var(--radius);
    background: rgba(15, 28, 49, 0.8);
}

.mock-flow span::after {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    top: 50%;
    height: 8px;
    border-radius: 999px;
    background: rgba(87, 240, 255, 0.18);
    transform: translateY(-50%);
}

.mock-detail-lines span {
    height: 24px;
}

.mock-detail-lines span:first-child {
    width: 44%;
    height: 52px;
    background: rgba(94, 240, 161, 0.22);
}

.mock-detail-lines span:nth-child(2) {
    width: 84%;
}

.mock-detail-lines span:nth-child(3) {
    width: 68%;
}

.projects-cta {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(90deg, rgba(37, 167, 255, 0.1), rgba(138, 92, 255, 0.08)),
        rgba(10, 20, 36, 0.72);
}

.projects-cta .final-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.projects-cta h2 {
    max-width: 760px;
}

.projects-cta p:not(.eyebrow) {
    max-width: 720px;
    color: var(--muted);
}

@media (max-width: 1080px) {
    .projects-hero-inner,
    .case-layout,
    .case-layout--reverse,
    .case-support,
    .case-support--split {
        grid-template-columns: 1fr;
    }

    .projects-hero-visual {
        min-height: 310px;
    }

    .case-layout--reverse .project-preview {
        order: 2;
    }

    .case-layout--reverse .case-copy {
        order: 1;
    }

    .project-case--ancora .case-copy {
        padding-top: 0;
        padding-left: 0;
    }

    .case-insights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .projects-hero {
        min-height: auto;
        padding: 112px 0 58px;
    }

    .projects-hero-copy h1 {
        font-size: clamp(2.45rem, 12vw, 3.2rem);
    }

    .projects-hero-visual {
        min-height: 250px;
    }

    .hero-panel--main {
        inset: 28px 34px 36px 0;
    }

    .hero-panel--side {
        top: 78px;
        width: 118px;
        height: 138px;
    }

    .project-index-grid,
    .feature-grid,
    .screenshot-grid {
        grid-template-columns: 1fr;
    }

    .project-index-card,
    .insight-card,
    .case-stack {
        padding: 22px;
    }

    .case-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-preview--large .mock-window,
    .project-preview--small .mock-window {
        min-height: 250px;
        aspect-ratio: auto;
    }

    .mock-layout {
        grid-template-columns: 76px 1fr;
        min-height: 250px;
        gap: 12px;
        padding: 12px;
    }

    .mock-sidebar {
        padding: 12px;
    }

    .mock-metrics {
        grid-template-columns: 1fr;
    }

    .mock-metrics span {
        min-height: 40px;
    }

    .mock-table span {
        height: 28px;
    }

    .mock-board {
        min-height: 230px;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .projects-cta .final-cta-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .projects-cta .btn {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .projects-hero-copy .hero-actions,
    .projects-hero-copy .btn {
        width: 100%;
    }

    .project-index-card {
        grid-template-columns: 1fr;
    }

    .feature-grid span {
        min-height: 48px;
        font-size: 0.86rem;
    }

    .mock-layout {
        grid-template-columns: 1fr;
    }

    .mock-sidebar {
        display: none;
    }
}
