/* ─── FONTS ─── */
@font-face {
    font-family: "InSans";
    src: url("./fonts/InstrumentSans-VariableFont_wdth,wght.ttf") format('truetype');
    font-weight: 100 900;
    font-style: normal;
}
@font-face{
    font-family: "Mazius";
    src: url("./home-fonts/MaziusDisplay-Regular.otf") format('opentype');
}
@font-face{
    font-family: "Sneaky";
    src: url("./home-fonts/Sneaky-Times.otf") format('opentype');
    font-weight: 100 900;
    font-style: normal;
}

/* *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
} */



:root {
    --cream: #FDFBF7;
    --paper: #F7F4EE;
    --ink: #2C2418;
    --body: #3D362B;
    --muted: #8A7F6F;
    --rule: #D4CFC5;
    --accent: #6B4C3B;
    --highlight: #F0E8D4;
    --margin-text: #A09482;
    --red: #943B2B;

    /* geronimo */
    --pistachio: #7EA060;
    --aqua: #3D8A87;
    --periwinkle: #6068A8;
    --sand: #A86040;
}

@page { 
    margin: 0; 
}

html {
    background: var(--paper);
    font-family: 'InSans',  sans-serif;
    color: var(--body);
    font-size: 17px;
    line-height: 1.75;
}

/* ─── PAGE CONTAINER ─── */
.page {
    max-width: 68rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr minmax(0, 38rem) 14rem;
    gap: 0 3rem;
    padding: 0 2rem;
}

/* ─── RUNNING HEADER ─── */
.running-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.5rem 0 1rem;
    border-bottom: 0.5px solid var(--rule);
    margin-bottom: 3rem;
    position: sticky;
    top: 0;
    background: var(--paper);
    z-index: 100;
    margin: 0 calc(-50vw + 50%) 3rem;
    padding: 1.5rem calc(50vw - 50%) 1rem;
    
}
.rh-left {
    font-variant: small-caps;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--muted);
    margin-inline-start: 2rem;
}
.rh-right {
    font-style: italic;
    font-size: 0.8rem;
    color: var(--muted);
    margin-inline-end: 2rem;
    letter-spacing: .02em;
}
.rh-right a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 0.5px solid var(--rule);
    transition: color 0.3s;
}
.rh-right a:hover { 
    color: var(--ink); 
}

/* ─── NAV ─── */
.book-nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding-bottom: 2rem;
    /* margin-bottom: 1rem; */
    /* border-bottom: 0.5px solid var(--rule); */
}
.book-nav a {
    font-family: 'InSans', sans-serif;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
}
.book-nav a:hover { 
    color: var(--ink); 
}
.book-nav a.active {
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 0.1rem;
}

/* ─── CHAPTER BANNER ─── */
.chapter-banner {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #2B3D2F 0%, #3B6B5A 50%, #2E7D8A 100%);
    margin: 0 -2rem;
    padding: 4rem 2rem 3.5rem;
    position: relative;
    overflow: hidden;
    margin: 0 calc(-50vw + 50%);
    padding: 4rem calc(50vw - 50%) 3.5rem;
}
.chapter-banner::before {
    content: '01';
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'EB Garamond', serif;
    font-size: clamp(8rem, 20vw, 16rem);
    color: #ffffff0d;
    line-height: 1;
    pointer-events: none;
}
.chapter-banner .ch-label {
    font-family: 'InSans', sans-serif;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    color: #ffffffaa;
    margin-bottom: 1.5rem;
}
.chapter-banner h1 {
    font-family: 'Mazius', serif;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.15;
    font-weight: 500;
    color: #fff;
    max-width: 42rem;
    position: relative;
}
.chapter-banner h1 em {
    font-style: italic;
    font-weight: 400;
    color: #d4e8dc;
}
.chapter-banner .ch-meta {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #ffffffbb;
}
.chapter-banner .ch-meta a {
    color: #d4e8dc;
    text-decoration: none;
    border-bottom: 1px solid #ffffff44;
    transition: border-color 0.3s;
}
.chapter-banner .ch-meta a:hover {
    border-color: #fff;
}

/* ─── EPIGRAPH ─── */
.epigraph {
    grid-column: 2 / 3;
    border-left: 2px solid #2e718a;
    padding: 1.25rem 0 1.25rem 1.5rem;
    margin: 2rem 0 3rem;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--ink);
}
.epigraph strong {
    font-style: normal;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #2e8a64;
    text-underline-offset: 0.2rem;
    text-decoration-thickness: 1px;
}

/* ─── SECTION DIVIDER ─── */
.section-rule {
    grid-column: 2 / 3;
    height: 0;
    border: none;
    border-top: 0.5px solid var(--rule);
    margin: 0.5rem 0;
}

/* ─── PARAGRAPH ROW ─── */
.para-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr minmax(0, 38rem) 14rem;
    gap: 0 3rem;
    padding: 1rem 0;
}

.para-num {
    grid-column: 1;
    font-family: 'InSans';
    font-size: .75rem;
    color: var(--rule);
    text-align: right;
    padding-top: 0.45rem;
    letter-spacing: 0.05em;
    user-select: none;
}

.para-text {
    grid-column: 2;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--body);
    text-indent: 2rem;
}
.para-row:first-of-type .para-text,
.para-text.no-indent {
    text-indent: 0;
}

/* Drop cap for first paragraph */
.drop-cap::first-letter {
    font-family:'Mazius';
    font-size: 3em;
    /* float: left; */
    line-height: 0.8;
    margin:0 .05em;;
    color: var(--ink);
    font-weight: 500;
}



