/* =========================================================================
   cafe apart - Main Stylesheet (Advanced Features Version)
   ========================================================================= */

/* CSS Variables */
:root {
    /* Light Mode Variables */
    --primary-color: #2c3e50;
    --accent-color: #d4a373;
    --bg-light: #fefcfb;
    --bg-sand: #f4f1ea;
    --text-main: #333333;
    --text-muted: #777777;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.9);
    
    --font-en: 'Outfit', sans-serif;
    --font-ja: 'Zen Kaku Gothic New', sans-serif;

    /* Spacing & Utilities */
    --section-spacing: 120px;
    --border-radius: 8px;
    --card-shadow: 0 5px 15px rgba(0,0,0,0.03);
    --btn-border: 1px solid var(--border-color);
    --filter-radius: 30px;
    --image-radius: 4px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Progress bar */
    --progress-color: #d4a373;
}

/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Hide default cursor for custom cursor */
}

body {
    font-family: var(--font-ja);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

a, button {
    text-decoration: none;
    color: inherit;
    border: none;
    background: none;
    cursor: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* Custom Cursor */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: rgba(212, 163, 115, 0.6);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10000;
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
    mix-blend-mode: difference;
}

.cursor.hover {
    width: 50px;
    height: 50px;
    background-color: rgba(212, 163, 115, 0.2);
    border: 1px solid var(--accent-color);
}

/* Splash Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-light);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-content {
    text-align: center;
}
.loader-logo {
    width: 120px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* Scroll Progress Bar */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1000;
}
#progress-bar {
    height: 100%;
    background: var(--progress-color);
    width: 0%;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.section {
    padding: var(--section-spacing) 0;
}

.text-center {
    text-align: center;
}

.bg-sand {
    background-color: var(--bg-sand);
}

.section-title {
    font-family: var(--font-en);
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background-color: var(--accent-color);
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 100;
    transition: var(--transition);
}

.header.scrolled {
    padding: 10px 0;
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

.logo img {
    height: 40px;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.8));
}

.nav-menu ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    font-family: var(--font-en);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    position: relative;
    transition: var(--transition);
}

.header.scrolled .nav-menu a {
    color: var(--primary-color);
    text-shadow: none;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}



/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 101;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background-color: var(--white);
    transition: var(--transition);
}

.header.scrolled .mobile-menu-btn span {
    background-color: var(--primary-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenBurns 25s infinite alternate ease-in-out;
}

@keyframes kenBurns {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.15); }
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.1));
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    width: 100%;
}

