:root {
    --ink: #2b1f18;
    --ink-soft: #4d3928;
    --sepia: #765332;
    --sepia-soft: #9f7a4f;
    --red-ink: #7f261d;
    --paper: #f2dfbb;
    --paper-warm: #f7e8c9;
    --paper-shadow: rgba(70, 38, 18, .18);
    --shadow: rgba(20, 10, 5, .48);
    --spine: #22110b;
    --gold: #d8ad68;
}

* {
    box-sizing: border-box;
}

html,
body.ledger-login {
    min-height: 100%;
}

body.ledger-login {
    margin: 0;
    color: var(--ink);
    /* font-family: Georgia, "Times New Roman", serif; */
    font-family: var(--font-ledger);
    background:
        radial-gradient(circle at 50% 15%, rgba(255, 231, 180, .24), transparent 32%),
        linear-gradient(135deg, #21100a, #6a4228 48%, #170b07);
}

.login-book-stage {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.ledger-book {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 86px 1fr;
    background: var(--spine);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 34px 100px var(--shadow);
}

.ledger-spine {
    position: relative;
    background:
        linear-gradient(90deg, #130804, #3a1c12 48%, #120704);
    box-shadow: inset -14px 0 26px rgba(0, 0, 0, .5);
}

.ledger-spine::before,
.ledger-spine::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    height: 1px;
    background: rgba(216, 173, 104, .35);
}

.ledger-spine::before {
    top: 28px;
}

.ledger-spine::after {
    bottom: 28px;
}

.ledger-spine span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    white-space: nowrap;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: .78rem;
}

.ledger-page {
    position: relative;
    min-height: min(820px, calc(100vh - 4rem));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .88fr);
    gap: clamp(1.5rem, 3vw, 3rem);
    overflow: hidden;
    padding: clamp(1.35rem, 2.8vw, 2.4rem);
    background:
        radial-gradient(circle at 18% 16%, rgba(115, 70, 35, .13), transparent 20%),
        radial-gradient(circle at 84% 78%, rgba(115, 70, 35, .11), transparent 18%),
        linear-gradient(180deg, var(--paper-warm), var(--paper));
    isolation: isolate;
}

.ledger-page::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 30px;
    transform: translateX(-50%);
    background:
        linear-gradient(90deg,
            transparent,
            rgba(71, 38, 18, .13) 35%,
            rgba(255, 248, 224, .38) 50%,
            rgba(71, 38, 18, .13) 65%,
            transparent
        );
    pointer-events: none;
    z-index: -1;
}

.ledger-page::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 20%, rgba(82, 46, 24, .08), transparent 10%),
        radial-gradient(circle at 70% 40%, rgba(82, 46, 24, .06), transparent 12%),
        radial-gradient(circle at 86% 84%, rgba(82, 46, 24, .07), transparent 14%);
    pointer-events: none;
    z-index: -2;
}


.ledger-right-page {
    min-width: 0;
}

.ledger-left-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: clamp(.4rem, 1.5vw, 1rem) clamp(.4rem, 1.6vw, 1.25rem);
    overflow: hidden;
}

.frontispiece-art {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: sepia(.12) contrast(1.03);
    flex: 0 0 auto;
}

.frontispiece-wheat {
    width: min(210px, 52%);
    max-height: 150px;
    margin: 0 auto .2rem;
}

.frontispiece-title-block {
    margin: 0 auto .35rem;
}

.frontispiece-kicker {
    margin: 0 0 -.15rem;
    color: var(--sepia);
    text-transform: uppercase;
    letter-spacing: .34em;
    font-size: clamp(.72rem, 1vw, .86rem);
    font-weight: bold;
}

.frontispiece-title {
    margin: 0;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: .08em;
    line-height: .94;
    font-size: clamp(2.1rem, 4.2vw, 3.75rem);
    text-shadow: 0 1px 0 rgba(255, 248, 220, .42);
}

.frontispiece-title span {
    display: block;
}

