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

:root {
    --cream: #F6F1EB;
    --warm-white: #FDFBF8;
    --ink: #2C2418;
    --ink-light: #5C4F3D;
    --ink-faint: #9E9283;
    --terracotta: #B8704B;
    --terracotta-soft: #C4896A;
    --gold-muted: #C9A96E;
    --rule: #DDD5C9;
    --card-bg: #FDFCFA;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    color: var(--ink);
    background-color: var(--warm-white);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
}

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

section {
    padding: 5rem 0;
}

/* ---- Nav ---- */

nav {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--rule);
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
}

.nav-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.nav-brand span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
}

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

.nav-links a {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-light);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.3s;
}

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

/* Language toggle */

.lang-toggle {
    display: flex;
    gap: 0;
    align-items: center;
    margin-left: 0.5rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow: hidden;
}

.lang-btn {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
    transition: color 0.3s, background-color 0.3s;
}

.lang-btn:first-child {
    border-right: 1px solid var(--rule);
}

.lang-btn-active {
    color: var(--warm-white);
    background: var(--ink);
}

.lang-btn:not(.lang-btn-active):hover {
    color: var(--terracotta);
}

/* ---- Hero ---- */

.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative;
}

.hero::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--gold-muted);
    margin: 0 auto;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.hero-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    object-fit: contain;
}

.hero h1 {
    font-size: clamp(2.8rem, 6vw, 4.2rem);
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.hero h1 em {
    font-style: italic;
    color: var(--terracotta);
}

.hero p {
    font-size: 1.1rem;
    color: var(--ink-faint);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.8;
}

.hero .founder-credit {
    font-size: 0.85rem;
    color: var(--ink-faint);
    margin-top: 1.5rem;
    letter-spacing: 0.05em;
}

.hero-ctas {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.hero-ctas a {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--terracotta);
    text-decoration: none;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--terracotta-soft);
    padding-bottom: 2px;
    transition: color 0.3s, border-color 0.3s;
}

.hero-ctas a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* ---- Our Story ---- */

.our-story {
    text-align: center;
}

.our-story h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.our-story p {
    max-width: 600px;
    margin: 0 auto 1.2rem;
    color: var(--ink-light);
    font-size: 0.95rem;
    line-height: 1.85;
}

.pull-quote {
    max-width: 560px;
    margin: 2.5rem auto;
    padding: 1.5rem 2rem;
    border-left: 3px solid var(--gold-muted);
    text-align: left;
}

.pull-quote p {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--ink);
    max-width: none;
    margin: 0;
}

.pull-quote cite {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-style: normal;
    font-size: 0.8rem;
    color: var(--ink-faint);
    margin-top: 0.8rem;
    letter-spacing: 0.03em;
}

/* ---- Divider ornament ---- */

.ornament {
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    color: var(--rule);
    letter-spacing: 0.5em;
    padding: 1rem 0;
}

/* ---- Ukrainian Heritage ---- */

.heritage {
    background: var(--cream);
}

.heritage h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.heritage > .container > .subtitle {
    text-align: center;
    color: var(--ink-faint);
    font-size: 0.95rem;
    margin-bottom: 3rem;
}

.sub-collection {
    margin-bottom: 3.5rem;
}

.sub-collection:last-child {
    margin-bottom: 0;
}

.sub-collection-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.6rem;
}

.sub-collection-header h3 {
    font-size: 1.4rem;
    font-weight: 400;
}

.sub-collection-link {
    font-size: 0.8rem;
    color: var(--terracotta);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.3s;
    white-space: nowrap;
}

.sub-collection-link:hover {
    color: var(--ink);
}

/* Book shelf */

.book-shelf {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: nowrap;
}

.book-item {
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.book {
    width: 160px;
    height: 230px;
    position: relative;
    transition: transform 0.4s ease, filter 0.4s ease;
    margin: 0 auto 1.2rem;
}

.book-item:hover .book {
    transform: translateY(-8px);
    filter: drop-shadow(0 12px 20px rgba(44, 36, 24, 0.2));
}

.book .cover {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.2rem;
    overflow: hidden;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 4px 8px rgba(44, 36, 24, 0.15));
    opacity: 0;
    transition: opacity 1s ease;
}

.book .cover.cover-active {
    opacity: 1;
}

/* Books with only one cover don't need the transition setup */
.book:not(.book-rotate) .cover {
    opacity: 1;
    transition: none;
}

.book .cover.has-image .cover-label,
.book .cover.has-image .cover-title,
.book .cover.has-image .cover-author {
    display: none;
}

.cover-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.55rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.3rem;
}

.cover-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.25;
}

.cover-author {
    font-family: 'Outfit', sans-serif;
    font-size: 0.55rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.book .spine,
.book .pages {
    display: none;
}

.book-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--ink);
    max-width: 160px;
}

.book-tag {
    font-size: 0.7rem;
    color: var(--ink-faint);
    margin-top: 0.25rem;
}

/* Language badges */

