:root {
    --crimson: #d20f39;
    --crimson-deep: #a30b2c;
    --cream: #fce8c4;
    --ink: #16120f;
    --paper: #fbf6ec;
    --white: #ffffff;
    --muted: #6b6156;
    --rule: rgba(22, 18, 15, 0.14);

    --font-serif: "Cormorant Garamond", Garamond, Georgia, serif;
    --font-sans: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

    --max-width: 46rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--paper);
    color: var(--ink);
    font-size: 1.1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
    text-decoration: underline;
}

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

h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.15;
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.4rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--crimson);
    color: var(--cream);
}

.btn-primary:hover {
    background-color: var(--crimson-deep);
}

.btn-outline {
    border-color: currentColor;
    color: inherit;
}

.btn-outline:hover {
    background-color: rgba(22, 18, 15, 0.06);
}

.hero .btn-outline:hover {
    background-color: rgba(252, 232, 196, 0.12);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--ink);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.brand {
    color: var(--cream) !important;
    text-decoration: none;
}

/*
 * Cover-matching wordmark: all caps, with a taller initial on each word
 * (LARAVEL AFTER DEPLOY). Used in the nav brand and hero h1.
 */
.title-mark {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35em;
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0.04em;
}

.title-mark-word {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
}

.title-mark-initial {
    font-size: 1.55em;
    font-weight: 700;
    line-height: 0.85;
}

.brand.title-mark {
    font-size: 0.72rem;
    gap: 0.4em;
}

.brand.title-mark:hover {
    text-decoration: none;
}

.nav .btn-primary {
    padding: 0.6rem 1.1rem;
    font-size: 0.88rem;
}

.hero {
    background-color: var(--crimson);
    color: var(--cream);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: 3.5rem;
    padding-bottom: 4rem;
    align-items: center;
}

@media (min-width: 900px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        padding-top: 5rem;
        padding-bottom: 5.5rem;
    }
}

.kicker {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(252, 232, 196, 0.75);
}

.hero h1.title-mark {
    font-size: clamp(1.55rem, 3.6vw, 2.35rem);
    color: var(--ink);
    gap: 0.28em;
}

.hero h1.title-mark .title-mark-initial {
    font-size: 1.7em;
}

.hero .subtitle {
    margin: 0.85rem 0 0;
    font-size: clamp(0.78rem, 1.5vw, 0.95rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(252, 232, 196, 0.9);
}

.hero .lede {
    margin: 1.5rem 0 0;
    max-width: 30rem;
    font-size: 1.05rem;
    color: rgba(252, 232, 196, 0.85);
}

.hero .meta {
    margin: 1.25rem 0 0;
    font-size: 0.95rem;
    color: rgba(252, 232, 196, 0.65);
}

.cta-row {
    margin-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero .btn-primary {
    background-color: var(--cream);
    color: var(--ink);
}

.hero .btn-primary:hover {
    background-color: var(--white);
}

.hero-cover {
    max-width: 20rem;
    margin: 0 auto;
}

.hero-cover img {
    width: 100%;
    height: auto;
    aspect-ratio: 7.44 / 9.69;
    object-fit: cover;
    border: 1px solid rgba(252, 232, 196, 0.55);
    transform: rotate(-2.5deg);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.42);
    transition: transform 0.35s ease;
}

.hero-cover:hover img {
    transform: rotate(-1.5deg);
}

@media (prefers-reduced-motion: reduce) {
    .hero-cover img,
    .hero-cover:hover img {
        transform: rotate(-2.5deg);
        transition: none;
    }
}

section {
    border-top: 1px solid var(--rule);
}

.section-pad {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}

.section-pad h2 {
    font-size: clamp(1.65rem, 3vw, 2.1rem);
}

.section-note {
    margin: 0.85rem 0 0;
    color: var(--muted);
    max-width: 38rem;
}

.intro {
    margin: 0.85rem 0 0;
    max-width: 40rem;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.55;
    color: var(--ink);
}

.toc-list {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
}

.toc-part summary {
    cursor: pointer;
    list-style: none;
}

.toc-part summary::-webkit-details-marker {
    display: none;
}

.toc-part h3 {
    position: relative;
    padding-bottom: 0.6rem;
    padding-right: 1.75rem;
    font-size: 1.15rem;
    border-bottom: 2px solid var(--crimson);
}

.toc-part h3::after {
    content: "+";
    position: absolute;
    top: -0.15rem;
    right: 0;
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--crimson);
}

