/* ========================================
   Reset & Base Styles
======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colors - Book/Literary Theme */
    --primary-color: #2C3E50;
    --secondary-color: #E74C3C;
    --accent-color: #F39C12;
    --danger-color: #8E44AD;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-light: #95A5A6;
    --background: #F8F4E6;
    --card-bg: #FFFFFF;
    --border-color: #E0D5C7;
    
    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
    --font-heading: "Noto Sans JP", sans-serif;
    --font-serif: "Noto Serif JP", serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.16);
    --shadow-xl: 0 16px 32px rgba(0,0,0,0.20);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background-color: var(--background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   Typography
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #3a7bc8;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--text-primary);
    color: white;
    border: 2px solid var(--text-primary);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--secondary-color);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    border-radius: 50%;
}

.btn-primary:hover {
    background: var(--text-primary);
    border-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

.btn-large {
    font-size: 1.125rem;
    padding: var(--spacing-md) var(--spacing-xl);
}

/* ========================================
   Utilities
======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xxl);
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Hero Section
======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2C3E50 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.05;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0L50 50L0 100M50 0L100 50L50 100' stroke='%23ffffff' stroke-width='0.5' fill='none' /%3E%3C/svg%3E");
    background-size: 100px 100px;
}

.hero-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1;
    font-family: var(--font-serif);
    letter-spacing: -2px;
    position: relative;
    display: inline-block;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--secondary-color);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xl);
    opacity: 0.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

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

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 1rem;
    opacity: 0.8;
    margin-top: var(--spacing-xs);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: transparent;
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border: 2px solid white;
    border-radius: 0;
    font-weight: 600;
    font-size: 1.125rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: white;
    transition: left 0.3s ease;
    z-index: -1;
}

.hero-cta:hover {
    color: var(--text-primary);
}

.hero-cta:hover::before {
    left: 0;
}

.cta-arrow {
    transition: transform var(--transition-fast);
}

.hero-cta:hover .cta-arrow {
    transform: translate(2px, -2px);
}

/* ========================================
   Story Introduction Section
======================================== */
.story-intro {
    padding: var(--spacing-xxl) 0;
    background: white;
}

.story-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.story-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0;
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
}

.story-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
    border-width: 2px;
}

.story-card.highlight {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

.story-card.highlight .card-text {
    color: rgba(255, 255, 255, 0.9);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ========================================
   Free Chapters Section
======================================== */
.free-chapters {
    padding: var(--spacing-xxl) 0;
    background: var(--background);
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.chapter-card {
    background: white;
    border: 1px solid var(--text-primary);
    border-radius: 0;
    padding: var(--spacing-lg);
    box-shadow: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.chapter-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(231, 76, 60, 0.1), transparent);
    transition: left 0.6s ease;
}

.chapter-card:hover {
    transform: translateX(4px);
    border-color: var(--secondary-color);
}

.chapter-card:hover::after {
    left: 100%;
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.chapter-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.chapter-badge {
    background: transparent;
    color: var(--secondary-color);
    padding: 4px 12px;
    border: 1px solid var(--secondary-color);
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chapter-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.chapter-excerpt {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
}

.chapter-link {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition-fast);
}

.chapter-link:hover {
    gap: 8px;
}

.chapters-info {
    text-align: center;
    padding: var(--spacing-lg);
    background: white;
    border-radius: 8px;
}

.info-text {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.icon {
    font-size: 1.25rem;
}

.divider {
    color: var(--border-color);
}

/* ========================================
   Access Section
======================================== */
.access-section {
    padding: var(--spacing-xxl) 0;
    background: white;
}

.access-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.access-card {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--background);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

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

.access-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.access-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.access-description {
    color: var(--text-secondary);
    line-height: 1.8;
}

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

.access-note {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
}

/* ========================================
   Features Section
======================================== */
.features {
    padding: var(--spacing-xxl) 0;
    background: var(--background);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.feature-card {
    background: white;
    border: none;
    border-top: 4px solid var(--text-primary);
    border-radius: 0;
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-normal);
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feature-card:hover::before {
    width: 100%;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.feature-title {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.feature-text {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ========================================
   Footer
======================================== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.footer-text {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ========================================
   Animations
======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in-delay {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.2s;
}

.fade-in-delay-2 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.4s;
}

.fade-in-delay-3 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.6s;
}

.fade-in-delay-4 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.8s;
}

.fade-in.is-visible,
.fade-in-delay.is-visible,
.fade-in-delay-2.is-visible,
.fade-in-delay-3.is-visible,
.fade-in-delay-4.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Mobile Only
======================================== */
.mobile-only {
    display: none;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: var(--spacing-md);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .chapters-grid,
    .access-methods,
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    section {
        padding: var(--spacing-xl) 0;
    }
    
    .info-text {
        font-size: 0.875rem;
    }
    
    .mobile-only {
        display: inline;
    }
}