
/* =========================================
   SWARMZ — PROJECT PAGE
========================================= */

/* Base */

.swarmz-page {
    background: #FFF4E8;
    color: #281711;
    font-family: "DM Sans", sans-serif;
}

.swarmz-page h1,
.swarmz-page h2,
.swarmz-page h3,
.swarmz-page h4 {
    font-family: "Space Grotesk", sans-serif;
}

.swarmz-page .section-shell {
    width: min(calc(100% - 36px), 1100px);
    margin-inline: auto;
}

.swarmz-page .eyebrow {
    color: #9A6044;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

/* =========================================
   NAVIGATION
========================================= */

.project-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-block: 22px;
}

.project-topbar .site-logo {
    color: #281711;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.project-topbar .site-logo span {
    color: #F0865D;
}

.back-link {
    color: #6B3F2B;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
    text-underline-offset: 5px;
}

/* =========================================
   HERO
========================================= */

.project-hero {
    padding-block: 65px;
}

.project-hero h1 {
    font-size: clamp(4rem, 10vw, 8rem);
    line-height: 1;
    margin: 0 0 14px;
    letter-spacing: -0.05em;
}

.project-hero .dot {
    color: #F0865D;
}

.hero-lead {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    color: #6B3F2B;
    max-width: 730px;
    line-height: 1.6;
}

/* Gameplay media */

.hero-media {
    position: relative;
    margin-top: 32px;

    background: #281711;
    border: 2px solid #6B3F2B;
    border-radius: 22px;

    overflow: hidden;

    box-shadow: 8px 8px 0 rgba(107, 63, 43, 0.18);
}

.hero-media img,
.hero-media video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.gameplay-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
}

.media-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    padding: 14px 20px;

    background: linear-gradient(
        transparent,
        rgba(0, 0, 0, 0.8)
    );

    color: white;
    font-size: 0.83rem;
}

/* Project facts */

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

    padding: 28px 0;

    border-bottom: 1px solid #D9BCA4;
}

.facts > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.facts small {
    color: #9A6044;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.facts strong {
    font-size: 0.96rem;
    line-height: 1.4;
}

/* =========================================
   BUTTONS
========================================= */

.swarmz-page .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.project-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 50px;
    padding: 13px 22px;

    border-radius: 12px;
    border: 2px solid #6B3F2B;

    font-weight: 700;
    text-decoration: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.project-button:hover {
    transform: translateY(-3px);
}

.project-button.primary {
    background: #F0865D;
    color: #281711;
    box-shadow: 4px 4px 0 #6B3F2B;
}

.project-button.secondary {
    background: transparent;
    color: #6B3F2B;
}

.project-button:focus-visible,
.swarmz-page a:focus-visible,
.swarmz-page button:focus-visible {
    outline: 3px solid #F0865D;
    outline-offset: 4px;
}

/* =========================================
   COMMON SECTIONS
========================================= */

.project-section {
    padding-block: 65px;
    border-top: 1px solid #D9BCA4;
    scroll-margin-top: 35px;
}

.project-section h2 {
    font-size: clamp(2.1rem, 5vw, 3.5rem);
    line-height: 1.15;
    margin: 0 0 22px;
}

.project-section > p:not(.eyebrow) {
    max-width: 780px;
    font-size: 1.07rem;
    line-height: 1.75;
    color: #6B3F2B;
}

/* Personal contribution callout */

.project-note {
    max-width: 800px;
    margin-top: 28px;

    padding: 18px 22px;

    background: #FCE6D8;
    border-left: 4px solid #F0865D;
    border-radius: 0 12px 12px 0;
}

.project-note p {
    margin: 6px 0 0;
    color: #6B3F2B;
    line-height: 1.65;
}

/* Navigation between technical sections */

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 34px;
}

.quick-links a {
    background: #FCE6D8;
    color: #6B3F2B;

    border: 1px solid #C99A79;
    border-radius: 999px;

    padding: 9px 14px;

    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
}

.quick-links a:hover {
    background: #FBA17F;
}

/* =========================================
   TECHNICAL BREAKDOWN
========================================= */

.breakdown {
    display: grid;
    grid-template-columns:
        minmax(0, 0.85fr)
        minmax(0, 1.15fr);

    align-items: start;
    gap: clamp(26px, 5vw, 60px);

    padding-block: 50px;
    border-top: 1px solid #D9BCA4;

    scroll-margin-top: 50px;
}

