:root {
    --base: #ffffff;
    --base-2: #f7f8f9;
    --base-3: #ffffff;
    --contrast: #222222;
    --contrast-2: #575760;
    --contrast-3: #b2b2be;
    --text: #3c4956;
    --accent: #9fb8ad;
    --accent-dark: #465362;
    --accent-soft: #dde5ce;
    --shadow: 5px 5px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 26px 45px rgba(34, 34, 34, 0.18);
    --radius-pill: 35px;
    --radius-md: 12px;
    --container: 1200px;
    --transition: 200ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sorts Mill Goudy', serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text);
    background: var(--base);
    min-height: 100vh;
}

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

a:hover,
a:focus {
    color: var(--contrast);
}

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

.skip-link {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 2px solid var(--accent);
    background: var(--base-3);
    color: var(--contrast);
    transform: translateY(-200%);
    transition: transform var(--transition);
    z-index: 1000;
}

.skip-link:focus {
    transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

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

.section {
    padding: 7rem 0;
}

.section-kicker {
    font-family: 'Dancing Script', cursive;
    font-size: 20px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.section-kicker.center,
.center {
    text-align: center;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Dancing Script', cursive;
    font-weight: 500;
    color: var(--accent-dark);
}

h1 {
    font-size: clamp(2.4rem, 4vw, 3.2rem);
    letter-spacing: 2px;
}

h2 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
}

p {
    margin-bottom: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.header-wrap {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 10;
}

.site-header {
    background: transparent;
    padding: 60px 0 30px;
    text-align: center;
}

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

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(247, 248, 249, 0.96);
    border-top: 1px solid rgba(34, 34, 34, 0.08);
    border-bottom: 1px solid rgba(34, 34, 34, 0.08);
    backdrop-filter: blur(6px);
}

.nav {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 30px;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    font-size: 24px;
}

.nav-links a {
    color: var(--contrast);
    padding: 6px 14px;
    border-radius: 999px;
    transition: color var(--transition), background var(--transition);
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--accent-dark);
    background: rgba(159, 184, 173, 0.2);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(70, 83, 98, 0.3);
    background: var(--base-3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: column;
    position: absolute;
    right: 0;
}

.nav-toggle span {
    width: 18px;
    height: 2px;
    background: var(--accent-dark);
    border-radius: 999px;
}

.nav-backdrop {
    display: none;
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    background-color: var(--accent-dark);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../assets/images/hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.82;
}

.hero-card {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0 20px 8vh;
    border: 1px solid var(--base-3);
    background: rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(2px);
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: #ffffff;
    margin: 0 0 8px;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    color: #ffffff;
    margin: 0;
}

.hero-subtitle mark {
    background: none;
    color: var(--accent-soft);
}

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: grid;
    place-items: center;
    color: #ffffff;
    animation: float 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, 0);
    }
    50% {
        transform: translate(-50%, -6px);
    }
}

/* Buttons */
.btn,
button.btn,
button[type='submit'] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Dancing Script', cursive;
    font-weight: 600;
    font-size: 22px;
    padding: 10px 30px 12px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
}

.btn:hover,
button.btn:hover,
button[type='submit']:hover {
    transform: translateY(-2px);
    background: var(--accent-dark);
}

.btn-outline {
    background: transparent;
    color: var(--accent-dark);
    border: 2px solid var(--accent-dark);
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 80px;
    align-items: center;
}

.about-portrait {
    position: relative;
}

