/* -------------- RESET -------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #05080f;
    color: #f4f2f7;
    font-family: "Manrope", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

img {
    display: block;
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ------------- VARIABLES ------------- */

:root {
    --background: #05080f;
    --surface: #080d16;
    --surface-light: #0d1320;
    --border: rgba(255, 255, 255, 0.12);
    --border-light: rgba(255, 255, 255, 0.2);
    --text: #d5d3e5;
    --text-muted: #9b9ba7;
    --purple: #8965ff;
    --purple-light: #b38cff;
    --pink: #e78edb;
    --max-width: 1200px;
    --radius: 20px;
}

/* ------------- GLOBAL ------------- */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(
            circle at 70% 15%,
            rgba(93, 54, 190, 0.12),
            transparent 30%
        ),
        radial-gradient(
            circle at 20% 60%,
            rgba(66, 72, 145, 0.08),
            transparent 30%
        );
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.4) 1px,
            transparent 1px
        );
    background-size: 120px 120px;
    opacity: 0.08;
    pointer-events: none;
    z-index: -1;
}

p {
    letter-spacing: 0.03em;
}

.inline-link {
    color: var(--purple-light);
    font-weight: 500;
    transition:
        color 0.3s ease,
        opacity 0.3s ease;
}

/* ------------- HEADER ------------- */

.site-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 22px;
    text-decoration: none;
}

.logo {
    color: #ffffff;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.08em;
    transition: color 0.3s ease;
}

.brand-name {
    color: #dedde5;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1;
    transition:
        color 0.3s ease,
        opacity 0.3s ease;
}

.brand:hover .logo,
.brand:hover .brand-name {
    color: var(--purple-light);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

.main-nav a {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #dedde5;
    transition:
        color 0.3s ease,
        opacity 0.3s ease;
}

.main-nav a:hover {
    color: var(--purple-light);
}

/* ------------- HOME HERO ------------- */

.hero {
    min-height: 680px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 32px 75px;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(400px, 1fr);
    align-items: center;
    gap: 50px;
}

.hero-content {
    max-width: 570px;
}

.hero h1 {
    margin-bottom: 20px;
    font-size: clamp(48px, 5vw, 76px);
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -0.055em;
    overflow: visible;
}

.hero h1 .gradient1 {
    background:
        linear-gradient(
            90deg,
            #8a7ff0,
            #bf87ec
        );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero h1 .plus-sign {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

.hero h1 .gradient2 {
    background:
        linear-gradient(
            90deg,
            #c076e7,
            #ea8ea5
        );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-description {
    max-width: 500px;
    margin-bottom: 34px;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.75;
}

/* ------------- ARROW ------------- */

.arrow {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    background-image: url("../images/arrow.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.arrow-small {
    width: 10px;
    height: 10px;
}

a:hover .arrow {
    transform: translate(3px, -3px);
}

/* ------------- BUTTONS ------------- */

.button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background:
        linear-gradient(
            135deg,
            #6842df,
            #8957f4
        );
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.button .arrow {
    width: 13px;
    height: 13px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 35px
        rgba(125, 76, 255, 0.25);
}

/* ------------- 3D VISUAL ------------- */

.hero-visual {
    position: relative;
    width: 100%;
    max-width: 500px;
    justify-self: end;
}

.model-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: transparent;
    overflow: hidden;
}

#gameboy-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#gameboy-canvas:active {
    cursor: grabbing;
}

.learning-badge {
    position: absolute;
    right: -18px;
    top: 80px;
    padding: 14px 18px;
    background: rgba(17, 18, 25, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
    z-index: 2;
}

.learning-badge strong {
    color: white;
    font-weight: 500;
}

/* ------------- CONTENT SECTIONS ------------- */

.content-section {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 70px 32px;
}

.section-heading {
    margin-bottom: 26px;
}

.section-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--purple-light);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.section-description {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ------------- FEATURED WORK ------------- */

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

.featured-card {
    background: #1d1b27;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
}

.featured-image {
    width: 100%;
    height: 275px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-card:hover .featured-image img {
    transform: scale(1.025);
}

.featured-content {
    padding: 26px 30px 24px;
}

.featured-content h2 {
    margin-bottom: 12px;
    color: #f4f2f7;
    font-size: 31px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.05em;
}

.featured-content p {
    margin-bottom: 26px;
    color: #c0bdc7;
    font-size: 14px;
    line-height: 1.6;
}

.featured-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: var(--purple-light);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
}

/* ------------- HOME PLAYGROUND ------------- */

.playground-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: 230px;
    gap: 12px;
}

.playground-card {
    position: relative;
    grid-column: span 2;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
}

.playground-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
}

.playground-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.playground-card:hover img {
    transform: scale(1.035);
}

.playground-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 100px 18px 16px;
    background:
        linear-gradient(
            to top,
            rgba(3, 4, 9, 0.98) 0%,
            rgba(3, 4, 9, 0.95) 15%,
            rgba(3, 4, 9, 0.88) 30%,
            rgba(3, 4, 9, 0.76) 45%,
            rgba(3, 4, 9, 0.60) 58%,
            rgba(3, 4, 9, 0.42) 70%,
            rgba(3, 4, 9, 0.26) 80%,
            rgba(3, 4, 9, 0.13) 89%,
            rgba(3, 4, 9, 0.05) 95%,
            rgba(3, 4, 9, 0) 100%
        );
}

.playground-type {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1px;
    color: var(--purple-light);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.06em;
    transform: translateY(-2px);
}

.playground-type .arrow {
    width: 10px;
    height: 10px;
}

.playground-overlay p {
    color: #f4f2f7;
    font-size: 14px;
    line-height: 1.2;
}

.playground-01 {
    grid-column: 1 / span 2;
    grid-row: 1;
}

.playground-02 {
    grid-column: 3 / span 2;
    grid-row: 1;
}

.playground-03 {
    grid-column: 5 / span 2;
    grid-row: 1;
}

.playground-06 {
    grid-column: 7 / span 2;
    grid-row: 1 / span 2;
}

.playground-04 {
    grid-column: 1 / span 3;
    grid-row: 2;
}

.playground-05 {
    grid-column: 4 / span 3;
    grid-row: 2;
}

.playground-07 {
    grid-column: 1 / span 2;
    grid-row: 3 / span 2;
}

.playground-08 {
    grid-column: 3 / span 2;
    grid-row: 3 / span 2;
}

.playground-09 {
    grid-column: 5 / span 2;
    grid-row: 3;
}

.playground-10 {
    grid-column: 7 / span 2;
    grid-row: 3;
}

.playground-11 {
    grid-column: 5 / span 2;
    grid-row: 4;
}

.playground-12 {
    grid-column: 7 / span 2;
    grid-row: 4;
}

/* ------------- ABOUT ------------- */

.about-section {
    padding-bottom: 120px;
}

.about-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.15fr;
    gap: 16px;
    align-items: stretch;
}