.breakdown h3 {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    line-height: 1.15;
    margin: 10px 0 16px;
}


/* =========================
   FOG OF WAR — VISUAL STEPS
========================= */

.fog-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 850px;
    margin: 40px auto;
}

.fog-step {
    margin: 0;
    padding: 16px;
    background: #FCE6D8;
    border: 1px solid #C99A79;
    border-radius: 18px;
}

.fog-step img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.fog-step figcaption {
    margin-top: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #6B3F2B;
}


/* Fog section organization */

#fog {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

#fog .fog-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

#fog .fog-section h4 {
    margin-bottom: 12px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    color: #6B3F2B;
}

#fog .fog-section .breakdown-copy p + p {
    margin-top: 16px;
}

#fog .fog-steps {
    margin: 8px auto;
    width: 100%;
}

#fog .fog-step img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

#fog .fog-demo-note {
    margin-top: -8px;
    color: #9A6044;
    font-size: 0.85rem;
    line-height: 1.6;
}

#fog > .reference {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid rgba(107, 63, 43, 0.2);
}

@media (max-width: 600px) {
    #fog {
        gap: 24px;
    }

    #fog .fog-section {
        gap: 18px;
    }
}


/* Transition between steps */

.fog-transition {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 12px;

    color: #9A6044;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

/* CSS arrow */

.fog-arrow {
    position: relative;
    display: block;
    width: 3px;
    height: 36px;
    background: #F0865D;
    border-radius: 3px;
}

.fog-arrow::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;

    width: 12px;
    height: 12px;

    border-right: 3px solid #F0865D;
    border-bottom: 3px solid #F0865D;

    transform: translateX(-50%) rotate(45deg);
}

/* Small screens */

@media (max-width: 600px) {
    .fog-step {
        padding: 10px;
    }

    .fog-transition {
        padding: 16px 8px;
        font-size: 0.78rem;
    }

    .fog-arrow {
        height: 28px;
    }
}


.chapter {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: #9A6044;
    font-weight: 700;
}

.breakdown-copy p {
    line-height: 1.75;
    color: #6B3F2B;
}

.reference {
    font-size: 0.93rem;
}

.reference a {
    color: #6B3F2B;
    font-weight: 700;
}

/* =========================================
   INTERACTIVE FOG OF WAR
========================================= */

.demo-card,
.illustration-placeholder {
    min-width: 0;
    padding: 22px;

    background: #FCE6D8;
    border: 1px solid #C99A79;
    border-radius: 20px;
}

.demo-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    margin-bottom: 14px;
}

.demo-head span {
    color: #9A6044;
    font-size: 0.75rem;
}

#fog-demo {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.demo-enemy circle {
    fill: #E15E70;
    stroke: #FFF4E8;
    stroke-width: 2;

    transition: fill 0.16s;
}

.demo-enemy.visible circle {
    fill: #8BDBA5;
}

.demo-enemy text {
    fill: #FFF4E8;
    font-size: 14px;
    text-anchor: middle;
}

.demo-card label {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    margin: 16px 0 8px;
    font-weight: 700;
}

.demo-card input[type="range"] {
    display: block;
    width: 100%;
    accent-color: #F0865D;
}

.demo-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    font-size: 0.83rem;
    color: #6B3F2B;
}

.visible-dot,
.hidden-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.visible-dot {
    background: #8BDBA5;
}

.hidden-dot {
    background: #E15E70;
    margin-left: 10px;
}

/* =========================================
   PATHFINDING ILLUSTRATION
========================================= */

.illustration-placeholder p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #6B3F2B;
}

.path-example {
    background: #202633;
    padding: 18px;
    border-radius: 12px;
}

.path-grid {
    position: relative;
    aspect-ratio: 3 / 2;
    max-height: 270px;

    background-image:
        linear-gradient(#343B49 1px, transparent 1px),
        linear-gradient(90deg, #343B49 1px, transparent 1px);

    background-size: 10% 15%;
    overflow: hidden;
}

.point,
.wall {
    position: absolute;
    z-index: 1;
}

.point {
    width: 30px;
    height: 30px;

    border-radius: 50%;
    display: grid;
    place-items: center;

    font-weight: 700;
    color: #281711;
}

.start {
    left: 7%;
    bottom: 13%;
    background: #E15E70;
}

.goal {
    right: 5%;
    top: 5%;
    background: #8BDBA5;
}

.wall {
    background: #667185;
    border-radius: 3px;
}

.wall-a {
    left: 35%;
    top: 26%;
    height: 65%;
    width: 12%;
}

.wall-b {
    left: 47%;
    top: 26%;
    height: 12%;
    width: 31%;
}

.path-grid svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}


/* ============================
   ENEMY AI & PATHFINDING
============================ */

#ai {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.ai-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.ai-section h4 {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.3rem, 2vw, 1.65rem);
    color: #6B3F2B;
    margin-bottom: 12px;
}

