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

html {
    scroll-behavior: smooth;
}

body {
    background: #ffffff;
    font-family: "Helvetica Neue", Arial, sans-serif;
    color: #111;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* =========================
   HEADER
========================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease, background 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

header.show {
    transform: translateY(0);
}

.logo {
    color: #111111;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .12em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 12px;
}

nav a {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px 24px;

    background: #00CFB6;
    color: #ffffff;

    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .05em;

    border-radius: 9999px;

    box-shadow:
        0 6px 20px rgba(0, 207, 182, .35);

    transition: .25s;
}

nav a:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 28px rgba(0, 207, 182, .45);
}

/* =========================
   HERO VIDEO
========================= */
.video-container {
    position: relative;
    width: 100%;
}

.video-container video {
    width: 100%;
    display: block;
}

/* =========================
   HERO TITLE
========================= */
.video-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.video-title .en {
    color: #ffffff;
    font-size: clamp(14px, 1.5vw, 22px);
    letter-spacing: .4em;
    margin-bottom: 12px;

    text-shadow:
        0 0 10px rgba(0, 0, 0, .6);
}

.video-title .jp {
    color: #ffffff;
    font-size: clamp(42px, 8vw, 96px);
    font-weight: 700;
    letter-spacing: .2em;

    text-shadow:
        0 0 10px rgba(0, 0, 0, .6),
        0 0 30px rgba(0, 0, 0, .4);
}

/* =========================
   SECTION
========================= */
.section {
    padding: 100px 30px;
}

.section-title {
    text-align: center;
    font-size: clamp(36px, 5vw, 60px);
    letter-spacing: .15em;
    font-weight: 700;
    margin-bottom: 40px;
}

/* =========================
   FILTER BUTTONS
========================= */
.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 60px;
}

.filter-btn {
    border: none;
    cursor: pointer;

    padding: 12px 24px;

    border-radius: 9999px;

    background: #ececec;
    color: #555;

    font-weight: 700;

    transition: .25s;
}

.filter-btn.active {
    background: #00CFB6;
    color: #fff;
}

.filter-btn:hover {
    transform: translateY(-2px);
}