.about-copy {
    position: relative;
    min-height: 400px;
    padding: 38px 36px;
    background: #211f2b;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
    color: inherit;
    text-decoration: none;
}

.about-copy:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
}

.about-copy h2 {
    max-width: 420px;
    margin-bottom: 18px;
    color: #f4f2f7;
    font-size: 31px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.05em;
}

.about-copy p {
    max-width: 430px;
    margin-bottom: 60px;
    color: #c0bdc7;
    font-size: 14px;
    line-height: 1.6;
}

.about-link {
    position: absolute;
    right: 36px;
    bottom: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--purple-light);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.about-visual {
    position: relative;
    height: 400px;
    border-radius: var(--radius);
}

.about-visual > img {
    width: 82%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

.about-badge {
    position: absolute;
    right: 0;
    top: 50%;
    width: 260px;
    padding: 24px;
    background: rgba(31, 30, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: #d3d0d9;
    font-size: 14px;
    line-height: 1.45;
}

.about-badge div {
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 10px;
    align-items: start;
}

.about-badge img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

.about-badge span {
    color: var(--text);
    letter-spacing: 0.03em;
}

/* ------------- FOOTER ------------- */

.site-footer {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 32px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #777783;
    font-size: 10px;
}

.site-footer p {
    color: var(--text-muted);
}

.social-links {
    display: flex;
    align-items: center;
    gap: 14px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.social-links img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

.social-links a:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

/* ------------- BACK TO TOP ------------- */

.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 54px;
    height: 54px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    cursor: pointer;
    z-index: 1000;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease;
}

.back-to-top img {
    width: 100%;
    height: 100%;
    display: block;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-2px);
}

/* ------------- SHARED PROJECT PAGE ------------- */

.case-study {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 50px 32px 80px;
}

.case-study-section {
    margin-bottom: 85px;
}

.case-study-copy {
    max-width: 690px;
}

.case-study-copy p {
    margin-bottom: 18px;
    color: #c0bdc7;
    font-size: 14px;
    line-height: 1.7;
}

.case-study-copy p:last-child {
    margin-bottom: 0;
}

.case-study-heading {
    margin-bottom: 18px;
}

.case-study-heading h2 {
    margin-bottom: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.03em;
}

.case-study-accent {
    display: block;
    width: 62px;
    height: 2px;
    margin-bottom: 12px;
    background: var(--purple-light);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.9s ease;
}

.case-study-accent-red {
    background: #d8636b;
}

.case-study-accent-yellow {
    background: #f2d459;
}

.case-study-accent-cyan {
    background: #92d8e6;
}

.case-study-accent-blue {
    background: #67a5d3;
}

.case-study-next {
    margin-top: 130px;
    margin-bottom: 60px;
}

.case-study-next-label {
    margin-bottom: 14px;
    color: var(--purple-light);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.next-project-card {
    display: block;
    width: 360px;
    overflow: hidden;
    background: #211f2b;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
}

.next-project-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
}

.next-project-card > img {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.next-project-content {
    padding: 22px;
}

.next-project-content h3 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
}

.next-project-content p {
    margin-bottom: 20px;
    color: #c0bdc7;
    font-size: 14px;
    line-height: 1.6;
}

.next-project-link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: var(--purple-light);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
}

