/* ==================== */
/* CSS Custom Properties */
/* ==================== */

:root {
    /* Light Mode Colors */
    --bg-primary: hsl(0, 0%, 98%);
    --bg-secondary: hsl(0, 0%, 100%);
    --bg-tertiary: hsl(210, 20%, 96%);

    --text-primary: hsl(220, 20%, 15%);
    --text-secondary: hsl(220, 15%, 40%);
    --text-tertiary: hsl(220, 10%, 55%);

    --accent-primary: hsl(25, 85%, 55%);
    --accent-secondary: hsl(200, 75%, 50%);
    --accent-gradient: linear-gradient(135deg, hsl(25, 85%, 55%) 0%, hsl(200, 75%, 50%) 100%);

    --border-color: hsl(220, 15%, 90%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    /* Typography */
    --font-primary: 'Noto Sans KR', sans-serif;
    --font-secondary: 'Outfit', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 200ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: hsl(220, 20%, 10%);
    --bg-secondary: hsl(220, 18%, 14%);
    --bg-tertiary: hsl(220, 16%, 18%);

    --text-primary: hsl(0, 0%, 95%);
    --text-secondary: hsl(220, 10%, 70%);
    --text-tertiary: hsl(220, 8%, 55%);

    --border-color: hsl(220, 15%, 25%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ==================== */
/* Reset & Base Styles */
/* ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==================== */
/* Utility Classes */
/* ==================== */

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

.section {
    padding: var(--spacing-xl) 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ==================== */
/* Navigation Bar */
/* ==================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(28, 32, 40, 0.9);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-light {
    display: block;
}

.logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

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

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width var(--transition-fast);
}

.nav-link:hover::after {
    width: 100%;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--accent-primary);
    transform: rotate(15deg);
}

.theme-toggle:hover svg {
    color: white;
}

.theme-toggle svg {
    transition: color var(--transition-fast);
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    height: 30px;
    justify-content: center;
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ==================== */
/* Hero Section */
/* ==================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    padding-top: 70px;
}

.hero-decoration {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: var(--accent-gradient);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
}

.hero-container {
    position: relative;
    z-index: 1;
}

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

.hero-title {
    font-family: var(--font-secondary);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-fast);
    display: inline-block;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ==================== */
/* Section Headers */
/* ==================== */

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

.section-label {
    display: inline-block;
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary);
    margin-bottom: var(--spacing-sm);
}

.section-title {
    font-family: var(--font-secondary);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

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

/* ==================== */
/* About Section */
/* ==================== */

.about-section {
    background: var(--bg-primary);
}

.about-content {
    display: grid;
    gap: var(--spacing-lg);
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
}

.about-text .lead {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.about-text p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

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

.feature-card {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.feature-icon {
    margin-bottom: var(--spacing-sm);
}

.feature-icon i {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
    stroke-width: 1.5;
}

.feature-card h3 {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==================== */
/* Author Section */
/* ==================== */

.author-section {
    background: var(--bg-secondary);
}

.author-content {
    max-width: 900px;
    margin: 0 auto;
}

.author-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-lg);
    align-items: start;
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.author-image {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.author-name {
    font-family: var(--font-secondary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.author-title {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-md);
}

.author-bio p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.author-credentials {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.author-credentials ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.author-credentials li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    padding-left: 1.2rem;
    position: relative;
}

.author-credentials li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

@media (max-width: 768px) {
    .author-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .author-image {
        margin: 0 auto;
        max-width: 200px;
    }
}

/* ==================== */
/* Books Section */
/* ==================== */

.books-section {
    background: var(--bg-secondary);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.book-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.book-cover {
    aspect-ratio: 3 / 4;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.book-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* 추가 */
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    /* 추가 */
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.book-placeholder i {
    width: 80px;
    height: 80px;
    color: var(--accent-primary);
    stroke-width: 1.5;
}

.book-placeholder p {
    /* 새로 추가 */
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin: 0;
}

.book-info {
    padding: var(--spacing-md);
}

.book-title {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    line-height: 1.4;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.book-subtitle {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-tertiary);
}

.book-author {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-sm);
}

.book-awards {
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.book-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.book-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: gap var(--transition-fast);
}

.book-link:hover {
    gap: 0.5rem;
}

/* ==================== */
/* Contact Section */
/* ==================== */

.contact-section {
    background: var(--bg-primary);
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    gap: var(--spacing-md);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.contact-item:hover {
    transform: translateX(8px);
    border-color: var(--accent-primary);
}

.contact-icon {
    flex-shrink: 0;
}

.contact-icon i {
    width: 40px;
    height: 40px;
    color: var(--accent-primary);
    stroke-width: 1.5;
}

.contact-item h3 {
    font-family: var(--font-secondary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.contact-item p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ==================== */
/* Footer */
/* ==================== */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-logo img {
    height: 32px;
    width: auto;
}

.footer-logo .logo-light {
    display: block;
}

.footer-logo .logo-dark {
    display: none;
}

[data-theme="dark"] .footer-logo .logo-light {
    display: none;
}

[data-theme="dark"] .footer-logo .logo-dark {
    display: block;
}

.footer-text {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ==================== */
/* Responsive Design */
/* ==================== */

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        box-shadow: var(--shadow-md);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .mobile-toggle {
        display: flex;
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero {
        min-height: 80vh;
    }

    .section {
        padding: var(--spacing-lg) 0;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .about-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Contact link styles */
.contact-link {
    text-decoration: none;
    color: inherit;
}

.contact-link:hover {
    transform: translateX(8px);
    border-color: var(--accent-primary);
}

/* Book cover image styles */
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Author image styles */
.author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}