.frontispiece-title span:first-child {
    font-size: 1em;
}

.frontispiece-title span:last-child {
    font-size: 0.72em;
    letter-spacing: 0.10em;
}

.frontispiece-rule {
    width: min(300px, 68%);
    height: 1px;
    margin: .35rem auto .55rem;
    background: linear-gradient(90deg, transparent, rgba(89, 55, 30, .52), transparent);
}

.frontispiece-seal {
    width: min(190px, 43%);
    max-height: 190px;
    margin: .05rem auto .35rem;
}

.frontispiece-small-art {
    width: min(360px, 80%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(1rem, 2.2vw, 1.8rem);
    margin: .05rem auto .05rem;
}

.frontispiece-starter {
    width: min(100px, 34%);
    max-height: 125px;
}

.frontispiece-banneton {
    width: min(135px, 44%);
    max-height: 95px;
    mix-blend-mode: multiply;
}

.frontispiece-scale {
    width: min(170px, 42%);
    max-height: 135px;
    margin: .05rem auto .15rem;
}

.frontispiece-loaf {
    width: min(175px, 44%);
    max-height: 110px;
    margin: .25rem auto .15rem;
}

.frontispiece-tagline {
    margin: .15rem auto 0;
    color: var(--sepia);
    text-transform: uppercase;
    letter-spacing: .16em;
    line-height: 1.45;
    font-size: clamp(.66rem, .92vw, .82rem);
}


.frontispiece-flourish {
    display: block;
    width: min(170px, 42%);
    max-height: 24px;
    object-fit: contain;
    margin: .05rem auto .15rem;
    opacity: .72;
    filter: sepia(.2) contrast(1.05);
}

.ledger-right-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2.3vw, 2.25rem) clamp(.4rem, 1.4vw, 1.25rem);
}

.login-panel {
    width: min(430px, 100%);
    margin: 0 auto;
    padding: clamp(1.2rem, 2.8vw, 2.2rem);
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 248, 224, .30), rgba(255, 248, 224, .08));
    border: 1px solid rgba(91, 55, 30, .20);
    box-shadow:
        inset 0 0 0 1px rgba(255, 248, 220, .22),
        0 18px 40px rgba(79, 43, 21, .09);
}


.login-flourish {
    display: block;
    object-fit: contain;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    opacity: .72;
    filter: sepia(.2) contrast(1.05);
}

.login-flourish-top {
    width: min(260px, 72%);
    max-height: 32px;
    margin-bottom: 1.1rem;
}

.login-flourish-small {
    width: min(150px, 44%);
    max-height: 22px;
    margin-top: -.35rem;
    margin-bottom: 1rem;
}

.login-flourish-bottom {
    width: min(250px, 70%);
    max-height: 32px;
    margin-top: 1.2rem;
}

.entry-rule {
    width: min(320px, 86%);
    height: 1px;
    margin: 0 auto 1rem;
    background: linear-gradient(90deg, transparent, rgba(89, 55, 30, .55), transparent);
}

.entry-rule-bottom {
    margin: 1.15rem auto 0;
}

.entry-kicker {
    margin: 0 0 .5rem;
    color: var(--red-ink);
    text-transform: uppercase;
    letter-spacing: .2em;
    font-weight: bold;
    font-size: .72rem;
}

.login-panel h2 {
    margin: 0;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    line-height: 1.1;
}

.entry-note {
    margin: .55rem auto 1.2rem;
    color: var(--sepia);
    max-width: 340px;
    line-height: 1.45;
}

.login-error {
    margin: 0 auto 1rem;
    padding: .75rem;
    max-width: 100%;
    color: var(--red-ink);
    background: rgba(127, 38, 29, .08);
    border: 1px solid rgba(127, 38, 29, .35);
    text-align: left;
}

.login-form {
    width: 100%;
    margin: 0 auto;
    text-align: left;
}

.login-field {
    margin-bottom: .85rem;
}

