/* Global Reset & Layout */
body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Disable native scroll */
    background-color: #fcfcfc;
    /* Light background */
    color: #333;

    /* Hide scrollbars */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* Container to enforce viewport size */
#main-container {
    width: 100%;
    height: calc(100% - var(--header-height, 80px));
    position: absolute;
    top: var(--header-height, 80px);
    left: 0;
    overflow: hidden;
    background-color: #fcfcfc;
}

/* Full Screen Section */
.kamos-fullscreen-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), filter 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
    filter: blur(20px);
    z-index: 1;
    background-size: cover;
    background-position: center;
    overflow-x: hidden;
    overflow-y: auto;
    transform: scale(1.1);
}

.kamos-fullscreen-section.active {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    z-index: 10;
    transform: scale(1);
}

/* --- Content Entry Animations --- */
/* Initial State: Hidden and shifted down */
.kamos-fullscreen-section .bio-text,
.kamos-fullscreen-section .bio-image,
.kamos-fullscreen-section .service-image-container,
.kamos-fullscreen-section .service-content-container,
.kamos-fullscreen-section .profile-image-container,
.kamos-fullscreen-section .profile-content-container,
.kamos-fullscreen-section .gallery-container,
.kamos-fullscreen-section .matrix-container,
.kamos-fullscreen-section .scenario-container {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Active State: Reveal */
/* Only reveal when the section also has 'content-visible' class */
.kamos-fullscreen-section.active.content-visible .bio-text,
.kamos-fullscreen-section.active.content-visible .bio-image,
.kamos-fullscreen-section.active.content-visible .service-image-container,
.kamos-fullscreen-section.active.content-visible .service-content-container,
.kamos-fullscreen-section.active.content-visible .profile-image-container,
.kamos-fullscreen-section.active.content-visible .profile-content-container,
.kamos-fullscreen-section.active.content-visible .gallery-container,
.kamos-fullscreen-section.active.content-visible .matrix-container,
.kamos-fullscreen-section.active.content-visible .scenario-container {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delays to sync with Blob Reveal */
/* Staggered Delays to sync with Blob Reveal */
/* Reset delays to work with the new trigger class */
.kamos-fullscreen-section.active.content-visible .bio-image,
.kamos-fullscreen-section.active.content-visible .service-image-container,
.kamos-fullscreen-section.active.content-visible .profile-image-container {
    transition-delay: 0.2s;
    /* Start slightly after the blob starts uncovering */
}

.kamos-fullscreen-section.active.content-visible .bio-text,
.kamos-fullscreen-section.active.content-visible .service-content-container,
.kamos-fullscreen-section.active.content-visible .profile-content-container,
.kamos-fullscreen-section.active.content-visible .gallery-container,
/* Full containers */
.kamos-fullscreen-section.active.content-visible .matrix-container,
.kamos-fullscreen-section.active.content-visible .scenario-container {
    transition-delay: 0.4s;
    /* Follow up elements */
}

/* Hero Section Specifics */
#section-0 {
    background-color: #fcfcfc;
    background-image: url('/kosukekato/img/hero.png');
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Section Backgrounds */
#section-1 {
    background-image: url('/kosukekato/img/section-pax-japonica.png');
}

#section-2 {
    background-image: url('/kosukekato/img/section-1.png');
}

#section-3 {
    background-image: url('/kosukekato/img/section-kamos.png');
}

#section-4 {
    background-image: url('/kosukekato/img/section-2.png');
}

#section-5 {
    background-image: url('/kosukekato/img/section-3.png');
}

#section-6 {
    background-image: url('/kosukekato/img/section-4.png');
}

/* Biomorphic Layout Styles */
.bio-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.bio-image {
    position: absolute;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    transition: transform 0.5s ease;
}

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

.bio-image:hover {
    transform: scale(1.02);
}