/* =========================
   WORKS GRID
========================= */
.works-grid {
    max-width: 1120px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.work-card {
    position: relative;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .08);

    transition: .25s, opacity .3s ease, transform .3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.work-card.visible {
    opacity: 1;
    transform: none;
}

.work-card:hover {
    transform: translateY(-5px);
}

.work-card img,
.work-card video {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
    transition: .4s;
}

.work-card:hover img,
.work-card:hover video {
    transform: scale(1.03);
}

.work-info {
    padding: 24px;
}

.work-info h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.work-category {
    display: inline-block;

    padding: 8px 14px;

    background: #00CFB6;
    color: #fff;

    border-radius: 9999px;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
}

/* =========================
   PROFILE
========================= */
.profile-wrap {
    max-width: 1100px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
}

.profile-image {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .12);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-text {
    max-width: 600px;
    color: #555;
    line-height: 1.9;
}

.profile-text h3 {
    font-size: 28px;
    color: #111;
    margin-bottom: 15px;
}

/* =========================
   CONTACT
========================= */
.contact-box {
    text-align: center;
    color: #666;
    font-size: 18px;
}

/* =========================
   RESPONSIVE TABLET BREAKPOINT
========================= */
@media(max-width: 1024px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* =========================
   MOBILE
========================= */
@media(max-width:768px) {

    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        padding: 10px 18px;
        font-size: 13px;
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .profile-wrap {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .profile-image {
        width: 220px;
        height: 220px;
    }

    .section {
        padding: 80px 20px;
    }
}

/* =========================
   CLICKABLE CARD
========================= */
.work-card.clickable-card {
    cursor: pointer;
}

/* =========================
   MODAL
========================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    /* Toggle visibility smoothly */
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0.5s step-end;
}

.modal.active {
    visibility: visible;
    pointer-events: auto;
    transition: visibility 0s;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active .modal-overlay {
    opacity: 1;
}

.modal-content {
    position: relative;
    background: #ffffff;
    max-width: 1000px;
    width: 90%;
    border-radius: 24px;
    overflow: hidden;
    /* hide any overflow, no scrollbars */
    z-index: 2010;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(40px) scale(0.95);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    max-height: 100vh;
    /* fit viewport */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    /* leave little margin from viewport edges */
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 24px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    z-index: 2020;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.modal-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    /* take remaining vertical space */
    overflow: hidden;
    /* no scrollbars */
    position: relative;
}

.modal-image-container img,
.modal-image-container video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

.modal-image-container iframe {
    max-width: 100%;
    width: 100%;
    height: calc(95vh - 120px);
    /* fill modal vertical space */
    /* aspect ratio handled in JS */
}

.modal-details {
    padding: 24px 30px 30px;
    max-height: 35vh;
    /* ensure title/desc never exceed this */
    overflow-y: hidden;
    /* keep hidden for larger screens */
    /* inner overflow will be handled by content auto‑wrap */
}

@media (max-width: 768px) {
    .modal-details {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Hide scrollbars just in case */
.modal-details::-webkit-scrollbar {
    display: none;
}

.modal-details {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-details h3 {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(15px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    transition-delay: 0.15s;
}

.modal.active .modal-details h3 {
    opacity: 1;
    transform: translateY(0);
}

.modal-details p {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    opacity: 0;
    transform: translateY(15px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    transition-delay: 0.25s;
    margin-top: 12px;
    /* ensure spacing */
}

.modal.active .modal-details p {
    opacity: 1;
    transform: translateY(0);
}

/* =========================
   MODAL TITLE ROW & EXTERNAL LINK
========================= */
.modal-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    /* increased spacing */
}

.modal-title-row h3 {
    margin-bottom: 0;
}

.modal-external-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #00CFB6;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 9999px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 207, 182, 0.35);
    transition: all 0.25s ease;
}

.modal-external-btn:hover {
    background: #00e6cc;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 207, 182, 0.45);
}

/* =========================
   FOOTER
========================= */
footer {
    background: #1a1a1a;
    color: #ffffff;
    padding: 40px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content .copyright {
    font-size: 14px;
    color: #888888;
    letter-spacing: 0.05em;
}

.footer-x-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #00CFB6;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 207, 182, 0.35);
    transition: all 0.25s ease;
}

.footer-x-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 207, 182, 0.45);
    background: #00e6cc;
}

.footer-x-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media(max-width:768px) {
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* =========================
   MODAL CAROUSEL
========================= */
.modal-image-container {
    position: relative;
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    font-size: 20px;
    font-weight: bold;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: #111;
    z-index: 2025;
    transition: background-color 0.2s, transform 0.2s, opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-prev:hover,
.modal-next:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Media element switching transitions */
.modal-image-container img,
.modal-image-container video {
    transition: opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1), transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-image-container img.slide-out,
.modal-image-container video.slide-out {
    opacity: 0;
    transform: scale(0.96);
}

.modal-image-container img.slide-in,
.modal-image-container video.slide-in {
    opacity: 0;
    transform: scale(1.04);
}

/* =========================
   AWARD BADGE
========================= */
.award-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #FFC107;
    color: #111111;
    font-size: 10px;
    font-weight: 800;
    border-radius: 9999px;
    margin-bottom: 8px;
    letter-spacing: 0.05em;

}

/* =========================
   CONTACT REDESIGN
========================= */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: 16px;
    color: #555555;
    line-height: 1.8;
    margin-bottom: 30px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 36px;
    background: #00CFB6;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    border-radius: 9999px;
    box-shadow: 0 8px 25px rgba(0, 207, 182, 0.35);
    transition: all 0.25s ease;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 207, 182, 0.45);
    background: #00e6cc;
}

.contact-btn svg {
    fill: currentColor;
}