.login-form label {
    display: block;
    margin: 0 0 .28rem;
    color: var(--sepia);
    font-size: .78rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .13em;
}

.login-form input {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: .72rem .85rem;
    color: var(--ink);
    font: inherit;
    background:
        linear-gradient(180deg, rgba(255, 246, 218, .76), rgba(244, 222, 181, .46));
    border: 1px solid rgba(91, 55, 30, .50);
    border-radius: 0;
    box-shadow: inset 0 1px 5px rgba(71, 38, 18, .08);
}

.login-form input:focus {
    outline: 2px solid rgba(127, 38, 29, .25);
    border-color: var(--red-ink);
    background: rgba(255, 248, 224, .86);
}

.login-form button {
    display: block;
    width: 100%;
    margin-top: 1.05rem;
    padding: .9rem 1rem;
    color: #fff3d2;
    font: inherit;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .18em;
    background: linear-gradient(180deg, #9a3025, #6e1d16);
    border: 1px solid #4b120e;
    cursor: pointer;
    box-shadow: 0 5px 0 #42100c;
}

.login-form button:hover {
    filter: brightness(1.07);
}

.login-form button:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #42100c;
}

.login-links {
    margin: 1rem 0 0;
    color: var(--sepia);
    display: flex;
    justify-content: center;
    gap: .65rem;
    flex-wrap: wrap;
    font-size: .92rem;
}

.login-links a {
    color: var(--red-ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.entry-motto {
    margin: 1rem 0 0;
    color: var(--sepia);
    font-style: italic;
}

/* Hard stops so uncropped/high-resolution PNGs can never blow up the spread. */
.ledger-left-page img {
    max-width: 100%;
}

@media (max-width: 900px) {
    .login-book-stage {
        align-items: flex-start;
        padding: 1rem;
    }

    .ledger-book {
        grid-template-columns: 64px 1fr;
    }

    .ledger-page {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }

    .ledger-page::before {
        display: none;
    }

    
.frontispiece-flourish {
    display: block;
    width: min(170px, 42%);
    max-height: 24px;
    object-fit: contain;
    margin: .05rem auto .15rem;
    opacity: .72;
    filter: sepia(.2) contrast(1.05);
}

.ledger-right-page {
        padding-top: 0;
    }

    .frontispiece-title {
        font-size: clamp(2.2rem, 10vw, 4rem);
    }

    .frontispiece-wheat {
        width: min(210px, 70%);
        max-height: 145px;
    }

    .frontispiece-seal {
        width: min(175px, 48%);
        max-height: 175px;
    }

    .frontispiece-loaf {
        width: min(165px, 48%);
        max-height: 105px;
    }
}

@media (max-width: 620px) {
    .login-book-stage {
        padding: 0;
    }

    .ledger-book {
        min-height: 100vh;
        grid-template-columns: 1fr;
        border-radius: 0;
    }

    .ledger-spine {
        display: none;
    }

    .ledger-page {
        padding: 1rem;
    }

    .ledger-left-page {
        padding-top: .25rem;
    }

    .frontispiece-wheat {
        width: min(190px, 76%);
        max-height: 130px;
    }

    .frontispiece-seal {
        width: min(165px, 56%);
        max-height: 165px;
    }

    .frontispiece-loaf {
        width: min(155px, 56%);
        max-height: 100px;
    }

    .frontispiece-small-art {
        width: min(300px, 88%);
    }

    .frontispiece-scale {
        width: min(145px, 48%);
        max-height: 120px;
    }

    .frontispiece-tagline {
        font-size: .62rem;
        letter-spacing: .12em;
    }

    .login-panel {
        padding: 1.1rem;
    }
}
.frontispiece-vignette {
    text-align: center;
    margin: 1.25rem 0 1.5rem;
}

.frontispiece-vignette img {
    width: 100%;
    max-width: 420px;
    height: auto;
}

.frontispiece-seal img {
    max-width: 210px;
}

.frontispiece-scale img {
    max-width: 170px;
}