/* ===========================================
   DevSmith — 코드를 벼리는 대장장이
   Publisher Homepage Styles
   Theme: Dark Forge / Blacksmith
   =========================================== */

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

:root {
    --bg-dark: #0b0a09;
    --bg-card: #151310;
    --bg-card-hover: #1c1915;
    --text-primary: #e8e0d4;
    --text-secondary: #a09888;
    --text-muted: #6b6058;
    --accent: #d4740e;
    --accent-light: #e8960f;
    --accent-glow: rgba(212, 116, 14, 0.25);
    --border: #2a2420;
    --border-light: #3a3430;
    --font-sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Noto Serif KR', Georgia, serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent);
}

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

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.2rem 0;
    transition: all 0.3s ease;
}

.nav.scrolled {
    background: rgba(11, 10, 9, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0;
}

.nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-logo:hover {
    color: var(--accent-light);
}

.logo-anvil {
    color: var(--accent);
    margin-right: 0.25rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    transition: all 0.3s;
}

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

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

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

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background:
            radial-gradient(ellipse at 50% 80%, rgba(212, 116, 14, 0.08) 0%, transparent 60%),
            radial-gradient(ellipse at 50% 50%, rgba(30, 25, 20, 1) 0%, var(--bg-dark) 70%);
}

.hero-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.spark {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: sparkFloat 3s ease-in-out infinite;
}

.spark:nth-child(1) { left: 45%; bottom: 30%; animation-delay: 0s; }
.spark:nth-child(2) { left: 50%; bottom: 28%; animation-delay: 0.5s; }
.spark:nth-child(3) { left: 48%; bottom: 32%; animation-delay: 1s; }
.spark:nth-child(4) { left: 52%; bottom: 29%; animation-delay: 1.5s; }
.spark:nth-child(5) { left: 46%; bottom: 31%; animation-delay: 2s; }
.spark:nth-child(6) { left: 54%; bottom: 27%; animation-delay: 2.5s; }

@keyframes sparkFloat {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(1);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx, 30px), -120px) scale(0);
    }
}

.spark:nth-child(1) { --dx: -40px; }
.spark:nth-child(2) { --dx: 20px; }
.spark:nth-child(3) { --dx: -15px; }
.spark:nth-child(4) { --dx: 45px; }
.spark:nth-child(5) { --dx: -30px; }
.spark:nth-child(6) { --dx: 10px; }

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

.hero-label {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.title-dev {
    color: var(--text-primary);
}

.title-smith {
    color: var(--accent);
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.divider-line {
    display: block;
    width: 60px;
    height: 1px;
    background: var(--border-light);
}

.divider-icon {
    color: var(--accent);
    font-size: 1rem;
    opacity: 0.6;
}

.hero-tagline {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
    font-style: italic;
    margin-bottom: 2.5rem;
}

.hero-cta {
    display: inline-block;
    padding: 0.8rem 2.2rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent-light);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    border-radius: 2px;
    transition: all 0.3s;
}

.hero-cta:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* --- Sections --- */
.section {
    padding: 6rem 0;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin: 1rem auto 0;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* --- About --- */
.about {
    background: var(--bg-dark);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2.5rem 2rem;
    transition: all 0.3s;
}

.about-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.about-icon {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.8;
}

/* --- Book --- */
.book {
    background:
            linear-gradient(to bottom, var(--bg-dark), #0f0d0b, var(--bg-dark));
}

.book-showcase {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    align-items: start;
}

.book-cover {
    position: relative;
    perspective: 800px;
}

.book-cover-inner {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 2px 8px 8px 2px;
    overflow: hidden;
    box-shadow:
            8px 8px 30px rgba(0,0,0,0.5);
    transform: rotateY(-5deg);
    transition: transform 0.4s;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px 8px 8px 2px;
}

.book-cover:hover .book-cover-inner {
    transform: rotateY(0deg);
}

.book-spine {
    position: absolute;
    left: -4px;
    top: 5%;
    bottom: 5%;
    width: 4px;
    background: linear-gradient(to bottom, var(--accent), #8b5e0a);
    border-radius: 2px 0 0 2px;
}

.book-cover-placeholder {
    text-align: center;
}

.book-cover-logo {
    display: block;
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
}

.book-cover-title {
    display: block;
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.6;
}

.book-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.book-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.book-tagline {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.book-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.9;
    margin-bottom: 2rem;
}

.book-toc {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.book-toc h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.toc-parts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.toc-part {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

.toc-part strong {
    color: var(--accent);
    margin-right: 0.5rem;
}

.toc-chapters {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.book-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.book-links-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.book-stores {
    display: flex;
    gap: 0.75rem;
}

.store-link {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.2s;
}

.store-link:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--bg-card-hover);
}

/* --- Author --- */
.author {
    background: var(--bg-dark);
}

.author-card {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    max-width: 700px;
    margin: 2rem auto 0;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.author-avatar {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent), #8b5e0a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--bg-dark);
}

.author-name {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.author-role {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.author-bio {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* --- Contact --- */
.contact {
    background: #0f0d0b;
}

.contact-grid {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

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

.contact-item h4 {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

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

.contact-item a:hover {
    color: var(--accent-light);
}

/* --- Footer --- */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
}

.footer-inner {
    text-align: center;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.footer-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .book-showcase {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        justify-items: center;
    }

    .book-cover {
        width: 220px;
    }

    .toc-parts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(11, 10, 9, 0.98);
        backdrop-filter: blur(12px);
        padding: 1.5rem 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .section {
        padding: 4rem 0;
    }

    .container {
        padding: 0 1.25rem;
    }

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

    .author-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
    }

    .contact-grid {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
    }

    .book-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .book-stores {
        flex-wrap: wrap;
    }
}