/* Scoped styles for yamanuri pages */

:root {
    --primary-color: #3e5c33;
    /* Forest Green - 落ち着いた森の緑 */
    --secondary-color: #1b3022;
    /* Deep Forest - 深い森の緑 */
    --accent-color: #5c4033;
    /* Soil/Bark - 土や樹皮の茶色 */
    --stone-color: #454d4f;
    /* River Stone - 川底の岩石の色 */
    --text-color: #2c332c;
    /* Dark Forest Text */
    --light-text: #fff;
    --gradient-hero: linear-gradient(135deg, #1b3022 0%, #3e5c33 100%);
    /* 深い森から明るい森へのグラデーション */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #fff;
    --transition: all 0.3s ease;
}

body {
    background-color: #f4f1ea;
    /* Warm Sand/Soil - 温かみのある土の色 */
    color: var(--text-color);
}

header {
    background: transparent;
    box-shadow: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

header.subpage-header {
    background: var(--gradient-hero);
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    position: relative;
}

.back-to-portal {
    position: absolute;
    top: 50%;
    left: 2rem;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-portal:hover {
    color: white;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Adjust for mobile */
@media (max-width: 768px) {
    .back-to-portal {
        position: static;
        display: block;
        margin-bottom: 1rem;
        transform: none;
        text-align: left;
        padding-left: 0;
    }
}


nav .tabs {
    list-style-type: none;
    margin: 1rem 0 0 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav .tab {
    margin: 0 10px;
    position: relative;
}

nav .tab a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 10px 15px;
    display: inline-block;
    position: relative;
    transition: color 0.3s;
    font-size: 0.95rem;
}

nav .tab a:hover {
    color: white;
}

@media (max-width: 768px) {
    nav .tab a {
        padding: 5px 8px;
        /* Compact padding */
        font-size: 0.85rem;
    }
}

nav .tab a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 5px;
}

nav .tab a:focus::after,
nav .tab a:hover::after {
    width: 100%;
}

/* Main Layout Reset - override previous restrictive styles */
main.yamanuri-main {
    padding: 0;
    /* Remove padding to let hero go full width */
    text-align: left;
    max-width: 100%;
    /* Full width */
    margin: 0;
}

.subpage-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background-color: white;
    min-height: 80vh;
}

@media (max-width: 768px) {
    .subpage-container {
        padding: 3rem 1.5rem;
    }
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    /* Full screen */
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    color: var(--light-text);
    text-align: center;
    padding: 0 20px;
}

/* Mobile Menu Toggle - Hidden on Desktop */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 200;
}

/* Optional: Add a subtle overlay or pattern if needed */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding-top: 100px;
    /* ヘッダーとの重なり防止 */
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* CTA Buttons & Store Groups */
.cta-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-start;
}

.store-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 220px;
    /* 固定幅で整列 */
    justify-content: center;
}

.btn i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.btn-store {
    background: var(--primary-color);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 15px rgba(62, 92, 51, 0.4);
}

.btn-store:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(27, 48, 34, 0.6);
    color: white;
}