.bio-text {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 3rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bio-text h2 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.bio-text .subtitle {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #666;
}

.bio-text .description {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    color: #333;
}

/* Specific Shapes and Positions */

/* Section 1 (New): Pax Japonica */
.shape-img-pax {
    width: 30%;
    height: auto;
    border-radius: 24px;
    left: 10%;
    top: 25%;
    cursor: zoom-in;
}

.shape-text-pax {
    width: 48%;
    border-radius: 61% 39% 51% 49% / 54% 31% 69% 46%;
    right: 5%;
    top: 25%;
    padding: 7rem;
}

/* Section 2: Generative Thinking */
.shape-img-1 {
    width: 30%;
    height: auto;
    border-radius: 24px;
    left: 10%;
    top: 30%;
    cursor: zoom-in;
}

.shape-text-1 {
    width: 45%;
    border-radius: 41% 59% 41% 59% / 44% 31% 69% 56%;
    right: 5%;
    top: 20%;
    padding: 7rem;
}

/* Section 3: Kamos Framework Analysis */
.shape-img-kamos {
    width: 30%;
    height: auto;
    border-radius: 24px;
    right: 10%;
    top: 20%;
    cursor: zoom-in;
}

.shape-text-kamos {
    width: 45%;
    border-radius: 68% 32% 64% 36% / 44% 47% 53% 56%;
    left: 5%;
    top: 18%;
    padding: 7rem;
}

/* Section 4: Define, Design & Develop */
.shape-img-2 {
    width: 30%;
    height: auto;
    border-radius: 24px;
    right: 10%;
    top: 20%;
    cursor: zoom-in;
}

.shape-text-2 {
    width: 45%;
    border-radius: 68% 32% 64% 36% / 44% 47% 53% 56%;
    left: 5%;
    top: 18%;
    padding: 7rem;
}

/* Section 5: Analyze & Plan */
.shape-img-3 {
    width: 30%;
    height: auto;
    border-radius: 24px;
    left: 10%;
    bottom: 20%;
    cursor: zoom-in;
}

.shape-text-3 {
    width: 48%;
    border-radius: 35% 65% 35% 65% / 60% 40% 60% 40%;
    right: 5%;
    top: 15%;
    padding: 7rem;
}

/* Section 6: Roadmap & Prototype */
.shape-img-4 {
    width: 30%;
    height: auto;
    border-radius: 24px;
    right: 10%;
    bottom: 20%;
    cursor: zoom-in;
}

.shape-text-4 {
    width: 45%;
    border-radius: 44% 56% 36% 64% / 60% 35% 65% 40%;
    left: 5%;
    top: 15%;
    padding: 7rem;
}

/* Profile Section Styles */
.profile-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.profile-image-container {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-img {
    width: 65%;
    height: auto;
    object-fit: contain;
    /* Random feel: slight rotation and offset */
    transform: rotate(-3deg) translateY(-20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    max-width: 500px;
}

.profile-content-container {
    flex: 1;
    height: 100%;
    padding: 4rem 4rem;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Hide scrollbar for aesthetics but allow scroll */
    scrollbar-width: thin;
}

.profile-header {
    margin-bottom: 3rem;
}

.profile-logo {
    width: 150px;
    height: auto;
    display: block;
}

.profile-text-body p {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    line-height: 2;
    color: #333;
    margin-bottom: 0.5rem;
}

.profile-text-body .greeting {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.profile-text-body .name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.profile-text-body .tagline {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    color: #1a1a1a;
}

/* LightBox Styles */
.kamos-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.kamos-lightbox.active {
    opacity: 1 !important;
    pointer-events: auto;
}

.kamos-lightbox-content {
    position: relative;
    max-width: 85%;
    max-height: 85%;
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.5s ease;
    border-radius: 16px;
    overflow: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 1.25rem 1.5rem 1.5rem;
    gap: 0.75rem;
}

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

.kamos-lightbox img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 65vh;
    display: block;
    border-radius: 16px;
}

.kamos-lightbox-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kamos-lightbox-comment {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
    min-height: 48px;
    box-sizing: border-box;
}

.kamos-tag-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kamos-tag-chip {
    background: #eef2ff;
    border: 1px solid #d7dcff;
    color: #3b3f8f;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kamos-tag-chip:hover {
    background: #dfe5ff;
    border-color: #cbd4ff;
}

.kamos-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    color: #111;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    opacity: 0.85;
}

.kamos-lightbox-nav:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.95);
    opacity: 1;
}

.kamos-lightbox-nav:active {
    transform: translateY(-50%) scale(0.98);
}

#kamos-lightbox-prev {
    left: 12px;
}

#kamos-lightbox-next {
    right: 12px;
}

@media (max-width: 640px) {
    .kamos-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        background: rgba(255, 255, 255, 0.92);
    }

    #kamos-lightbox-prev {
        left: 6px;
    }

    #kamos-lightbox-next {
        right: 6px;
    }
}

