:root {
    --paper: #ffea3d;
    --paper-strong: #ffd000;
    --ink: #3b2a00;
    --muted: #7b5a00;
    --line: #7a5200;
    --accent: #c88c00;
    --page: linear-gradient(180deg, #fff86a 0%, #ffe100 48%, #ffc400 100%);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--page);
    font-family: "IBM Plex Sans", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.site-shell,
.admin-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 64px;
}

.site-header,
.admin-header {
    margin-bottom: 32px;
}

.site-kicker {
    margin: 0 0 10px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

h1,
h2,
.entry-title {
    margin: 0;
    font-family: "DM Serif Text", serif;
    font-weight: 400;
    line-height: 1.05;
}

h1 {
    font-size: clamp(2.7rem, 7vw, 5.6rem);
    max-width: 8ch;
}

.site-title-link,
.site-title-link:any-link,
.site-title-link:visited,
.site-title-link:active {
    color: inherit;
    text-decoration: none;
}

.site-title-link:hover,
.site-title-link:focus-visible {
    color: inherit;
    text-decoration: none;
}

.site-intro {
    margin: 14px 0 0;
    max-width: 36rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.entry-page {
    display: grid;
    gap: 28px;
    justify-items: center;
}

.entry-card {
    width: 777px;
    aspect-ratio: 4 / 5;
    padding: 33px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)) border-box,
        linear-gradient(180deg, var(--paper), var(--paper-strong)) padding-box;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 24px;
}

.entry-header {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(115, 83, 59, 0.35);
}

.entry-title {
    font-size: 48px;
    line-height: 1.08;
}

.entry-body {
    overflow: hidden;
    color: var(--ink);
    min-height: 0;
}

.entry-body p {
    margin: 0;
    white-space: pre-line;
    font-size: 24px;
    line-height: 1.24;
}

.entry-view {
    display: grid;
    justify-items: center;
    width: min(100%, 777px);
}

.entry-card-shell {
    width: min(100%, 777px);
    position: relative;
    justify-self: center;
    overflow: hidden;
}

.entry-card--display {
    position: absolute;
    top: 0;
    left: 50%;
    transform-origin: top center;
    transform: translateX(-50%) scale(var(--card-scale, 1));
}

.entry-nav {
    width: min(100%, 777px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    justify-self: center;
    position: relative;
    z-index: 1;
}

.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 88px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)) border-box,
        linear-gradient(180deg, var(--paper), var(--paper-strong)) padding-box;
    color: var(--ink);
    text-decoration: none;
}

.nav-button--random {
    font-weight: 600;
}

.nav-button:hover,
.nav-button:focus-visible {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)) border-box,
        linear-gradient(180deg, #ffef66, #ffd620) padding-box;
}

.nav-button.is-disabled {
    opacity: 0.42;
    pointer-events: none;
}

.nav-icon {
    font-family: "DM Serif Text", serif;
    font-size: 2rem;
    line-height: 1;
}

.nav-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.entry-card--measure {
    position: absolute;
    left: -99999px;
    top: 0;
    visibility: hidden;
    pointer-events: none;
}

.entry-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--footer-gap, 10px);
    font-size: var(--footer-size, 0.88rem);
    line-height: 1.2;
    color: var(--muted);
}

.share-label {
    font-weight: 600;
    color: var(--ink);
}

.share-link {
    border: 0;
    padding: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.share-link:hover,
.share-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.share-link.is-static {
    cursor: default;
}

.share-separator {
    color: var(--muted);
}

.empty-state {
    width: min(100%, 777px);
    padding: 33px;
    border: 1px solid var(--line);
    background: rgba(255, 239, 92, 0.78);
}

@media (max-width: 820px) {
    .site-shell,
    .admin-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 24px;
    }

    .entry-nav {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .nav-button {
        min-height: 64px;
        padding: 12px 10px;
    }

    .nav-icon {
        font-size: 1.7rem;
    }

    .nav-label {
        font-size: 0.92rem;
    }
}