:root {
    /* Colors */
    --color-black: #000;
    --color-white: #fff;
    --color-text: #1a1a1a;
    --color-text-secondary: #555;
    --color-text-tertiary: #666;
    --color-text-quaternary: #999;
    --color-text-placeholder: #ccc;
    --color-border: #e0e0e0;
    --color-link: #0066cc;
    --color-link-dark: #006699;
    --color-accent: #D84;

    /* Semantic */
    --color-bg: var(--color-white);
    --color-bg-inverse: var(--color-black);
    --color-bg-header: var(--color-white);

    /* Fonts */
    --font-system: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-serif: "Noto Serif", serif;
    --font-sans: "Noto Sans", sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

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

/* Base */
body {
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
}

/* Typography Utilities */
.font-sans {
    font-family: var(--font-sans);
    font-optical-sizing: auto;
    font-variation-settings: "wdth" 100;
}

.font-serif {
    font-family: var(--font-serif);
    font-optical-sizing: auto;
    font-weight: 400;
    font-variation-settings: "wdth" 100;
}

/* Links */
a {
    color: var(--color-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================================
   Layouts & Page Specifics
   ========================================= */

/* Home Page Layout */
body.page-home {
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-system);
    text-rendering: optimizeLegibility;
}

body.page-home main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    gap: var(--spacing-xl);
}

body.page-home footer {
    padding: var(--spacing-lg);
    text-align: center;
}

body.page-home footer p {
    color: var(--color-text-quaternary);
    font-size: 0.875rem;
    font-weight: 300;
}

/* Book Page Layout */
body.page-book {
    font-family: var(--font-serif);
}

.top-stripe {
    background-color: var(--color-bg-inverse);
    height: 15px;
}

.page-book header {
    background-color: var(--color-bg-header);
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.page-book main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.page-book .content {
    max-width: 600px;
}

.sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
}

/* =========================================
   Components
   ========================================= */

/* Logo */
.logo {
    width: 100%;
    height: auto;
}

.page-home .logo {
    max-width: 600px;
}

.page-book .logo {
    width: 80px;
    height: 80px;
    display: block;
    margin: 0 auto var(--spacing-md);
}

/* Logo Animation (Home) */
@keyframes slideThermometer {
    from { transform: translateX(-370px); }
    to { transform: translateX(0); }
}

.logo #Head {
    transform: translateX(-370px);
    animation: slideThermometer 0.75s ease-in-out 0.5s forwards;
}

/* Navigation (Book Page) */
nav {
    text-align: center;
    font-family: var(--font-sans);
    font-optical-sizing: auto;
    font-variation-settings: "wdth" 100;
}

nav a {
    font-size: 0.9rem;
    font-weight: 500;
}

nav span {
    color: var(--color-text-tertiary);
}

/* Book Cover & Links */
.book-link {
    display: block;
    max-width: 225px;
    width: 100%;
    transition: transform 0.2s ease;
}

.book-link:hover {
    transform: scale(1.05);
    text-decoration: none;
}

.book-cover {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-book .book-cover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.book-cover-figure {
    max-width: 370px;
    margin: 0 0 1.5rem 0;
}

.book-cover-mobile {
    display: none;
}

.download-link {
    display: block;
    text-align: center;
    color: var(--color-link-dark);
    text-decoration: none;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-family: var(--font-sans);
    font-weight: 400;
}

.download-link svg {
    vertical-align: bottom;
    height: 1.25rem;
}

/* Typography Components */
h1 {
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text-secondary);
}

.author {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 2rem;
    color: var(--color-text-secondary);
}

/* Blurb & Praise */
.blurb {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.blurb::before,
.praise-item::before {
    content: '“';
    position: absolute;
    font-size: 6rem;
    line-height: 1;
    color: var(--color-text-placeholder);
    font-weight: 300;
}

.blurb::before {
    left: -3rem;
    top: -1rem;
}

.blurb .big,
.praise-item .big {
    font-weight: 700;
}

.blurb .big { font-size: 1.15em; }
.praise-item .big { font-size: 1.05em; }

.synopsis {
    margin-bottom: 2rem;
}

.synopsis p {
    margin-bottom: 1rem;
}

.praise {
    margin-bottom: 2rem;
}

.praise-item {
    margin-bottom: 2.5rem;
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 400;
    position: relative;
}

.praise-item::before {
    left: -2rem;
    top: -0.5rem;
    font-size: 4rem;
}

.praise-attribution {
    font-style: italic;
    font-weight: 400;
    color: var(--color-text-tertiary);
    margin-top: 0.5rem;
}

.advance-praise h2,
.about-author h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.about-author h2 {
    margin-bottom: 1rem;
}

.advance-praise,
.about-author {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.author-photo {
    float: left;
    width: 200px;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Buy Links */
.buy-links {
    font-family: var(--font-sans);
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: fit-content;
}

.buy-links h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    grid-column: 1 / -1;
}

.buy-links a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    color: var(--color-link);
    text-decoration: none;
    border: 2px solid var(--color-link);
    font-family: var(--font-sans);
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
    min-height: 0;
    position: relative; /* For absolute positioning of small tag if needed, though original didn't use it on a, but small had absolute */
}

.buy-links a small {
    display: block;
    font-size: 0.6rem;
    font-weight: 400;
    margin-top: 0;
    position: absolute;
    margin-top: 50px; /* Kept from original */
    background-color: var(--color-accent);
    color: var(--color-white);
    border-radius: 8px;
    padding: 0 5px;
}

.buy-links a:hover {
    background-color: var(--color-link);
    color: var(--color-white);
    text-decoration: none;
}

/* Metadata */
.metadata {
    font-size: 0.9rem;
    font-family: var(--font-sans);
    font-optical-sizing: auto;
    font-variation-settings: "wdth" 100;
    line-height: 1.25;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.metadata-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metadata-item strong {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    padding-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Copy Button */
.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--color-text-tertiary);
    vertical-align: middle;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    vertical-align: top;
}

.copy-btn:hover {
    color: var(--color-link);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Contact Section */
.contact-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    font-family: var(--font-sans);
}

.contact-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-section p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Mobile / Responsive */
@media (max-width: 768px) {
    .page-book main {
        display: block;
    }

    h1 {
        font-size: 2rem;
    }

    .sidebar {
        margin-top: 3rem;
    }

    .sidebar .book-cover-figure {
        display: none;
    }

    .book-cover-mobile {
        display: block;
        position: static;
        margin-bottom: 2rem;
    }

    .book-cover-figure {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.5rem;
    }

    .author {
        margin-bottom: 1rem;
    }

    .blurb {
        padding-left: 1rem;
    }

    .blurb::before {
        left: -1rem;
        top: -0.5rem;
        font-size: 4rem;
    }

    .praise-item {
        padding-left: 1rem;
    }

    .praise-item::before {
        left: -1rem;
        top: -0.25rem;
        font-size: 4rem;
    }
}
