/* ===== DESIGN SYSTEM & VARIABLES ===== */
:root {
    /* Minimal Sans-Serif Palette - Dark Navy, Sage Green, Grays */
    --clr-bg: #FDFDFD;
    /* Clean White */
    --clr-bg-alt: #F4F5F6;
    /* Very Light Gray/Sage */
    --clr-primary: #0A1118;
    /* Very Dark Navy / Near Black */
    --clr-secondary: #27372A;
    /* Deep Green Base */
    --clr-accent: #798A7A;
    /* Sage Green */
    --clr-accent-hover: #5A6A5B;
    --clr-text: #222222;
    /* Soft Black for readability */
    --clr-text-light: #555555;

    /* Typography - All Sans Serif */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;

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

    /* Shadows & Transitions */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 40px rgba(10, 17, 24, 0.1);
    --shadow-green: 0 4px 20px rgba(121, 138, 122, 0.25);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--clr-primary);
    font-weight: 600;
    /* Bolder sans-serif */
    line-height: 1.15;
    letter-spacing: -0.5px;
}

h4,
h5 {
    letter-spacing: 0;
}

p {
    margin-bottom: var(--sp-md);
}

strong {
    font-weight: 700;
    color: var(--clr-primary);
}

em {
    font-style: italic;
}

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

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

/* ===== LAYOUT & UTILITIES ===== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.narrow-container {
    max-width: 800px;
}

.medium-container {
    max-width: 1000px;
    margin: 0 auto;
}

.section-padding {
    padding: var(--sp-xxl) 0;
}

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

.bg-alt {
    background-color: var(--clr-bg-alt);
}

.mb-md {
    margin-bottom: var(--sp-md);
}

.mb-lg {
    margin-bottom: var(--sp-lg);
}

.mb-xl {
    margin-bottom: var(--sp-xl);
}

.mt-lg {
    margin-top: var(--sp-lg);
}

.mt-xl {
    margin-top: var(--sp-xl);
}

/* ===== COMPONENTS ===== */
/* Buttons */
.cta-button {
    display: inline-block;
    background-color: var(--clr-primary);
    color: var(--clr-bg);
    padding: 1.25rem 3rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    border-radius: 4px;
    /* Slight rounding to soften */
    border: none;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-transform: uppercase;
}

.cta-button::active {
    transform: scale(0.98);
}

.cta-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--clr-accent);
    z-index: -1;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-button:hover {
    color: var(--clr-bg);
    box-shadow: var(--shadow-green);
}

.cta-button:hover::after {
    transform: translateY(0);
}

.primary-action {
    background-color: var(--clr-accent);
    color: var(--clr-bg);
    box-shadow: var(--shadow-green);
}

.primary-action::after {
    background-color: var(--clr-primary);
}


/* ===== SECTIONS ===== */

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: var(--sp-xxl) 0;
    background: radial-gradient(circle at 70% 50%, rgba(121, 138, 122, 0.08), transparent 60%);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-xl);
}

.hero-left {
    flex: 1;
    max-width: 650px;
}

.hero-left h1 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    margin-bottom: var(--sp-lg);
    color: var(--clr-primary);
    line-height: 1.1;
}

.hero-description {
    font-size: 1.3rem;
    color: var(--clr-text);
    margin-bottom: var(--sp-xl);
    line-height: 1.6;
    border-left: 4px solid var(--clr-accent);
    padding-left: 1.5rem;
}

.hero-right {
    flex: 1;
    display: flex;
    justify-content: center;
}

.book-image {
    max-width: 500px;
    width: 80%;
}

/* Intro Section */
.intro h2 {
    font-size: clamp(2rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 2px;
    color: var(--clr-primary);
}

.lead-text {
    font-size: 1.5rem;
    line-height: 1.7;
    color: var(--clr-primary);
    font-weight: 500;
}

/* Parts Section */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--sp-lg);
}

.part-card {
    background-color: var(--clr-bg);
    padding: 3rem 2.5rem;
    border: 1px solid rgba(10, 17, 24, 0.08);
    border-radius: 8px;
    /* Slight border radius added */
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.part-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: var(--clr-primary);
    transition: var(--transition);
}

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

