/* ===================================
   Custom Styles for Yume no Ame
   =================================== */

/* Base Styles */
:root {
    --sumi: #1A1A1A;
    --indigo-blue: #2C3E50;
    --cream: #F8F9FA;
    --amber-light: #FFF8E1;
    --zen-gray: #E0E0E0;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Animation */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cream);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--zen-gray);
    border-top-color: var(--indigo-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Premium Text Effects */
.text-gradient {
    background: linear-gradient(135deg, var(--indigo-blue) 0%, var(--sumi) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Section Enhancements */
.hero-title {
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.02em;
}

/* Subtle Grain Texture */
.grain-texture {
    position: relative;
}

.grain-texture::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    z-index: 1;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.5'/%3E%3C/svg%3E");
}

/* Card Hover Effects */
.hover-lift {
    transition: all var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button Animations */
.btn-premium {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.btn-premium::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-premium:hover::before {
    width: 300px;
    height: 300px;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--indigo-blue);
    z-index: 9998;
    transition: width 0.2s ease;
}

/* Image Reveal Animation */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cream);
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-reveal.revealed::before {
    transform: translateX(100%);
}

/* Japanese Typography Enhancement */
.jp-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.1em;
    line-height: 1.8;
}

/* Decorative Line Elements */
.decorative-line {
    position: relative;
}

.decorative-line::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--indigo-blue);
    opacity: 0.5;
}

/* Section Transitions */
.section-transition {
    position: relative;
}

.section-transition::before {
    content: "";
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--cream));
    pointer-events: none;
}

/* FAQ Accordion Smooth Transitions */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-content.open {
    max-height: 500px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.3;
    }
    
    .jp-vertical {
        writing-mode: horizontal-tb;
    }
    
    /* Reduce parallax on mobile for performance */
    .parallax-bg {
        transform: none !important;
    }
}

/* High-end Animation Classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.in-view {
    opacity: 1;
    transform: scale(1);
}

/* Print Styles */
@media print {
    header, footer, .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}

/* Accessibility Enhancements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--indigo-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus Visible for Keyboard Navigation */
:focus-visible {
    outline: 2px solid var(--indigo-blue);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Custom Selection Colors */
::selection {
    background: var(--indigo-blue);
    color: white;
}

::-moz-selection {
    background: var(--indigo-blue);
    color: white;
}

/* Smooth Transitions for Interactive Elements */
a, button, input, textarea, select {
    transition: all var(--transition-base);
}

/* Premium Cursor (Optional) */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--indigo-blue);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.1s ease;
    opacity: 0.5;
}

/* Zen Line Art SVG Styles */
.zen-svg {
    stroke: var(--sumi);
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zen-svg path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 3s ease forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* Elegant Section Dividers */
.section-divider {
    position: relative;
    text-align: center;
    margin: 4rem 0;
}

.section-divider::before {
    content: "〜";
    font-size: 2rem;
    color: var(--zen-gray);
    display: block;
    margin: 0 auto;
}

/* Premium Loading States */
.skeleton {
    background: linear-gradient(90deg, 
        var(--zen-gray) 25%, 
        rgba(255, 255, 255, 0.5) 50%, 
        var(--zen-gray) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Refined Typography Scale */
.text-display-1 { font-size: 4.5rem; line-height: 1.1; }
.text-display-2 { font-size: 3.5rem; line-height: 1.2; }
.text-display-3 { font-size: 2.5rem; line-height: 1.3; }

@media (max-width: 768px) {
    .text-display-1 { font-size: 2.5rem; }
    .text-display-2 { font-size: 2rem; }
    .text-display-3 { font-size: 1.5rem; }
}

/* Customer Voice Swiper Navigation Customization */
.customer-swiper .swiper-button-next,
.customer-swiper .swiper-button-prev {
    width: 44px;
    height: 44px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: var(--indigo-blue);
    transition: all 0.3s ease;
}

.customer-swiper .swiper-button-next:after,
.customer-swiper .swiper-button-prev:after {
    font-size: 1.2rem;
    font-weight: bold;
}

.customer-swiper .swiper-button-next:hover,
.customer-swiper .swiper-button-prev:hover {
    background-color: var(--indigo-blue);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Desktop/Tablet: Move arrows outside */
@media (min-width: 768px) {
    .customer-swiper {
        padding-left: 60px;
        padding-right: 60px;
    }

    .customer-swiper .swiper-button-next {
        right: 10px;
    }

    .customer-swiper .swiper-button-prev {
        left: 10px;
    }
}

/* Mobile: Hide arrows */
@media (max-width: 767px) {
    .customer-swiper .swiper-button-next,
    .customer-swiper .swiper-button-prev {
        display: none;
    }
}