.ai-illustration {
    margin: 0;
    padding: 16px;
    border: 1px solid #C99A79;
    background: #FCE6D8;
    border-radius: 18px;
}

.ai-illustration img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.enemy-showcase {
    width: 100%;
}

.enemy-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.enemy-tab {
    cursor: pointer;
    border: 1px solid #C99A79;
    border-radius: 12px;
    background: #FFF4E8;
    color: #6B3F2B;
    padding: 13px 10px;
    font: 700 0.95rem "Space Grotesk", sans-serif;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.enemy-tab:hover,
.enemy-tab:focus-visible {
    border-color: #F0865D;
}

.enemy-tab.is-active {
    background: #F0865D;
    color: #281711;
    border-color: #F0865D;
}

.enemy-panel {
    padding: 22px;
    border: 1px solid #C99A79;
    border-radius: 18px;
    background: #FFF4E8;
}

.enemy-panel[hidden] {
    display: none;
}

.enemy-panel h5 {
    margin: 0 0 16px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.3rem;
    color: #281711;
}

.enemy-panel .ai-illustration {
    margin-bottom: 18px;
}

.enemy-panel p {
    margin: 0;
    line-height: 1.7;
}

@media (max-width: 600px) {
    #ai {
        gap: 26px;
    }

    .enemy-tab {
        padding: 12px 6px;
        font-size: 0.83rem;
    }

    .enemy-panel {
        padding: 14px;
    }

    .ai-illustration {
        padding: 8px;
    }
}


/* =========================================
   HUD ILLUSTRATION
========================================= */

.hud-example > div {
    display: flex;
    justify-content: space-around;
    gap: 12px;

    padding: 60px 10px;

    background: #202633;
    border-radius: 12px;
}

.hud-example > div span {
    display: grid;
    place-items: center;

    min-width: 56px;
    height: 56px;

    border: 2px solid #F0865D;
    border-radius: 999px;

    font-size: 1.7rem;
    font-weight: 700;
    color: #FFF4E8;
}

/* =========================================
   TEAM & CREDITS
========================================= */

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

.credit {
    padding: 22px;

    background: #FCE6D8;
    border: 1px solid #D9BCA4;
    border-radius: 16px;
}

.credit strong,
.credit span {
    display: block;
}

.credit span {
    color: #9A6044;
    margin-top: 6px;
}

.credit p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #6B3F2B;
}

.placeholder-credit {
    border-style: dashed;
}

/* =========================================
   PLAY & RESOURCES
========================================= */

.resource-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.resource-list > div {
    padding: 22px;

    background: #FCE6D8;
    border: 1px solid #D9BCA4;
    border-radius: 16px;
}

.resource-list p {
    color: #6B3F2B;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* =========================================
   FOOTER
========================================= */

.next-project {
    padding-block: 30px 70px;
}

.next-project a {
    font-weight: 700;
    color: #6B3F2B;
}

.project-footer {
    background: #FCE6D8;
    border-top: 1px solid #D9BCA4;
}

.project-footer .section-shell {
    padding-block: 28px;

    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.project-footer a {
    color: #6B3F2B;
    font-weight: 700;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 800px) {

    .project-topbar {
        flex-wrap: wrap;
    }

    .back-link {
        order: 3;
        width: 100%;
    }

    .facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .breakdown {
        grid-template-columns: 1fr;
    }

    .credits,
    .resource-list {
        grid-template-columns: 1fr;
    }

    .project-section {
        padding-block: 48px;
    }
}

@media (max-width: 480px) {

    .project-hero {
        padding-block: 35px 50px;
    }

    .hero-media {
        border-radius: 18px;
    }

    .project-button {
        width: 100%;
    }

    .demo-card,
    .illustration-placeholder {
        padding: 14px;
    }

    .facts {
        gap: 20px;
    }

    .project-topbar .site-logo {
        font-size: 1.25rem;
    }

    .project-section h2 {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .project-button,
    .demo-enemy circle {
        transition: none;
    }
}
