/**
 * Sakuichi Main Styles
 * Complete design system for beautiful, responsive UI
 */

/* ============================================
   CSS Variables (Design System)
   ============================================ */
:root {
    /* Color Palette */
    --color-bg: #f7f9fc;
    --color-text: #1f2937;
    --color-text-muted: #64748b;
    --color-border: #e5e7eb;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-secondary: #64748b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-orange: #f97316;
    --color-orange-dark: #ea580c;

    /* Typography */
    --font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    /* Shadows */
    --shadow-sm: 0 3px 10px rgba(2, 6, 23, 0.06);
    --shadow-md: 0 10px 30px rgba(2, 6, 23, 0.08);
    --shadow-lg: 0 20px 45px rgba(2, 6, 23, 0.12);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.25);

    /* Z-index */
    --z-header: 1000;
    --z-modal: 9999;
    --z-overlay: 10000;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--color-text);
    font-weight: 400;
    letter-spacing: -0.01em;
    background: var(--color-bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ============================================
   Header Styles
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-border);
    z-index: var(--z-header);
    padding: var(--spacing-sm) 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.nav-brand h1 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: var(--color-primary);
    background: rgba(79, 70, 229, 0.1);
}

.nav-cta-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.nav-cta-demo,
.nav-cta-free {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-cta-demo {
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.nav-cta-demo:hover {
    background: var(--color-primary);
    color: white;
}

.nav-cta-free {
    background: var(--color-primary);
    color: white;
}

.nav-cta-free:hover {
    background: var(--color-primary-hover);
}

/* Mobile Menu */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--color-text);
    cursor: pointer;
}

@media (max-width: 768px) {
    .header {
        padding: 8px 0;
    }

    .nav-brand h1 {
        font-size: var(--font-size-lg);
        font-weight: 500;
    }

    .mobile-menu-button {
        display: block;
        font-size: var(--font-size-lg);
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: var(--spacing-lg);
        border-top: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .nav-cta-demo,
    .nav-cta-free {
        text-align: center;
        width: 100%;
    }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: calc(70px + var(--spacing-3xl)) 0 var(--spacing-3xl) 0;
    background: linear-gradient(135deg, #f7f9fc 0%, #eef2ff 100%);
    overflow: hidden;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
    text-align: center;
}

.title-highlight {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-3xl);
}

/* ============================================
   Button Styles
   ============================================ */
.cta-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    min-width: 180px;
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.05);
}

.cta-white {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-white:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Comparison Section
   ============================================ */
.hero-comparison {
    padding: var(--spacing-3xl) 0 var(--spacing-3xl) 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.hero-comparison::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.comparison-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comparison-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.comparison-subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-muted);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.comparison {
    display: block;
    margin-top: var(--spacing-2xl);
    animation: fadeInScale 0.8s ease-out 0.2s backwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.comparison-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(79, 70, 229, 0.15),
                0 0 0 1px rgba(79, 70, 229, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.comparison-image:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.2),
                0 0 0 1px rgba(79, 70, 229, 0.15);
}

.comparison-item {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.comparison-item h3 {
    background: #f8fafc;
    padding: var(--spacing-lg);
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
}

.before-content,
.after-content {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.long-text {
    font-size: var(--font-size-xs);
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    text-align: justify;
}

.text-content h4 {
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.metadata {
    display: flex;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: auto;
    padding-top: var(--spacing-xs);
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}


/* Tablet and Mobile - Clean 2-column and 1-column layout */
@media (min-width: 769px) and (max-width: 991px) {
    .comparison {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .hero-comparison {
        padding: var(--spacing-2xl) 0 0 0;
    }

    .comparison-title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-md);
    }

    .comparison-subtitle {
        font-size: var(--font-size-base);
        padding: 0 var(--spacing-md);
    }

    .comparison {
        margin-top: var(--spacing-lg);
        margin-bottom: 0;
        padding: 0;
    }

    .comparison-image {
        width: 100vw;
        max-width: 100vw;
        height: auto;
        margin-left: calc(-50vw + 50%);
        border-radius: 0;
        box-shadow: none;
        object-fit: cover;
        object-position: center;
        aspect-ratio: 2 / 1;
    }

    .comparison-image:hover {
        transform: none;
        box-shadow: none;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .cta-primary,
    .cta-white {
        width: 100%;
        max-width: 300px;
    }
}

/* ============================================
   Demo Section
   ============================================ */
.demo-section {
    padding: var(--spacing-3xl) 0;
    background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
}

.demo-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.demo-badge {
    display: inline-block;
    background: var(--color-orange);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.demo-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

.demo-highlight {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.demo-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ============================================
   Form Styles
   ============================================ */
.demo-form-simple {
    background: white;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 500px;
    margin: 0 auto;
}

.demo-input-single {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.demo-email-single,
.demo-url-single {
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.demo-email-single:focus,
.demo-url-single:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.demo-terms-checkbox {
    margin-bottom: var(--spacing-lg);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    margin: 0;
}

.terms-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.terms-text a {
    color: var(--color-primary);
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

.demo-submit-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: white;
    border: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: var(--spacing-lg);
}

.demo-submit-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.trust-signals {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ============================================
   Section Styles
   ============================================ */
.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--spacing-3xl);
    line-height: 1.6;
}

/* ============================================
   Scroll Offset for Fixed Header
   ============================================ */
section,
#free-plan,
#contact,
#features,
#how-to-use,
#pricing,
#sample-gallery,
#security-legal {
    scroll-margin-top: 80px; /* ヘッダー高さ + 余白 */
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }
}

@media (max-width: 768px) {
    section,
    #free-plan,
    #contact,
    #features,
    #how-to-use,
    #pricing,
    #sample-gallery,
    #security-legal {
        scroll-margin-top: 65px; /* モバイル用の調整 */
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .demo-input-single {
        gap: var(--spacing-sm);
    }
    
    .trust-signals {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: calc(60px + var(--spacing-2xl)) 0 var(--spacing-2xl) 0;
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .demo-form-simple {
        padding: var(--spacing-lg);
    }
}

/* ============================================
   Image Dual Result Layout
   ============================================ */
.image-dual-result .dual-results {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    height: 100%;
}

.image-dual-result .dual-results .sample-result {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: white;
}

.image-dual-result .dual-results .sample-result h5 {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: white;
}

.image-dual-result .dual-results .sample-result p {
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: white;
    margin: 0;
}

.sample-description {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.sample-image-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sample-image {
    width: 100%;
    height: 100%;
    flex: 1;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: var(--spacing-sm);
}

.sample-image-preview p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
    margin: 0;
    padding: var(--spacing-xs);
}

/* ============================================
   File Preview Styles
   ============================================ */
.sample-file-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sample-file-image {
    width: 100%;
    height: 100%;
    flex: 1;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: var(--spacing-sm);
    background: white;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.file-info p {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin: 0;
    text-align: center;
}

.file-info small {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: center;
    padding: var(--spacing-xs);
    background: var(--color-background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}