/* ------------- PROJECT NAVIGATION ------------- */

.project-navigation {
    display: flex;
    justify-content: flex-end;
    margin-top: 130px;
    margin-bottom: 60px;
}

.project-navigation-item {
    width: 360px;
}

.project-navigation-label {
    margin-bottom: 14px;
    color: var(--purple-light);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-align: left;
}

/* ------------- SCROLL ANIMATIONS ------------- */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 1s ease,
        transform 1s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 {
    transition-delay: 0.12s;
}

.reveal-delay-2 {
    transition-delay: 0.24s;
}

.reveal-delay-3 {
    transition-delay: 0.36s;
}

.reveal-scale {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition:
        opacity 1.1s ease,
        transform 1.1s ease;
}

.reveal-scale.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.case-study-heading.visible .case-study-accent {
    transform: scaleX(1);
}

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

    .reveal,
    .reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .case-study-accent {
        transform: none;
        transition: none;
    }
}

/* ------------- RESPONSIVENESS ------------- */

@media (max-width: 900px) {

    .hero {
        grid-template-columns: 1fr;
        padding-top: 50px;
        gap: 50px;
    }

    .hero-visual {
        justify-self: center;
        width: min(100%, 500px);
    }

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

    .playground-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 210px;
    }

    .playground-card {
        grid-column: auto;
        grid-row: auto;
    }

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

    .about-copy {
        min-height: 400px;
    }

    .about-visual {
        height: 400px;
        min-height: 0;
    }

    .about-visual > img {
        width: 100%;
        height: 100%;
    }

    .about-badge {
        right: 24px;
        width: 260px;
    }

    .case-study {
        padding-top: 40px;
    }

    .next-project-card {
        width: 100%;
        max-width: 420px;
    }
}

@media (max-width: 600px) {

    .site-header {
        height: 70px;
        padding: 0 20px;
    }

    .main-nav {
        gap: 15px;
    }

    .main-nav a {
        font-size: 9px;
    }

    .hero {
        padding: 50px 20px 70px;
    }

    .hero h1 {
        font-size: 46px;
    }

    .content-section {
        padding: 55px 20px;
    }

    .playground-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 240px;
    }

    .featured-content h2 {
        font-size: 20px;
    }

    .about-copy {
        min-height: 390px;
        padding: 28px 24px;
    }

    .about-visual {
        min-height: 430px;
    }

    .about-visual > img {
        width: 100%;
        height: 340px;
    }

    .about-badge {
        left: 20px;
        right: 20px;
        top: auto;
        bottom: 0;
        width: auto;
        transform: none;
    }

    .site-footer {
        padding: 25px 20px 35px;
    }

    .case-study {
        padding: 35px 20px 60px;
    }

    .case-study-section {
        margin-bottom: 65px;
    }

    .case-study-copy {
        max-width: 100%;
    }

    .case-study-heading h2 {
        font-size: 20px;
    }

    .case-study-next {
        margin-top: 90px;
    }

    .next-project-card {
        width: 100%;
    }

        .project-navigation {
        margin-top: 90px;
    }

    .project-navigation-item {
        width: 100%;
    }

    .project-navigation .next-project-card {
        width: 100%;
        max-width: none;
    }
}