/* ── Base ── */
body {
    margin: 0;
    padding: 0;
    font-family: 'Space Grotesk', sans-serif;
    background-color: #07090f;
    color: #e8e8e8;
    overflow-x: hidden;
}

/* ── Scroll animations ── */
[data-scroll="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease var(--d, 0s), transform 0.7s ease var(--d, 0s);
}

[data-scroll="fade-up"].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Container ── */
.realisations-container {
    padding: 80px 8vw 120px;
    background: #07090f;
    min-height: 100vh;
    position: relative;
}

/* ── Page hero bar ── */
.page-hero-bar {
    margin-bottom: 80px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 48px;
}

.eyebrow-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #5599ff;
    margin-bottom: 1.2rem;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.8rem, 7vw, 6rem);
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1;
}

/* ── Category ── */
.category {
    margin-bottom: 80px;
}

.category-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.35);
    display: block;
    margin-bottom: 36px;
    margin-top: 0;
    position: relative;
}

.category-title::after {
    display: none;
}

.title-reveal {
    overflow: hidden;
    display: block;
}

.title-reveal .title-text-content {
    transition: transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(110%);
    display: inline-block;
}

.category-header[data-scroll].visible .title-reveal .title-text-content {
    transform: translateY(0);
}

/* ── Projects grid ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ── Project card ── */
.project-card {
    display: flex;
    flex-direction: column;
    background: #0d0f18;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    transition: border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.project-card:hover {
    border-color: rgba(85, 153, 255, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.project-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: brightness(0.9);
}

.project-card:hover .project-image {
    transform: scale(1.04);
    filter: brightness(1);
}

/* Overlay reveal on hover */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(7, 9, 15, 0.95) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-info {
    padding: 20px 22px 24px;
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.project-card h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: #ffffff;
    letter-spacing: 0.01em;
    transition: color 0.3s ease;
}

.project-card:hover h2 {
    color: #5599ff;
}

.project-card p {
    font-size: 0.78rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    font-weight: 300;
}

/* Card scroll animation */
.project-card[data-scroll] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.project-card[data-scroll].visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card[data-scroll].visible:hover {
    transform: translateY(-4px);
}

/* ── Modal backdrop ── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Modal content ── */
.modal-content {
    position: relative;
    z-index: 10001;
    background: #0f1118;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.35s cubic-bezier(0.34, 1.1, 0.64, 1) both;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Modal header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 16px;
    flex-shrink: 0;
}

#modalTitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.6);
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

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

/* Modal media */
.modal-media {
    flex-shrink: 0;
    background: #07090f;
}

#modalImage {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

#modalVideo {
    width: 100%;
    height: 420px;
    display: block;
    border: none;
}

/* Description */
#modalDescription {
    font-size: 0.92rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.55);
    padding: 28px 32px 32px;
    margin: 0;
    font-weight: 300;
}

/* ── Swiper (v11) ── */
#modalCarousel {
    width: 100%;
    position: relative;
}

#modalCarousel .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #07090f;
}

#modalCarousel .swiper-slide img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

#modalCarousel .swiper-button-prev,
#modalCarousel .swiper-button-next {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.25s ease;
}

#modalCarousel .swiper-button-prev:hover,
#modalCarousel .swiper-button-next:hover {
    background: rgba(85, 153, 255, 0.3);
    border-color: rgba(85, 153, 255, 0.5);
}

#modalCarousel .swiper-button-prev::after,
#modalCarousel .swiper-button-next::after {
    font-size: 0.85rem;
    font-weight: 700;
}

#modalCarousel .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

#modalCarousel .swiper-pagination-bullet-active {
    background: #5599ff;
}

/* ── Theme light ── */
body.light {
    background-color: #f4f4f8;
    color: #111;
}

body.light .realisations-container { background-color: #f4f4f8; }
body.light .page-hero-bar { border-bottom-color: rgba(0,0,0,0.08); }
body.light .eyebrow-label { color: #2266dd; }
body.light .page-title { color: #0a0a0f; }
body.light .category-title { color: rgba(0,0,0,0.3); }

body.light .project-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
body.light .project-card:hover {
    border-color: rgba(34,102,221,0.35);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

body.light .project-card .project-overlay {
    background: linear-gradient(to bottom, transparent 40%, rgba(240, 240, 248, 0.92) 100%);
}

body.light .project-card:hover h2 { color: #2266dd; }
body.light .project-info { border-top-color: rgba(0,0,0,0.07); }
body.light .project-card h2 { color: #0a0a0f; }
body.light .project-card:hover h2 { color: #2266dd; }
body.light .project-card p { color: rgba(0,0,0,0.45); }

body.light .modal-backdrop { background: rgba(0,0,0,0.5); }
body.light .modal-content { background: #ffffff; border-color: rgba(0,0,0,0.08); }
body.light .modal-header { border-bottom-color: rgba(0,0,0,0.07); }
body.light #modalTitle { color: #0a0a0f; }
body.light .modal-close { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: rgba(0,0,0,0.5); }
body.light .modal-close:hover { background: rgba(0,0,0,0.08); color: #0a0a0f; }
body.light .modal-media { background: #f0f0f4; }
body.light #modalDescription { color: rgba(0,0,0,0.55); }

/* ── Responsive ── */
@media screen and (max-width: 1200px) {
    .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

@media screen and (max-width: 900px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .modal-content { max-width: 100%; }
    #modalVideo, #modalImage, #modalCarousel .swiper-slide img { max-height: 320px; }
    #modalVideo { height: 320px; }
}

@media screen and (max-width: 600px) {
    .realisations-container { padding: 60px 6vw 80px; }
    .projects-grid { grid-template-columns: 1fr; gap: 14px; }
    .page-hero-bar { margin-bottom: 48px; }
    .modal-header { padding: 20px 20px 16px; }
    #modalDescription { padding: 20px 20px 24px; }
    #modalVideo { height: 240px; }
}