.about-portrait img {
    width: 100%;
    min-height: 600px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.quote-card {
    padding: 60px;
    margin-top: -200px;
    margin-right: 60px;
    background: var(--contrast-2);
    color: #ffffff;
}

.quote-card .quote {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    margin-bottom: 2em;
    color: #ffffff;
}

.quote-card .quote-author {
    font-size: 14px;
    text-align: right;
    text-transform: capitalize;
}

/* Books */
.books {
    background: var(--base-2);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.book-card {
    text-align: center;
}

.book-card-link {
    display: block;
    color: inherit;
}

.book-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.book-card h4 {
    padding: 10px 0;
}

.section-cta {
    margin-top: 40px;
    text-align: center;
}

/* Contact */
.contact-form {
    margin-top: 32px;
    display: grid;
    gap: 18px;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px;
    background: var(--base-3);
    border: 1px solid rgba(34, 34, 34, 0.12);
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

input,
textarea {
    border-radius: 8px;
    border: 1px solid rgba(34, 34, 34, 0.2);
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--base-3);
}

textarea {
    resize: vertical;
}

.form-status {
    min-height: 24px;
    font-weight: 600;
    color: var(--accent-dark);
}

.form-status.is-success {
    color: #2f6d50;
}

.form-status.is-error {
    color: #b04b3d;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-hint {
    margin-top: 12px;
    text-align: center;
}

/* Follow */
.follow {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--contrast-3);
    overflow: hidden;
    padding: 0;
}

.follow::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../assets/images/follow.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.62;
}

.follow-card {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    margin: 0 20px;
    border: 1px solid var(--base-3);
    background: rgba(0, 0, 0, 0.18);
    color: #ffffff;
    text-align: center;
}

.follow-card h2 {
    color: #ffffff;
}

.social-links {
    display: flex;
    gap: 20px;
    padding-top: 20px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 40px;
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
    transition: background var(--transition), color var(--transition);
}

.social-btn:hover,
.social-btn:focus {
    background: var(--accent);
    color: #ffffff;
}

/* Page banner */
.page-banner {
    height: 650px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--base-3);
}

.page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../assets/images/page-banner.jpg');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
    background-attachment: fixed;
    opacity: 0.9;
}

.banner-card {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    margin-bottom: 150px;
    border: 1px solid var(--base-3);
    background: rgba(0, 0, 0, 0.12);
    color: #ffffff;
}

.banner-card h1 {
    color: #ffffff;
}

/* Book detail */
.book-detail {
    background: var(--base-3);
}

.book-detail.alt {
    background: var(--base-2);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    align-items: start;
}

.detail-covers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.detail-covers img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.tab-group {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-button {
    display: inline-flex;
    padding: 12px 26px;
    border-radius: var(--radius-pill);
    background: var(--contrast-2);
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-family: 'Dancing Script', cursive;
    font-size: 20px;
}

.tab-button.is-active {
    background: var(--accent);
}

.tab-panels {
    margin-top: 24px;
}

.tab-panel {
    display: block;
}

.tab-group.tabs-ready .tab-panel {
    display: none;
}

.tab-group.tabs-ready .tab-panel.is-active {
    display: block;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.gallery-grid img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

/* Legal */
.legal {
    padding-top: 6rem;
}

.legal h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.6rem;
}

.legal p {
    max-width: 820px;
}

.legal-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(70, 83, 98, 0.2);
}

/* Footer */
.site-footer {
    background: var(--accent);
    color: #ffffff;
    padding: 20px 0;
    text-align: center;
}

.site-footer a {
    color: #ffffff;
    text-decoration: underline;
}

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

    .quote-card {
        margin-top: -120px;
        margin-right: 0;
        padding: 40px;
    }

    .detail-covers img {
        height: 320px;
    }
}

@media (max-width: 900px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        flex-direction: column;
        padding: 120px 32px 32px;
        background: var(--base-3);
        gap: 22px;
        transition: right var(--transition);
        box-shadow: var(--shadow-lg);
        z-index: 200;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(19, 28, 34, 0.3);
        display: none;
        z-index: 150;
    }

    body.menu-open .nav-backdrop {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .hero::before,
    .follow::before,
    .page-banner::before {
        background-attachment: initial;
    }

    .hero-card {
        padding: 12px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .page-banner {
        height: 520px;
    }

    .banner-card {
        margin-bottom: 100px;
    }

    .contact-form {
        padding: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
