/* --- Global Settings & Variables --- */
:root {
    --font-serif: 'Noto Serif JP', serif;
    --font-sans: 'Poppins', sans-serif;
    --color-text: #4a4a4a;
    --color-heading: #333333;
    --color-background: #fdfaf6;
    --color-accent: #d4afb9; /* A dusty rose accent color */
    --color-light-gray: #e9e9e9;
    --transition-speed: 0.5s;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.8;
    cursor: none; /* Hide default cursor */
}

/* --- Custom Cursor --- */
.cursor-dot,
.cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease;
}
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-accent);
    transition: transform 0.1s ease;
}
.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-accent);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}
/* Hide cursor on touch devices */
@media (hover: none) {
    .cursor-dot, .cursor-outline {
        display: none;
    }
    body {
        cursor: auto;
    }
}
/* Hover State */
.cursor-hover {
    transform: scale(1.5);
    background-color: rgba(212, 175, 185, 0.2);
}

/* Apply none cursor to interactive elements */
a, button, .gallery-item, .map-point {
    cursor: none;
}


/* --- Preloader --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    width: 50px;
    height: 50px;
    border: 3px solid var(--color-accent);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Header --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 3rem;
    transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

#header.scrolled {
    background-color: rgba(253, 250, 246, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-heading);
    text-decoration: none;
    letter-spacing: 1px;
}

#header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

#header nav li {
    margin-left: 2rem;
}

#header nav a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 400;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

#header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

#header nav a:hover {
    color: var(--color-heading);
}

#header nav a:hover::after {
    width: 100%;
}

.contact-button {
    border: 1px solid var(--color-accent);
    padding: 0.5rem 1rem !important;
    border-radius: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.contact-button:hover {
    background-color: var(--color-accent);
    color: white !important;
}

/* --- Hero Section --- */
#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/hero.jpg');
    background-size: cover;
    background-position: center;
    animation: zoom-in 15s ease-out forwards;
    z-index: -1;
}
@keyframes zoom-in {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* hero-text color transition */
.hero-text .fade-in {
    color: rgba(255, 255, 255, 0.6); /* Start color (semi-transparent white) */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, color 1.5s ease-out; /* Add color transition */
}
.hero-text .fade-in.is-visible {
    color: #fff; /* End color (solid white) */
}


.hero-text h1 {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5);
    line-height: 1.4;
}

.hero-text p {
    font-size: 1.1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    letter-spacing: 1px;
    margin-top: 1rem;
}

.scroll-down {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    animation: bounce 2s infinite;
}

.scroll-down::after {
    content: '';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 20px;
    background: white;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}


/* --- General Content Section --- */
.content-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 8rem 2rem;
    text-align: center;
}

.section-title h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 4rem;
}


/* --- Concept Section --- */
#concept p {
    max-width: 600px;
    margin: 0 auto;
}

/* --- Portfolio Filters --- */
#portfolio-filters {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-btn {
    background: none;
    border: 1px solid var(--color-light-gray);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.filter-btn:hover {
    background-color: #f8f4f0;
    border-color: #ddd;
}

.filter-btn.active {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}


/* --- Portfolio Horizontal Scroll --- */
#portfolio-wrapper {
    padding: 8rem 0;
}
#portfolio {
    padding-top: 0;
    padding-bottom: 0;
}
#portfolio-gallery-container {
    height: 70vh; /* Adjust height as needed */
    width: 100%;
    overflow: hidden; /* Hide vertical scrollbar */
    position: relative;
}

#portfolio-gallery {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10vw; /* Provide some padding on the sides */
    transition: transform 0.5s ease;
}

.gallery-item {
    flex-shrink: 0;
    height: 80%; /* 80% of the container height */
    margin-right: 4vw;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    position: relative;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 1;
}

/* Class to hide items for filtering */
.gallery-item.hide {
  opacity: 0;
  transform: scale(0.9);
}


.gallery-item.landscape {
    width: 50vh; /* Adjust aspect ratio for landscape */
}
.gallery-item.portrait {
    width: 38vh; /* Adjust aspect ratio for portrait */
}


.gallery-item:hover {
    transform: translateY(-10px);
}

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

.gallery-item .caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .caption {
    opacity: 1;
}

/* --- About Section --- */
.about-content {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 4rem;
}

.about-image {
    flex-shrink: 0;
}

.about-image img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
}

.about-text h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--color-heading);
    margin-bottom: 1.5rem;
}

/* --- Journal Section --- */
.journal-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: left;
}

