/* ---------- Color palette and global settings ---------- */

:root {
    --page-background: #f4f4f2;
    --surface: #ffffff;
    --alternate-surface: #e9e9e6;
    --dark-surface: #292b2d;
    --text: #292929;
    --muted-text: #64676a;
    --border: #d5d5d1;
    --accent: #4b5054;
    --accent-hover: #292d30;
    --light-text: #f8f8f6;
    --content-width: 1100px;
    --shadow: 0 14px 34px rgba(25, 28, 30, 0.1);
}


/* ---------- Basic reset ---------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background-color: var(--page-background);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}


/* ---------- Shared layout ---------- */

.container {
    width: min(var(--content-width), 90%);
    margin-inline: auto;
}

.section {
    padding: 5.5rem 0;
}

.alternate-section {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background-color: var(--alternate-surface);
}

.eyebrow {
    margin-bottom: 0.6rem;
    color: var(--muted-text);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    line-height: 1.2;
}

h1 {
    max-width: 750px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 7vw, 5.4rem);
    font-weight: 500;
    letter-spacing: -0.035em;
}

h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.02em;
}

h3 {
    margin-top: 0;
}

.section-introduction,
.about-introduction {
    max-width: 800px;
    color: var(--muted-text);
    font-size: 1.08rem;
}

.section-action {
    margin-top: 2.75rem;
    text-align: center;
}


/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    background-color: rgba(244, 244, 242, 0.95);
    backdrop-filter: blur(10px);
}

.site-header .container,
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: bold;
    text-decoration: none;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navigation a {
    color: var(--muted-text);
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
}

.navigation a:hover,
.navigation a:focus {
    color: var(--text);
    text-decoration: underline;
}


/* ---------- Hero ---------- */

.hero {
    min-height: auto;
    padding: 5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 6rem);
}

.hero-content {
    max-width: 760px;
}

.hero-description {
    max-width: 690px;
    margin: 1.5rem 0 2rem;
    color: var(--muted-text);
    font-size: 1.15rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-portrait {
    justify-self: end;
    width: min(100%, 370px);
}

.hero-portrait img {
    width: 100%;
    aspect-ratio: 4 / 5;
    border: 10px solid var(--page-background);
    border-radius: 4px;
    object-fit: cover;
    object-position: center;
    box-shadow: var(--shadow);
}


/* ---------- Buttons ---------- */

.button {
    display: inline-block;
    padding: 0.85rem 1.25rem;
    border: 2px solid var(--accent);
    border-radius: 4px;
    color: var(--light-text);
    background-color: var(--accent);
    font-weight: bold;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.button:hover,
.button:focus {
    border-color: var(--accent-hover);
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.secondary-button {
    border-color: var(--border);
    color: var(--text);
    background-color: transparent;
}

.secondary-button:hover,
.secondary-button:focus {
    border-color: var(--accent);
    color: var(--text);
    background-color: var(--page-background);
}


/* ---------- Legacy book layouts ---------- */

.featured-book {
    display: grid;
    grid-template-columns: minmax(180px, 280px) 1fr;
    gap: 3rem;
    align-items: center;
}

.book-cover-placeholder {
    display: grid;
    min-height: 375px;
    place-items: center;
    padding: 2rem;
    border: 1px solid var(--border);
    background-color: #eeeeec;
    text-align: center;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.book-card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--surface);
}


/* ---------- Published and upcoming books ---------- */

.bookshelf {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2.5rem;
}

.book {
    display: flex;
    flex-direction: column;
}

.book img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.book:hover img {
    transform: translateY(-4px);
}

.book h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.book p {
    margin-top: 0;
    color: var(--muted-text);
}

.upcoming-bookshelf {
    grid-template-columns: repeat(2, minmax(0, 320px));
    justify-content: center;
}

.book-status {
    align-self: flex-start;
    margin-top: 1.25rem;
    margin-bottom: 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: var(--light-text) !important;
    background-color: var(--accent);
    font-size: 0.75rem !important;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.upcoming-book h3 {
    margin-top: 0.8rem;
}


/* ---------- Expanded About section ---------- */

.about-introduction {
    margin-bottom: 3rem;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.about-card {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.62);
}

.about-card h3 {
    margin-bottom: 0.9rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6rem;
}

.about-card p {
    color: var(--muted-text);
}

.about-card p:last-child {
    margin-bottom: 0;
}


.personal-note {
    display: grid;
    grid-template-columns: 0.4fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 2rem;
    border-left: 4px solid var(--accent);
    background-color: var(--surface);
}

.personal-note h3 {
    margin-bottom: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
}

.personal-note p {
    margin-bottom: 0;
    color: var(--muted-text);
}


/* ---------- Current projects ---------- */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2.75rem;
}

.project-card {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background-color: var(--surface);
}

.project-card h3 {
    margin-bottom: 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
}

.project-card ul {
    margin: 0;
    padding-left: 1.2rem;
}

.project-card li {
    color: var(--muted-text);
}

.project-card li + li {
    margin-top: 0.75rem;
}


/* ---------- AWS feature ---------- */

.aws-section {
    border-top: 1px solid var(--border);
    background-color: var(--surface);
}

.aws-content {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(2rem, 7vw, 6rem);
}

.aws-content p {
    color: var(--muted-text);
}

.aws-content p:last-child {
    margin-bottom: 0;
}


/* ---------- Quote ---------- */

.quote-section {
    padding: 5.5rem 0;
    background-color: var(--dark-surface);
    color: var(--light-text);
    text-align: center;
}

.quote-section blockquote {
    max-width: 900px;
    margin: 0 auto 1.5rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    line-height: 1.3;
}

.quote-section p {
    margin: 0;
    color: #c8cacc;
    font-weight: bold;
}


/* ---------- Footer ---------- */

.site-footer {
    padding: 2rem 0;
    border-top: 1px solid #3b3e41;
    color: #c8cacc;
    background-color: var(--dark-surface);
    text-align: center;
}

.site-footer p {
    margin: 0.5rem 0;
}

.site-footer a {
    color: var(--light-text);
    font-weight: bold;
}

.site-footer a:hover,
.site-footer a:focus {
    color: #ffffff;
}


/* ---------- Tablet layout ---------- */

@media (max-width: 1000px) {
    .site-header .container,
    .header-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero-portrait {
        justify-self: start;
        width: min(100%, 330px);
    }

    .bookshelf {
        grid-template-columns: repeat(2, 1fr);
    }

    .upcoming-bookshelf {
        grid-template-columns: repeat(2, minmax(0, 320px));
    }

    .about-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .personal-note,
    .aws-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}


/* ---------- Mobile layout ---------- */

@media (max-width: 700px) {
    .section {
        padding: 3.5rem 0;
    }

    .site-header {
        position: static;
    }

    .hero {
        padding: 4.25rem 0;
    }

    .navigation {
        gap: 0.75rem 1.25rem;
    }

    .hero-buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-buttons .button {
        width: 100%;
        text-align: center;
    }

    .featured-book,
    .book-grid,
    .bookshelf,
    .upcoming-bookshelf {
        grid-template-columns: 1fr;
    }

    .book {
        width: 100%;
        max-width: 320px;
        margin-inline: auto;
    }

    .book-cover-placeholder {
        max-width: 280px;
    }

    .about-card,
    .project-card,
    .personal-note {
        padding: 1.4rem;
    }

    .section-action .button {
        width: 100%;
        max-width: 360px;
        text-align: center;
    }
}