/* Google Material Design 3 にインスパイアされたスタイル */

:root {
    /* Flutter/Material Colors */
    --primary: #42a5f5; /* Flutter Blue 400 */
    --on-primary: #ffffff;
    --primary-container: #bbdefb; /* Flutter Blue 100 */
    --on-primary-container: #0d47a1; /* Flutter Blue 900 */

    --secondary: #5c6bc0; /* Indigo 400 */
    --background: #f8f9fa; /* オフホワイトの背景 */
    --surface: #ffffff;
    --surface-variant: #f0f4f8;

    --text-main: #1f1f1f;
    --text-secondary: #5f6368;

    --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --elevation-2: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
    --elevation-hover: 0 10px 20px rgba(0, 0, 0, 0.15), 0 6px 6px rgba(0, 0, 0, 0.1);
    --elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.3);

    --header-height: 64px;
    --screenshot-height: 300px;
}

/* 基本リセット & タイポグラフィ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

/* App Bar */
.app-bar {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05); /* Subtle border-like shadow */
    z-index: 100;
    display: flex;
    align-items: center;
}

.app-bar-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    /* Flutter-like logo style text */
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-item {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}

.nav-item:hover {
    color: var(--primary);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.lang-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-link.active {
    color: var(--primary);
    background-color: var(--primary-container);
}

.lang-link:hover:not(.active) {
    color: var(--primary);
    background-color: var(--surface-variant);
}

.lang-divider {
    color: rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
}

@media (max-width: 480px) {
    .lang-switcher {
        margin-left: 8px;
        padding-left: 8px;
        gap: 4px;
    }
    
    .lang-link {
        font-size: 0.75rem;
        padding: 2px 4px;
    }
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hero-text {
    max-width: 800px;
    z-index: 2;
    text-align: center;
    margin: 0 auto;
}

.eyebrow {
    display: block;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 800;
    color: #2c3e50;
}

.hero-title .highlight {
    color: var(--primary);
    background: linear-gradient(120deg, var(--primary-container) 0%, rgba(255, 255, 255, 0) 100%);
    background-repeat: no-repeat;
    background-size: 100% 40%;
    background-position: 0 90%;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Page Layouts for Sub-pages */
.page-container {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 80px;
}

.page-card {
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 16px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.markdown-body {
    line-height: 1.8;
    color: #333;
}

.markdown-body h2 {
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}

.markdown-body h3 {
    font-size: 1.2rem;
    margin-top: 24px;
    margin-bottom: 12px;
    color: #444;
}

.markdown-body ul {
    list-style: disc;
    margin-left: 24px;
    margin-bottom: 24px;
}

.markdown-body li {
    margin-bottom: 8px;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--surface-variant);
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    width: fit-content;
}

.page-footer-actions {
    margin-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 24px;
    text-align: center;
}

/* App Detail Page Styles */
.app-hero-section {
    padding-top: calc(var(--header-height) + 60px);
    text-align: center;
    background: linear-gradient(180deg, rgba(66, 165, 245, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}

.app-hero-icon {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-main);
}

.app-tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.app-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.badge {
    background-color: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.app-downloads {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.store-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.store-btn.google-play {
    background-color: #00897b; /* Teal */
}

.store-btn.ios {
    background-color: #333;
}

.store-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Feature Banner (App Details) */
.feature-banner-section {
    padding-top: 0;
    padding-bottom: 40px;
}

.banner-wrapper {
    border-radius: var(--radius-l);
    overflow: hidden;
    box-shadow: var(--elevation-2);
    transform: translateY(-40px); /* Overlap hero slightly */
}

.feature-banner-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Feature Cards (Horizontal) */
.feature-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-l);
    box-shadow: var(--elevation-1);
    margin-bottom: 24px;
    display: flex;
    gap: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    align-items: flex-start;
}

.feature-icon-wrapper {
    background-color: var(--primary-container);
    color: var(--on-primary-container);
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon-wrapper .material-icons-round {
    font-size: 32px;
}

.feature-content h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.feature-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.link-list {
    list-style: none;
    margin-top: 16px;
}

.link-list li {
    margin-bottom: 12px;
}

.text-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.2s;
}

.text-link:hover {
    text-decoration-color: var(--primary);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--primary);
    font-size: 2rem;
    animation: bounce 2s infinite;
    display: flex;
    justify-content: center;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.4);
}

.btn-primary:hover {
    background-color: #1e88e5;
    box-shadow: 0 6px 16px rgba(66, 165, 245, 0.5);
    transform: translateY(-2px);
}

.btn-outlined {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outlined:hover {
    background-color: var(--primary-container);
}

/* Material Ripple Effect (Simulated via CSS) */
.ripple {
    position: relative;
    overflow: hidden;
}

/* Section Title */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    color: var(--text-main);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* Cards */
.card {
    background-color: var(--surface);
    border-radius: var(--radius-m);
    box-shadow: var(--elevation-1);
    transition:
        box-shadow 0.3s ease,
        transform 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card:hover {
    box-shadow: var(--elevation-hover);
    transform: translateY(-4px);
}

.card-content {
    padding: 24px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card-image-container {
    height: 200px;
    background-color: var(--surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.project-app-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px; /* iOS-like squircleish */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover .project-app-icon {
    transform: scale(1.05);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #333;
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.card-actions {
    display: flex;
    gap: 16px;
}

.text-btn {
    font-weight: 500;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 4px;
}

.text-btn:hover {
    background-color: var(--primary-container);
}

/* About Card */
.about-card {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.about-card .card-content {
    padding: 40px;
}

.about-card p {
    font-size: 1.1rem;
    margin-bottom: 24px;
}

/* Skill Chips */
.skill-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.chip {
    background-color: var(--surface-variant);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(66, 165, 245, 0.1);
    transition:
        background-color 0.2s,
        transform 0.2s;
}

.chip:hover {
    background-color: var(--primary-container);
    transform: translateY(-2px);
}

/* Contact Section */
.contact-section {
    padding-bottom: 120px;
}

.contact-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 16px;
}

.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.social-btn:hover {
    background-color: var(--primary-container);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.social-btn .material-icons-round {
    font-size: 24px;
}

.contact-email {
    font-weight: 500;
    color: var(--text-main);
    margin-top: 8px;
}

/* Footer */
.footer {
    background-color: #fff;
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-disclaimer {
    margin-top: 16px;
    font-size: 0.75rem;
    color: #999;
    line-height: 1.5;
}

.footer-logo-wrapper {
    margin-bottom: 8px;
}

.footer-flutter-logo {
    height: 24px;
    width: auto;
    opacity: 0.8;
}

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

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

.delay-100 {
    transition-delay: 0.1s;
}
.delay-200 {
    transition-delay: 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-text {
        margin-top: 40px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .feature-card {
        flex-direction: column;
        text-align: center;
    }

    .feature-icon-wrapper {
        margin: 0 auto 16px;
    }
}

/* Screenshots Section */
.screenshots-section {
    padding-top: 40px;
    padding-bottom: 60px;
    overflow: hidden;
    background-color: var(--background);
}

.screenshot-gallery-wrapper {
    position: relative;
    width: 100%;
    padding: 20px 0 40px;
}

/* Gradient Masks for Fade Effect */
.screenshot-gallery-wrapper::before,
.screenshot-gallery-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px; /* Reduced from 120px */
    z-index: 10;
    pointer-events: none;
}

.screenshot-gallery-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--background) 0%, rgba(248, 249, 250, 0) 100%);
}

.screenshot-gallery-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--background) 0%, rgba(248, 249, 250, 0) 100%);
}

.screenshot-gallery-wrapper .scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: var(--elevation-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    color: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.screenshot-gallery-wrapper .scroll-btn:hover {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--elevation-hover);
    transform: translateY(-50%) scale(1.1);
}

.screenshot-gallery-wrapper .scroll-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.screenshot-gallery-wrapper .scroll-btn.prev {
    left: 12px;
}

.screenshot-gallery-wrapper .scroll-btn.next {
    right: 12px;
}

.screenshot-gallery-wrapper .scroll-btn .material-icons-round {
    font-size: 28px;
}

@media (max-width: 768px) {
    .screenshot-gallery-wrapper::before,
    .screenshot-gallery-wrapper::after {
        width: 30px; /* Reduced from 40px */
    }

    /* .screenshot-gallery-wrapper .scroll-btn {
        display: none; 
    } */
}

.screenshot-gallery {
    display: flex;
    gap: 48px; /* Unified larger gap */
    padding: 0 40px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center; /* Center vertically */
    padding-bottom: 40px;
}

.screenshot-gallery::-webkit-scrollbar {
    display: none;
}

.screenshot-gallery .screenshot-item {
    height: var(--screenshot-height); /* Variable height */
    width: auto;
    object-fit: contain;
    border-radius: 16px;
    /* consistent premium shadow */
    box-shadow:
        0 20px 40px -8px rgba(0, 0, 0, 0.15),
        0 12px 16px -4px rgba(0, 0, 0, 0.05);
    transition:
        transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.4s ease;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: #fff;
}

.screenshot-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 28px 48px -8px rgba(0, 0, 0, 0.2),
        0 16px 24px -4px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

/* Mobile adjustments - Only adjust scroll snap, keep visuals consistent */
@media (max-width: 768px) {
    .screenshot-gallery {
        scroll-snap-type: x mandatory;
        gap: 48px; /* Keep the stylish spacing */
        padding: 0 24px 20px;
    }

    .screenshot-gallery .screenshot-item {
        scroll-snap-align: center;
    }
}