.kamos-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
    z-index: 10000;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.kamos-lightbox-close:hover {
    opacity: 1;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    .bio-image {
        position: relative;
        width: 90% !important;
        height: auto !important;
        margin: 2rem auto 0;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }

    .bio-image img {
        height: auto !important;
        max-height: 50vh;
        object-fit: contain;
    }

    .bio-text {
        position: relative;
        width: 90% !important;
        margin: 1rem auto 2rem;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        border-radius: 24px !important;
        /* Reset fancy shapes for mobile readability */
        padding: 2rem;
    }

    .bio-container {
        overflow-y: auto;
        /* Allow internal scrolling on mobile */
    }

    /* Profile Mobile */
    .profile-container {
        flex-direction: column;
    }

    .profile-image-container {
        height: 40vh;
        /* Fixed height for image area on mobile */
        width: 100%;
        padding-top: 60px;
        /* Header space */
    }

    .profile-img {
        width: 80%;
        /* Larger on mobile relative to container */
        transform: rotate(-2deg);
        /* Subtle rotation */
    }

    .profile-content-container {
        height: 60%;
        width: 100%;
        padding: 2rem;
    }

    /* Matrix Mobile - Force Single Column */
    .matrix-viz-container,
    .matrix-grid-view {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }
}

/* Blob Container - STRICT 400x400 Size */
.hero-blob-container {
    width: 400px;
    height: 400px;
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    z-index: 5;
    pointer-events: none;
}

.hero-blob-text {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    /* Dark text for blobs on white */
    z-index: 10;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    letter-spacing: 0.05em;
}

/* Gallery Section Styles */
.gallery-container {
    width: 100%;
    max-width: 1200px;
    /* Limit width */
    margin: 0 auto;
    /* Center */
    height: 100%;
    padding: 4rem 4rem;
    /* Match profile padding */
    overflow-y: auto;
    scrollbar-width: thin;
}

.gallery-category {
    margin-bottom: 5rem;
}

.gallery-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Responsive grid */
    gap: 3rem;
    /* Space for offsets */
    padding: 1rem;
}

.gallery-item-wrapper {
    position: relative;
}

.gallery-item {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    cursor: zoom-in;
    background: #fff;
    display: block;
}

.gallery-item:hover {
    z-index: 20;
    transform: scale(1.1) rotate(0deg) translate(0, 0) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Matrix Section Styles */
.matrix-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 4rem 4rem;
    overflow-y: auto;
    scrollbar-width: thin;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.matrix-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

.matrix-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.matrix-card-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

.matrix-card-desc {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    flex-grow: 1;
    /* Limit to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.matrix-card-icon {
    align-self: flex-end;
    margin-top: 1rem;
    color: #ccc;
}

/* Matrix Modal Styles */
.kamos-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
}

#tag-modal {
    z-index: 10001;
}

.kamos-modal.active {
    opacity: 1 !important;
    pointer-events: auto;
}

.kamos-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 85%;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

.kamos-modal.active .kamos-modal-content {
    transform: scale(1);
}