.part-card:hover::before {
    background-color: var(--clr-accent);
}

.part-card h4 {
    color: var(--clr-accent);
    font-size: 0.95rem;
    letter-spacing: 2px;
    margin-bottom: var(--sp-sm);
    font-weight: 700;
}

.part-card h5 {
    font-size: 1.6rem;
    margin-bottom: var(--sp-md);
    font-weight: 800;
}

.part-card p {
    font-size: 1.05rem;
    color: var(--clr-text-light);
}

/* Author Section */
.author-quote {
    font-family: var(--font-body);
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    color: var(--clr-primary);
    margin: 0 auto;
    max-width: 900px;
    line-height: 1.4;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0;
}

.author-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.author-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: var(--sp-md);
    border: 4px solid var(--clr-bg);
    box-shadow: 0 0 0 2px var(--clr-accent), var(--shadow-soft);
}

.author-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--clr-primary);
}

.author-title {
    font-size: 0.85rem;
    color: var(--clr-accent);
    letter-spacing: 2px;
    font-weight: 700;
}

/* Personal Message Section */
.personal-message-section p {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
}

.personal-message-section h3 {
    font-size: 2rem;
    font-weight: 800;
}

/* Look Inside Section */
.tiles-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 850px;
    margin: 0 auto;
}

.tile {
    display: flex;
    align-items: flex-start;
    background-color: var(--clr-bg);
    padding: 1.75rem 2rem;
    border: 1px solid rgba(10, 17, 24, 0.08);
    border-left: 6px solid var(--clr-primary);
    border-radius: 8px;
    /* Slight border radius */
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.tile:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-hover);
    border-left-color: var(--clr-accent);
}

.tile span {
    font-size: 2.2rem;
    color: rgba(121, 138, 122, 0.3);
    /* Sage slightly faded */
    font-weight: 800;
    margin-right: 1.5rem;
    min-width: 55px;
    line-height: 1;
    transition: color 0.4s ease;
}

.tile:hover span {
    color: var(--clr-accent);
}

.tile-title {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    color: var(--clr-primary);
    font-weight: 700;
}

.tile p {
    margin: 0;
    font-size: 1.05rem;
    color: var(--clr-text-light);
}

/* Footer */
.footer {
    background-color: var(--clr-primary);
    color: var(--clr-bg);
    padding: var(--sp-xl) 0 var(--sp-lg);
    border-top: 6px solid var(--clr-accent);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-md);
}

.footer-links {
    display: flex;
    gap: var(--sp-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--clr-bg);
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--clr-accent);
}

.copyright {
    color: rgba(253, 251, 247, 0.4);
    font-size: 0.85rem;
    margin-top: var(--sp-md);
}

/* ===== ANIMATIONS ===== */
.fade-in-up {
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scroll Animations */
.scroll-anim {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.scroll-anim.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-left {
        max-width: 100%;
    }

    .hero {
        padding-top: var(--sp-xxl);
    }

    .hero-description {
        border-left: none;
        padding-left: 0;
    }

    .tile {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
    }

    .tile span {
        margin-bottom: 0.5rem;
    }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 17, 24, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--clr-bg);
    width: 90%;
    max-width: 500px;
    padding: 3.5rem 2.5rem 3rem;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 6px solid var(--clr-primary);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--clr-text-light);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--clr-primary);
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-desc {
    text-align: center;
    color: var(--clr-text-light);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.email-input {
    width: 100%;
    padding: 1.25rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid rgba(10, 17, 24, 0.2);
    border-radius: 4px;
    background-color: var(--clr-bg-alt);
    color: var(--clr-text);
    transition: border-color 0.3s ease;
    outline: none;
}

.email-input:focus {
    border-color: var(--clr-primary);
    background-color: var(--clr-bg);
    box-shadow: 0 0 0 3px rgba(10, 17, 24, 0.05);
}

.submit-btn {
    width: 100%;
    text-align: center;
    cursor: pointer;
    margin-top: 0.5rem;
}

.submit-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Spinner Loader */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.success-message {
    text-align: center;
    padding: 2rem 0;
}

.success-message h4 {
    color: var(--clr-accent);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-message {
    color: #d9534f;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}