.journal-item {
    text-decoration: none;
    color: var(--color-text);
    display: block;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-light-gray);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.journal-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.journal-item-img {
    height: 200px;
    overflow: hidden;
}
.journal-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.journal-item h4 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--color-heading);
    margin: 1.5rem 1.5rem 0.5rem 1.5rem;
}
.journal-date {
    font-size: 0.8rem;
    color: #999;
    margin: 0 1.5rem 1.5rem 1.5rem;
}
.view-more-button {
    display: inline-block;
    margin-top: 4rem;
    padding: 0.8rem 2.5rem;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.view-more-button:hover {
    background-color: var(--color-accent);
    color: white;
}

/* --- Contact Section --- */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
}
.contact-content p {
    line-height: 1.8;
    margin-bottom: 2rem;
}
.instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-heading);
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    background-color: #fff;
    border: 1px solid var(--color-light-gray);
    border-radius: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.instagram-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
}
.instagram-link svg {
    color: var(--color-accent);
}

/* --- Footer --- */
#footer {
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid var(--color-light-gray);
}
#footer nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}
#footer nav a {
    text-decoration: none;
    color: var(--color-text);
}
#footer nav a:hover {
    color: var(--color-heading);
}

/* --- Lightbox --- */
#lightbox {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(253, 250, 246, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    backdrop-filter: blur(5px);
}
#lightbox.show {
    opacity: 1;
    visibility: visible;
}
.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    position: relative;
}
#lightbox-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border-radius: 4px;
}
#lightbox-caption {
    color: var(--color-heading);
    text-align: center;
    margin-top: 1rem;
    font-size: 1rem;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 2.5rem;
    transition: color 0.3s ease;
    z-index: 10001;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    color: var(--color-heading);
}
.lightbox-close {
    top: 2rem;
    right: 2.5rem;
    line-height: 1;
}
.lightbox-prev, .lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}
.lightbox-prev {
    left: 2rem;
}
.lightbox-next {
    right: 2rem;
}

/* --- Journal Modal --- */
#journal-modal {
    position: fixed;
    z-index: 9000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(253, 250, 246, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    backdrop-filter: blur(5px);
    padding: 1rem;
}
#journal-modal.show {
    opacity: 1;
    visibility: visible;
}
.journal-modal-content-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 3rem 1rem;
}
.journal-modal-content {
    background-color: #fff;
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: left;
}
.journal-modal-close, .journal-modal-prev, .journal-modal-next {
    position: fixed;
    background: none;
    border: none;
    color: var(--color-text);
    transition: color 0.3s ease;
    z-index: 9001;
}
.journal-modal-close {
    top: 2rem;
    right: 2.5rem;
    font-size: 2.5rem;
    line-height: 1;
}
.journal-modal-prev, .journal-modal-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
}
.journal-modal-prev { left: 2rem; }
.journal-modal-next { right: 2rem; }
.journal-modal-close:hover, .journal-modal-prev:hover, .journal-modal-next:hover {
    color: var(--color-heading);
}

#journal-modal-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}
#journal-modal-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--color-heading);
    margin-bottom: 0.5rem;
}
#journal-modal-date {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 2rem;
}
#journal-modal-text {
    font-size: 1rem;
    line-height: 2;
}


/* --- Fade In Animation --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    #header {
        padding: 1rem;
    }
    #header nav {
        display: none; /* Simple hiding for mobile. A burger menu would be a good enhancement. */
    }

    .content-section {
        padding: 5rem 1rem;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    /* Stack elements on mobile */
    .about-content {
        flex-direction: column;
        gap: 2rem;
    }
    .journal-container {
        grid-template-columns: 1fr;
    }
    .journal-modal-content { padding: 1.5rem; }
    #journal-modal-title { font-size: 1.5rem; }
    .journal-modal-prev { left: 1rem; }
    .journal-modal-next { right: 1rem; }
    .journal-modal-close { top: 1rem; right: 1rem;}


    /* Make horizontal scroll vertical on mobile */
    #portfolio-wrapper {
        padding: 5rem 0;
    }
    #portfolio-gallery-container {
        height: auto;
        overflow: visible;
    }
    #portfolio-gallery {
        flex-direction: column;
        padding: 0 1rem;
        gap: 2rem;
        transition: none;
    }
    .gallery-item, .gallery-item.portrait, .gallery-item.landscape {
        width: 100%;
        height: auto;
        margin-right: 0;
    }
    .gallery-item img {
        width: 100%;
        height: auto;
    }
    
    .niigata-map-layout {
        grid-template-columns: 1fr;
    }
    #map-info-card {
        height: auto;
    }

    .lightbox-close { top: 1rem; right: 1rem; }
    .lightbox-prev { left: 1rem; }
    .lightbox-next { right: 1rem; }
}