.qr-wrapper {
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    width: 120px !important;
    height: 120px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.qr-code {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* Mobile: QR codes are typically for desktop users */
@media (max-width: 768px) {
    .qr-wrapper {
        display: none;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .store-group {
        width: 100%;
    }
}

.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #555;
    /* Neutral greyish */
    box-shadow: none;
    border-color: #666;
    color: #ccc;
    pointer-events: none;
}

/* Features Section */
.features {
    padding: 6rem 2rem;
    background-color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 4rem;
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 1rem auto;
    border-radius: 2px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* 280px is safer for small devices if not caught by media query */
    gap: 3rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    background: #e8ede6;
    /* Light Forest tint */
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.feature-card:hover .icon-wrapper {
    background: var(--primary-color);
    color: white;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.feature-card h4 {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.feature-lead {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Use Cases Section */
.use-cases {
    padding: 6rem 2rem;
    background-color: #f4f1ea;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Safet min-width */
    gap: 3rem;
}

.use-case-item {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.use-case-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.case-number {
    font-size: 4rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.03);
    position: absolute;
    top: -10px;
    right: 10px;
    line-height: 1;
}

.use-case-item h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    position: relative;
    z-index: 1;
}

.use-case-item p {
    color: #666;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* Bottom CTA */
.bottom-cta {
    padding: 6rem 2rem;
    background: var(--secondary-color);
    color: white;
    text-align: center;
}

.bottom-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.bottom-cta p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 3rem;
}

.bottom-cta a.contact-link {
    /* Helper for contact links in dark footer */
    color: var(--primary-color);
    text-decoration: none;
}

.bottom-cta a.contact-link:hover {
    text-decoration: underline;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}


/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Override for yamanuri */
footer {
    margin-top: 0 !important;
    /* Remove global margin to close white gap */
}


/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
        /* Reduce font size */
    }

    .section-title {
        font-size: 2rem;
    }

    /* Fix Grid Overflow */
    .feature-grid,
    .use-case-grid {
        grid-template-columns: 1fr;
        /* Stack vertically on mobile safely */
    }

    /* Reduce padding to prevent narrow content */
    .features,
    .use-cases,
    .bottom-cta {
        padding: 4rem 1.5rem;
    }

    .hero {
        padding: 0 1rem;
        /* More space for text */
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    /* Ensure header doesn't break layout or overlap badly */
    header:not(.subpage-header) {
        position: absolute !important;
        /* Float over hero again for seamless blend */
        background: transparent !important;
        box-shadow: none !important;
    }

    header.subpage-header {
        position: relative !important;
        background: var(--gradient-hero) !important;
    }

    .back-to-portal {
        position: relative;
        display: block;
        top: auto;
        left: auto;
        right: auto;
        margin-bottom: 0.5rem;
        padding-left: 1rem;
        padding-top: 1rem;
        text-align: left;
        transform: none;
        z-index: 201;
        /* Ensure it stays above other elements if needed */
    }

    .hero {
        height: auto;
        /* Allow content to dictate height on mobile */
        min-height: auto;
        /* Remove full screen force on mobile */
        padding: 0 1rem;
        align-items: flex-start;
        /* Align content to top so we can pad it down */
        padding-bottom: 3rem;
        /* Tighter bottom spacing */
    }

    .hero-content {
        padding-top: 140px;
        /* Restore padding to clear Logo & Back button */
        width: 100%;
    }

    /* Mobile Menu Styles */
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 1.5rem;
        top: 2rem;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(27, 48, 34, 0.98);
        /* Deep Forest Overlay */
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 150;
    }

    .main-nav.active {
        opacity: 1;
        visibility: visible;
    }

    nav .tabs {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    nav .tab {
        margin: 0;
    }

    nav .tab a {
        font-size: 1.2rem;
        font-weight: bold;
    }
}

.logo span {
    color: #ffffff;
    font-size: 2em;
    vertical-align: middle;
    font-weight: 700;
    margin-left: 0.5rem;
}

.logo img {
    height: 40px;
    vertical-align: middle;
}

/* Text Formatting Utilities */
.keep-together {
    display: inline-block;
}

/* =========================================
   Interactive Features & Modals
   ========================================= */

/* Feature Card Interactive Design */
.feature-card.interactive {
    cursor: pointer;
    position: relative;
    padding-bottom: 4rem;
    /* Space for the footer link */
    display: flex;
    flex-direction: column;
}

.feature-card.interactive:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(46, 125, 50, 0.3);
    /* Primary color hint */
}

/* More Link in Card */
.card-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
    transition: var(--transition);
}

.feature-card.interactive:hover .card-footer {
    background: var(--primary-color);
}

.more-link {
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-card.interactive:hover .more-link {
    color: white;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    padding: 0;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: #f1f1f1;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #555;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-feature-image {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    background: #000;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.modal-body h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.modal-body h4 {
    font-size: 1rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

.modal-slider-outer-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 1.5rem 0;
    padding: 0 30px; /* Space for arrows */
}

/* Modal Slider Styles */
.modal-slider-container {
    position: relative;
    width: auto;
    max-width: fit-content;
    aspect-ratio: 9 / 19.5;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-slider-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.modal-slider-viewport img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    color: var(--primary-color);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.slider-nav:hover {
    background: var(--primary-color);
    color: white;
}

.slider-nav.prev {
    left: 0;
}

.slider-nav.next {
    right: 0;
}

.slider-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .modal-slider-outer-wrapper {
        padding: 0 20px;
    }

    .modal-slider-container {
        max-height: 55vh;
    }
    
    .slider-nav {
        width: 36px;
        height: 36px;
    }
}

/* Use Case Showcase Styles */
.visual-side {
    position: relative;
    background: transparent !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.visual-side:hover {
    transform: translateY(-8px) scale(1.02);
}

.use-case-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 768px) {
    .visual-side {
        margin-top: 1.5rem;
    }
}

/* =========================================
   Release Notes Styles
   ========================================= */
.release-notes-container {
    max-width: 800px;
    margin: 0 auto;
}

.release-item {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--primary-color);
    transition: var(--transition);
}

.release-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.release-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.release-version {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.release-version i {
    color: var(--primary-color);
}

.release-date {
    font-size: 0.95rem;
    color: #888;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 20px;
}

.release-content h4 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    text-transform: none;
    letter-spacing: normal;
}

.release-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.release-content li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
    color: #555;
    text-align: left;
}

.release-content li::before {
    content: '\f00c';
    /* Check icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--primary-color);
    font-size: 0.8rem;
}

/* Mobile Adjustments for Release Notes */
@media (max-width: 768px) {
    .release-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .release-item {
        padding: 1.5rem;
    }

    .release-version {
        font-size: 1.2rem;
    }
}