/* ─── MARGIN NOTES ─── */
.margin-note {
    grid-column: 3;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--margin-text);
    padding-top: 0.3rem;
    border-left: 1px solid var(--rule);
    padding-left: 1rem;
    font-style: italic;
}
.margin-note .mn-label {
    font-family: 'InSans', sans-serif;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #2E7D8A;
    font-style: normal;
    display: block;
    margin-bottom: 0.3rem;
}

/* ─── HIGHLIGHTS & MARKS ─── */
mark {
    color: var(--ink);
    padding: 0.05em 0.2em;
    border-radius: 1px;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 20%,
        #f0e8d4 20%,
        #e8d9b8 50%,
        #f0e8d4 80%,
        transparent 80%,
        transparent 100%
    );
    background-size: 300% 100%;
    background-position: 100% 0;
    animation: mark-sweep 4s ease-in-out infinite alternate;
}

/* stagger each mark so they don't all pulse in unison */
mark:nth-of-type(2)  { 
    animation-delay: -0.8s; 
}
mark:nth-of-type(3)  { 
    animation-delay: -1.6s; 
}
mark:nth-of-type(4)  { 
    animation-delay: -2.4s; 
}
mark:nth-of-type(5)  { 
    animation-delay: -3.2s; 
}
mark:nth-of-type(6)  { 
    animation-delay: -0.4s; 
}
mark:nth-of-type(7)  { 
    animation-delay: -1.2s; 
}
mark:nth-of-type(8)  { 
    animation-delay: -2.0s; 
}
mark:nth-of-type(9)  { 
    animation-delay: -2.8s; 
}
mark:nth-of-type(10) { 
    animation-delay: -3.6s; 
}

@keyframes mark-sweep {
    0%   { 
        background-position: 100% 0; 
    }
    100% { 
        background-position:   0% 0; 
    }
}

/* ─── GERONIMO TEXT ─── */
.slant {
    font-style: italic;
    font-weight: 500;
    color: var(--ink);
    border-bottom: 1.5px solid var(--aqua);
    padding-bottom: 0.05em;
    transition: color 0.3s, border-color 0.3s;
}
.slant:hover { 
    color: var(--aqua);
}

.slant2 {
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--ink);
    border-bottom: 1.5px solid var(--pistachio);
    padding-bottom: 0.05em;
    transition: color 0.3s;
}
.slant2:hover { 
    color: var(--pistachio);
}

.geronimo {
    font-family: 'Mazius', serif;
    font-weight: 400;
    font-size: 1.1em;
    color: var(--sand);
    letter-spacing: 0.02em;
    transition: letter-spacing 0.3s;
}
.geronimo:hover { 
    letter-spacing: 0.08em;
}

.stroke {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.12em;
    color: var(--body);
    background: linear-gradient(to top, var(--highlight) 40%, transparent 40%);
    padding: 0 0.15em;
    transition: background 0.3s;
}
.stroke:hover {
    background: linear-gradient(to top, #d4cfc5 40%, transparent 40%);
}

.shadow {
    font-style: italic;
    font-weight: 500;
    color: var(--aqua);
    transition: color 0.3s;
}
.shadow:hover {
    color: var(--periwinkle);
}

.space {
    letter-spacing: 0.08em;
    font-style: italic;
    font-weight: 500;
    color: var(--periwinkle);
    border-bottom: 1px dashed var(--periwinkle);
    padding-bottom: 0.05em;
    transition: color 0.3s, border-color 0.3s;
}
.space:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.shimmer {
    font-weight: 700;
    color: var(--aqua);
    position: relative;
    display: inline;
    transition: color 0.3s;
    cursor: default;
}
/* .shimmer::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 2.5px;
    background: linear-gradient(90deg, var(--pistachio), var(--aqua), var(--periwinkle), var(--pistachio));
    background-size: 300%;
    animation: shimmer-line 3s linear infinite;
} */
.shimmer:hover {
    background: linear-gradient(90deg, var(--pistachio), var(--aqua), var(--periwinkle), var(--pistachio));
    background-size: 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer-line 3s linear infinite;
}
@keyframes shimmer-line {
    0% { background-position: 0%; }
    100% { background-position: 300%; }
}

/* ─── FOOTER ─── */
.page-footer {
    grid-template-columns: repeat(3, 1fr);
    display: grid;
    justify-content: space-between;
    align-items: center;
    text-align:center;
    padding: 2rem 0 3rem;
    border-top: 0.5px solid var(--rule);
    margin-top: 4rem;
}
.page-footer a {
    font-family: 'InSans', sans-serif;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
}
.page-footer a:hover { color: var(--ink); }
.page-num {
    font-family: 'Mazius', serif;
    font-size: 0.9rem;
    color: var(--muted);
}



/* ─── RESPONSIVE ─── */
@media (max-width: 60rem) {
    .page {
        grid-template-columns: 1fr;
        padding: 0 1.5rem;
    }
    .chapter-banner { 
        margin: 0 calc(-50vw + 50%); 
        padding: 3rem calc(50vw - 50%) 2.5rem;
    }
    .chapter-banner::before { 
        display: none; 
    }
    .epigraph { 
        grid-column: 1; 
    }
    .section-rule { 
        grid-column: 1; 
    }
    .para-row {
        grid-template-columns: 1fr;
        grid-column: 1;
    }
    .para-num {
        grid-column: 1;
        text-align: left;
        padding-bottom: 0;
    }
    .para-text { 
        grid-column: 1; 
    }
    .margin-note {
        grid-column: 1;
        border-left: none;
        border-top: 0.5px solid var(--rule);
        padding-left: 0;
        padding-top: 0.75rem;
        margin-top: 0.75rem;
    }
    .running-header { 
        padding: 1rem 0 0.75rem; margin-bottom: 2rem; 
        
    }
}