.toc-part[open] h3::after {
    content: "\2212";
}

.toc-part summary:hover h3 {
    color: var(--crimson-deep);
}

.toc-part-num {
    color: var(--crimson);
    font-weight: 600;
}

.toc-part ol {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--ink);
}

.toc-part li {
    display: flex;
    gap: 0.65rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
}

.toc-part li:last-child {
    border-bottom: none;
}

.toc-part li span {
    flex-shrink: 0;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.section-ink {
    background-color: var(--ink);
    color: rgba(252, 232, 196, 0.85);
}

.section-ink h2 {
    color: var(--cream);
}

.section-ink p {
    color: rgba(252, 232, 196, 0.75);
}

.section-ink a {
    color: var(--cream);
}

.section-ink .btn-primary {
    background-color: var(--cream);
    color: var(--ink);
}

.section-ink .btn-primary:hover {
    background-color: var(--white);
}

.section-ink .btn-outline:hover {
    background-color: rgba(252, 232, 196, 0.12);
    color: var(--cream);
    text-decoration: none;
}

#notify {
    text-align: center;
}

#notify .container {
    max-width: 36rem;
}

.notify-form {
    margin-top: 2rem;
}

/*
 * Kit's embed stacks the field/button below ~700px form width, and our
 * notify column is narrower than that - so force a single-row flex layout:
 * email grows, submit stays content-sized. Also kill Kit's pill radii and
 * the hover overlay on the inner <span>.
 */
#notify .formkit-form .formkit-fields {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0.5rem;
    margin: 0 !important;
}

#notify .formkit-form .formkit-field {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
}

#notify .formkit-form .formkit-input {
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    border: 1px solid rgba(22, 18, 15, 0.22) !important;
    color: var(--ink) !important;
    background: #fff !important;
    font-family: var(--font-sans) !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    padding: 0.8rem 1rem !important;
}

#notify .formkit-form .formkit-input:focus {
    border-color: var(--crimson) !important;
    outline: none !important;
}

#notify .formkit-form .formkit-submit {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: var(--crimson) !important;
    color: var(--cream) !important;
    font-family: var(--font-sans) !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
    cursor: pointer;
    overflow: hidden;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

#notify .formkit-form .formkit-submit > span {
    display: block !important;
    padding: 0.8rem 1.1rem !important;
    background: transparent !important;
    transition: none !important;
}

#notify .formkit-form .formkit-submit:hover,
#notify .formkit-form .formkit-submit:focus {
    background-color: var(--crimson-deep) !important;
    outline: none !important;
}

#notify .formkit-form .formkit-submit:hover > span,
#notify .formkit-form .formkit-submit:focus > span {
    background-color: transparent !important;
}

@media (max-width: 520px) {
    #notify .formkit-form .formkit-fields {
        flex-wrap: wrap !important;
    }

    #notify .formkit-form .formkit-field,
    #notify .formkit-form .formkit-submit {
        flex: 1 1 100% !important;
    }
}

.author {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

@media (min-width: 700px) {
    .author {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: flex-start;
    }
}

.author img {
    width: 68px;
    height: 68px;
    border-radius: 999px;
}

.author h2 {
    font-size: 1.4rem;
}

.author p {
    margin: 0.75rem 0 0;
    max-width: 38rem;
    color: var(--muted);
}

.site-footer {
    background-color: var(--ink);
    color: rgba(252, 232, 196, 0.55);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
    font-size: 0.9rem;
}

.footer-inner p {
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

.footer-links a {
    color: rgba(252, 232, 196, 0.7);
}

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