.kamos-modal-header {
    padding: 2rem 3rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kamos-modal-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.kamos-modal-close {
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.kamos-modal-close:hover {
    color: #333;
}

.kamos-modal-body {
    padding: 3rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.tag-modal-grid {
    display: grid;
    width: 100%;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    flex: 1;
}

.tag-modal-card {
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.tag-modal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

.tag-modal-thumb {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #f7f7f7;
}

.tag-modal-body-content {
    padding: 0.9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tag-modal-title {
    font-weight: 700;
    font-size: 1rem;
}

.tag-modal-type {
    font-size: 0.85rem;
    color: #666;
}

.tag-modal-comment {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

/* The Matrix Visualization */
.matrix-viz-container {
    display: grid;
    width: 100%;
    gap: 1rem;
}

.matrix-meta-bar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.matrix-meta-comment {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: #333;
    line-height: 1.5;
}

.matrix-card-tags {
    margin-top: 0.35rem;
}

.matrix-quadrant {
    background: #fcfcfc;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    max-height: 100%;
    overflow: hidden;
}

.matrix-quadrant:hover {
    transform: scale(1.01);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    z-index: 5;
}

.matrix-q-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.matrix-q-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.matrix-q-list li {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #555;
    position: relative;
    padding-left: 1rem;
}

.matrix-q-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #999;
}

/* Axis Labels */
.matrix-axis-label {
    position: absolute;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.9rem;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.axis-top {
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.axis-bottom {
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.axis-left {
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.axis-right {
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

/* Ensure header stays on top */
#main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Nav Menu Overlay */
.kamos-nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding-top: 80px;
    /* Ensure content starts below the close button */
}

.kamos-nav-menu.active {
    opacity: 1;
    pointer-events: auto;
}

.kamos-nav-close {
    position: fixed;
    top: 20px;
    right: 30px;
    cursor: pointer;
    color: #333;
    padding: 10px;
}

.kamos-nav-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 80px;
    /* Keep bottom padding, top handled by parent */
    width: 100%;
}

.kamos-nav-list a {
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    margin: 1rem 0;
    transition: color 0.3s;
    text-align: center;
}

.kamos-nav-list a:hover {
    color: #999;
}

/* Scenario Section Styles */
.scenario-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 0 2rem 4rem 2rem;
    /* Consistent padding */
}

.scenario-header-container {
    padding-top: 2rem;
    padding-bottom: 1rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scenario-tabs {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.scenario-about {
    margin-bottom: 3rem;
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.scenario-card {
    background-color: #fff;
    border: 1px solid #eef0f5;
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease;
    min-height: 180px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.scenario-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: #e0e5ef;
}

.scenario-card .material-symbols-outlined {
    font-size: 3.5rem;
    color: #444;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.scenario-card:hover .material-symbols-outlined {
    color: #000;
}

.scenario-card div {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

/* Markdown Content Styling (Shared) */
.markdown-body {
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
    line-height: 1.8;
    font-size: 0.95rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    font-family: 'Josefin Sans', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: #1a1a1a;
}

.markdown-body h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.markdown-body h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.4rem;
}

.markdown-body h3 {
    font-size: 1.25rem;
}

.markdown-body h4 {
    font-size: 1.1rem;
    border-left: 4px solid #333;
    padding-left: 10px;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.4rem;
}

.markdown-body strong {
    font-weight: 700;
    color: #000;
}

.markdown-body blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid #ddd;
    background-color: #f9f9f9;
    color: #666;
}

.markdown-body code {
    background-color: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background-color: #f6f8fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-body a {
    color: #0366d6;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

/* Modal Content for Scenario */
#scenario-modal-body img {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Service Section Styles (Mirrored Profile) */
.service-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
    flex-direction: row-reverse;
    /* Desktop: Content Left, Image Right (due to swapping children or order) */
    /* Wait, if I use row-reverse:
       DOM: [Image, Content] -> Visual: [Content, Image]
       If I want Left: Content, Right: Image.
       Profile DOM: [Image, Content] -> Visual: [Image, Content] (row)
       Service DOM: [Image, Content] -> Visual: [Content, Image] (row-reverse)
       Mobile Profile: flex-direction: column -> [Image, Content]
       Mobile Service: flex-direction: column -> [Image, Content] (Image on top)
       This matches the plan.
    */
}

.service-image-container {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
    /* Gray background */
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-img {
    width: 65%;
    height: auto;
    object-fit: contain;
    /* Mirrored rotation for symmetry */
    transform: rotate(3deg) translateY(-20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    max-width: 500px;
}

.service-content-container {
    flex: 1;
    height: 100%;
    padding: 4rem 4rem;
    overflow-y: auto;
    background: #fff;
    /* White background */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align content to top */
    /* Hide scrollbar for aesthetics but allow scroll */
    scrollbar-width: thin;
}

.service-header {
    margin-bottom: 3rem;
}

.service-text-body p {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    line-height: 2;
    color: #333;
    margin-bottom: 1.5rem;
}

/* Service Mobile */
@media (max-width: 640px) {
    .service-container {
        flex-direction: column;
    }

    .service-image-container {
        height: 40vh;
        width: 100%;
        padding-top: 60px;
    }

    .service-img {
        width: 80%;
        transform: rotate(2deg);
    }

    .service-content-container {
        height: 60%;
        width: 100%;
        padding: 2rem;
    }
}

.service-img {
    cursor: zoom-in;
}

/* Vertical Copyright Text */
.kamos-copyright-vertical {
    position: fixed;
    top: 50%;
    left: 10px;
    transform: translateY(-50%) rotate(180deg);
    /* Rotate for correct reading direction (bottom-to-top or top-to-bottom depending on preference, usually vertical-rl is top-to-bottom) */
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 10px;
    color: #666;
    background-color: #eee;
    padding: 20px 6px;
    border-radius: 4px;
    z-index: 90;
    letter-spacing: 0.1em;
    white-space: nowrap;
    opacity: 0.8;
}

/* Contact Button */
.kamos-contact-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #1a1a1a;
    color: #fff !important;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 100;
    letter-spacing: 0.05em;
}

.kamos-contact-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background-color: #000;
}

@media (max-width: 640px) {
    .kamos-copyright-vertical {
        display: none;
        /* Hide copyright on mobile to save space */
    }

    .kamos-contact-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 24px;
        font-size: 0.85rem;
    }
}

/* Ensure Header Visibility on Tablets and Desktop */
@media (min-width: 641px) {
    #main-header {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        top: 0 !important;
    }
}