.lang-badges {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.lang-badge {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    background: var(--warm-white);
    border: 1px solid var(--rule);
    border-radius: 9px;
    padding: 0.1rem 0.45rem;
    transition: color 0.4s, border-color 0.4s, background-color 0.4s;
}

.lang-badge.lang-active {
    color: var(--terracotta);
    border-color: var(--terracotta-soft);
    background: rgba(184, 112, 75, 0.08);
}

/* Cover themes */

.cover-ukraine {
    background: linear-gradient(145deg, #1a3a5c 0%, #2d5a7b 30%, #c9a96e 100%);
    color: #f5f0e8;
}
.cover-ukraine .cover-label { color: #c9a96e; }

.cover-japan {
    background: linear-gradient(160deg, #2C2418 0%, #4a3728 40%, #b8704b 100%);
    color: #f5f0e8;
}
.cover-japan .cover-label { color: #c4896a; }

.cover-bedtime {
    background: linear-gradient(150deg, #2b3a4e 0%, #4b6584 40%, #7f9bb3 100%);
    color: #f5f0e8;
}
.cover-bedtime .cover-label { color: #a8c4db; }

.cover-curious {
    background: linear-gradient(155deg, #3d6b4f 0%, #5a9e6f 40%, #8dc49e 100%);
    color: #f5f0e8;
}
.cover-curious .cover-label { color: #d4eedd; }

.cover-christmas {
    background: linear-gradient(150deg, #6b2028 0%, #a03040 40%, #d4626e 100%);
    color: #f5f0e8;
}
.cover-christmas .cover-label { color: #f0d0c8; }

.cover-mythology {
    background: linear-gradient(145deg, #2a1f3d 0%, #4a3668 40%, #8b6fad 100%);
    color: #f5f0e8;
}
.cover-mythology .cover-label { color: #c9b6e0; }


/* Decorative elements on covers */
.cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.06;
    background-image:
        radial-gradient(circle at 20% 20%, white 1px, transparent 1px),
        radial-gradient(circle at 60% 40%, white 1px, transparent 1px),
        radial-gradient(circle at 80% 15%, white 1px, transparent 1px),
        radial-gradient(circle at 40% 70%, white 1px, transparent 1px),
        radial-gradient(circle at 75% 65%, white 1px, transparent 1px);
    pointer-events: none;
}

.cover::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 1px;
    pointer-events: none;
}

/* CTA under shelf */
.shelf-cta {
    text-align: center;
    margin-top: 3.5rem;
}

.shelf-cta a {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--terracotta);
    text-decoration: none;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--terracotta-soft);
    padding-bottom: 2px;
    transition: color 0.3s, border-color 0.3s;
}

.shelf-cta a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* ---- Collections ---- */

.collections h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.6rem;
}

.collections .subtitle {
    text-align: center;
    color: var(--ink-faint);
    font-size: 0.95rem;
    margin-bottom: 3.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--rule);
    padding: 2.2rem 2rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: var(--terracotta-soft);
    transform: translateY(-3px);
}

.card-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--terracotta);
    margin-bottom: 0.8rem;
}

.card h3 {
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.8rem;
}

.card p {
    font-size: 0.88rem;
    color: var(--ink-light);
    line-height: 1.7;
    flex-grow: 1;
}

.card .book-count {
    font-size: 0.75rem;
    color: var(--ink-faint);
    margin-top: 0.6rem;
}

.card .card-arrow {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--ink-faint);
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.card:hover .card-arrow {
    color: var(--terracotta);
}

/* ---- Footer ---- */

footer {
    border-top: 1px solid var(--rule);
    padding: 2.5rem 0;
    text-align: center;
}

footer p {
    font-size: 0.8rem;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
}

footer a {
    color: var(--ink-faint);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--terracotta);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .book-shelf {
        gap: 2rem 1.5rem;
    }

    .book {
        width: 130px;
        height: 187px;
    }

    .cover-title {
        font-size: 1rem;
    }

    .cover {
        padding: 1rem;
    }

    .cover::after {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .pull-quote {
        padding: 1.2rem 1.5rem;
    }

    .pull-quote p {
        font-size: 1.15rem;
    }

    .sub-collection-header {
        flex-direction: column;
        gap: 0.3rem;
    }
}

@media (max-width: 640px) {
    html, body {
        overflow-x: hidden;
    }

    .container {
        padding: 0 1.2rem;
    }

    .hero {
        padding: 2rem 0 2rem;
    }

    .hero-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
    }

    section {
        padding: 3.5rem 0;
    }

    .nav-brand span {
        font-size: 0.85rem;
        display: block;
    }

    nav {
        padding: 0.8rem 0;
    }

    .nav-hide-mobile {
        display: none !important;
    }

    .nav-links {
        gap: 0.8rem;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .lang-toggle {
        margin-left: 0;
    }

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

    .card {
        padding: 1.8rem 1.5rem;
    }

    .book-shelf {
        gap: 1.8rem 1.2rem;
    }

    .book {
        width: 115px;
        height: 165px;
    }

    .cover-title {
        font-size: 0.85rem;
    }

    .cover-label {
        font-size: 0.5rem;
    }

    .cover-author {
        font-size: 0.48rem;
    }

    .book-title {
        font-size: 0.9rem;
    }

    .hero-ctas {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .pull-quote {
        padding: 1rem 1.2rem;
    }

    .pull-quote p {
        font-size: 1.1rem;
    }
}

/* ---- Fade-in animation ---- */

.fade-in {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.8s ease forwards;
}

.fade-in-d1 { animation-delay: 0s; }
.fade-in-d2 { animation-delay: 0.1s; }
.fade-in-d3 { animation-delay: 0.2s; }
.fade-in-d4 { animation-delay: 0.3s; }
.fade-in-d5 { animation-delay: 0.4s; }
.fade-in-d6 { animation-delay: 0.5s; }

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

/* Scroll-triggered fade */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