.hero h1 {
    font-family: var(--font-en);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 200;
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: 0.05em;
    display: flex;
    flex-direction: column;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.hero h1 span {
    display: block;
}

.hero-subtitle {
    font-family: var(--font-en);
    margin-top: 2rem;
    color: #ffffff;
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 55px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: #ffffff;
    font-family: var(--font-en);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scroll-indicator .line {
    width: 1px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.scroll-indicator .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: #ffffff;
    animation: scrollLine 2s infinite ease-in-out;
}

@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

/* Weather Widget */
.weather-widget {
    position: absolute;
    bottom: 80px;
    right: 5%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: var(--font-en);
}
.weather-icon {
    font-size: 1.5rem;
    line-height: 1;
}
.weather-info {
    display: flex;
    flex-direction: column;
}
.weather-temp {
    font-size: 1.2rem;
    font-weight: 500;
}
.weather-loc {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* News Ticker Marquee */
.news-ticker {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40px;
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 11;
    font-size: 0.9rem;
    font-weight: 500;
}
.news-content {
    display: flex;
    white-space: nowrap;
    animation: ticker-animation 80s linear infinite; /* Much slower */
}
.news-item {
    padding: 0 50px;
}
@keyframes ticker-animation {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Concept Section */
.concept-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.catchphrase {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.concept-description {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.sub-note {
    font-size: 0.9rem;
    color: var(--accent-color);
    display: block;
    margin-top: 1rem;
}

.concept-images {
    position: relative;
    height: 600px;
}

.concept-images img {
    position: absolute;
    border-radius: var(--image-radius);
    box-shadow: var(--card-shadow);
    transform-style: preserve-3d;
}

.img-main {
    width: 80%;
    top: 0;
    right: 0;
    z-index: 1;
}

.img-sub {
    width: 60%;
    bottom: 0;
    left: 0;
    z-index: 2;
    border: 10px solid var(--bg-light);
}

/* Menu Section */
.menu-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: var(--font-en);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 500;
    padding: 10px 28px;
    line-height: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 30px;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

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

.menu-item {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    opacity: 1;
    transform-style: preserve-3d;
}

.menu-item.hide { display: none !important; }

.menu-item .img-wrapper {
    overflow: hidden;
    aspect-ratio: 4/3;
}

.menu-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.menu-item:hover img {
    transform: scale(1.05);
}

.menu-info {
    padding: 20px;
    text-align: center;
    transform: translateZ(20px); /* 3D pop effect */
}

.menu-info h4 {
    font-family: var(--font-en);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.menu-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Instagram Mockup Grid */
.ig-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}
.ig-item {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: var(--image-radius);
    transform-style: preserve-3d;
}
.ig-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.ig-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color: #fff;
    opacity: 0;
    transition: var(--transition);
    font-weight: bold;
    font-family: var(--font-en);
}
.ig-item:hover .ig-overlay {
    opacity: 1;
}
.ig-item:hover img {
    transform: scale(1.1);
}
.btn-follow {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    border-radius: 30px;
    font-family: var(--font-en);
    transition: var(--transition);
}
.btn-follow:hover {
    background: var(--text-main);
    color: var(--bg-light);
}

/* Infinite Gallery Marquee */
.gallery {
    padding-top: 40px;
    padding-bottom: 0;
    overflow: hidden;
}

/* 手動スクロールと自動制御の準備 */
.marquee {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    display: flex;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.marquee:active {
    cursor: grabbing;
}

/* スクロールバーを非表示にする（デザイン重視） */
.marquee::-webkit-scrollbar {
    display: none;
}
.marquee {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.marquee-content {
    display: flex;
    flex-wrap: nowrap;
    flex-shrink: 0;
    /* アニメーションはJSで制御するためCSSからは削除 */
}

.gallery-img {
    flex-shrink: 0;
    height: 250px;
    width: auto;
    margin-right: 20px;
    border-radius: var(--image-radius);
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: zoom-in;
}

.gallery-img:hover {
    transform: scale(1.05) translateY(-5px);
    filter: brightness(1.1);
    z-index: 10;
}

@keyframes gallery-animation {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@media (max-width: 768px) {
    .gallery-img {
        height: 180px;
    }
}

/* Access Section */
.access-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.info-card {
    background: var(--white);
    padding: 50px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.info-logo {
    width: 120px;
    margin-bottom: 30px;
}

.info-list {
    margin-bottom: 40px;
}

.info-list dt {
    font-family: var(--font-en);
    font-size: 0.9rem;
    color: var(--accent-color);
    letter-spacing: 0.1em;
    margin-bottom: 5px;
}

.info-list dd {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-main);
    margin-left: 0;
}

.sns-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sns-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-family: var(--font-en);
    font-size: 0.95rem;
    transition: var(--transition);
}

.sns-btn:hover {
    color: var(--accent-color);
}

.map-container {
    height: 450px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform-style: preserve-3d;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 0;
    font-family: var(--font-en);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.content-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Enhanced Interactions --- */
.filter-btn, .btn-follow, .sns-btn, .mobile-menu-btn, .theme-dot, .logo img {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.filter-btn:hover, .btn-follow:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.theme-dot:hover {
    transform: scale(1.2) rotate(5deg);
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(20px) scale(0.8);
    cursor: pointer;
}

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

.back-to-top:hover {
    background-color: var(--accent-color);
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

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

/* --- Weather Widget Polish --- */
.weather-widget {
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.5s ease;
}
.weather-widget:hover {
    transform: translateY(-8px) scale(1.05);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}
.weather-icon {
    display: inline-block;
    animation: float-icon 3s ease-in-out infinite;
    font-size: 1.8rem;
}
@keyframes float-icon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

/* --- Weather Backdrop Overlay --- */
.weather-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: background 1.5s ease;
}
.weather-rainy { background: rgba(20, 30, 48, 0.2); }
.weather-cloudy { background: rgba(0, 0, 0, 0.1); }
.weather-clear { background: rgba(255, 255, 255, 0.05); }

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Tilt CSS Utility */
.tilt {
    transition: box-shadow 0.1s, transform 0.1s;
    will-change: transform;
}

/* Responsive Design */
@media (max-width: 900px) {
    .concept-grid, .access-grid {
        grid-template-columns: 1fr;
    }
    
    .concept-images {
        height: 400px;
        order: -1;
        margin-bottom: 40px;
    }
    
    .img-main { width: 90%; }
    .img-sub { width: 70%; }
    
    .ig-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--glass-bg);
        backdrop-filter: blur(10px);
        padding: 100px 40px;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0,0,0,0.05);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
    }

    .nav-menu a {
        color: var(--text-main);
        font-size: 1.2rem;
        text-shadow: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: var(--primary-color);
    }
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background-color: var(--primary-color);
    }
    
    .cursor {
        display: none; /* Hide custom cursor on mobile */
    }
    * { cursor: auto; }
    
    .weather-widget {
        bottom: 50px;
        right: 15px;
        padding: 10px 15px;
    }
}







.menu-item:not(:has(.img-wrapper)):hover::after {
    opacity: 0.8;
}


.menu-item.show-logo:hover::after {
    opacity: 0.7;
}

/* =========================================
   Intelligent Menu Layout Logic
   ========================================= */
.menu-item {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
}

.menu-info {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    margin-top: auto !important; /* Pushes text to the bottom */
    background-color: var(--white) !important;
    position: relative;
    z-index: 5;
}

.img-wrapper {
    flex-shrink: 0 !important;
    z-index: 5;
}

/* Fallback Logo as a pseudo-element at the top */


.menu-item.show-logo:hover::before {
    opacity: 0.7;
}










/* Weather Effects Animations */
.rain-container, .sun-container {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9999; overflow: hidden;
}

.rain-drop {
    position: absolute; width: 2px; height: 15px;
    background: rgba(255, 255, 255, 0.4);
    bottom: 100%; animation: fall linear infinite;
}

@keyframes fall {
    to { transform: translateY(110vh); }
}

.sunbeam {
    position: absolute; top: 50%; left: 50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(230, 126, 34, 0.1) 0%, rgba(230, 126, 34, 0) 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: sunGrow 5s ease-out forwards;
}

@keyframes sunGrow {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}
