:root {
    --green-950: #0e241d;
    --green-900: #123128;
    --green-800: #173d31;
    --green-700: #1f5744;
    --green-100: #e8efe8;
    --paper: #f7f1e5;
    --paper-strong: #fff9ec;
    --copper: #b87946;
    --gold: #d8a65f;
    --copper-dark: #84502d;
    --ink: #18241f;
    --muted: #6f786f;
    --line: rgba(184, 121, 70, 0.28);
    --shadow: 0 20px 60px rgba(5, 19, 15, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--green-100);
    background:
        radial-gradient(circle at 50% 0, rgba(184, 121, 70, 0.18), transparent 32rem),
        linear-gradient(180deg, var(--green-950), var(--green-900) 42%, #10251f);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

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

.site-header,
.site-footer,
main {
    width: min(100% - 48px, 1240px);
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--gold);
}

.brand-mark svg {
    display: block;
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 0 8px rgba(216, 166, 95, 0.2));
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.05rem;
    letter-spacing: 0;
}

.brand small {
    max-width: 260px;
    color: #c5d4ca;
    font-size: 0.78rem;
    font-family: system-ui, sans-serif;
}

.main-nav,
.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-family: system-ui, sans-serif;
}

.main-nav a,
.site-footer a,
.text-link {
    color: #e9d6bd;
    text-decoration-color: rgba(184, 121, 70, 0.45);
    text-underline-offset: 5px;
}

.main-nav a {
    padding: 8px 10px;
    border-bottom: 1px solid transparent;
    text-decoration: none;
}

.main-nav a[aria-current="page"] {
    border-color: var(--copper);
    color: var(--paper-strong);
}

main {
    flex: 1;
    padding: 0 0 48px;
}

.hero,
.page-intro,
.legal,
.comic-focus,
.form-panel,
.admin-list,
.admin-header {
    width: min(100%, 1040px);
    margin-inline: auto;
}

.hero,
.page-intro,
.legal,
.form-panel,
.admin-list,
.admin-header {
    max-width: 860px;
}

.hero {
    padding: 56px 0 26px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--copper);
    font-family: system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: break-word;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.1;
    font-weight: 600;
}

.hero h1,
.page-intro h1 {
    max-width: 820px;
    font-size: 4.4rem;
}

.comic-focus h1 {
    max-width: 960px;
    font-size: 3.2rem;
}

.hero p:not(.eyebrow),
.page-intro p:not(.eyebrow) {
    max-width: 640px;
    color: #d7e2d9;
    font-size: 1.05rem;
}

.comic-focus {
    margin-top: 34px;
    padding-bottom: 28px;
}

.comic-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: #d9c2a7;
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
}

.comic-focus h2 {
    max-width: 960px;
    font-size: 3.2rem;
}

.subtitle {
    margin-top: 8px;
    color: #d4ded5;
    font-size: 1.1rem;
}

.comic-frame {
    display: block;
    margin: 28px 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.comic-frame figure {
    margin: 0;
}

.comic-frame img {
    width: 100%;
    height: auto;
    background: #fff;
}

.comic-single {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.comic-panels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 1.4vw, 18px);
}

.comic-panels figure {
    position: relative;
    overflow: visible;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.comic-panels img {
    width: 100%;
    height: auto;
    object-fit: contain;
    padding: 0;
    background: #fffaf0;
    border: 2px solid #fff;
    box-shadow:
        0 0 0 1px rgba(24, 36, 31, 0.16),
        0 8px 18px rgba(5, 19, 15, 0.14);
}

.comic-copy {
    margin: 22px auto 0;
    max-width: 780px;
    color: #e6eee6;
    font-size: 1.05rem;
}

.centered {
    text-align: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--copper);
    background: var(--copper);
    color: #1b1712;
    font-family: system-ui, sans-serif;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: #d3915a;
}

.button.danger {
    border-color: #d87d62;
    background: #d87d62;
}

.button.danger:hover {
    background: #ee9277;
}

.empty-comic {
    display: grid;
    width: min(100%, 960px);
    margin: 30px auto 0;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: center;
    padding: 24px 0;
}

.stamp-sheet {
    display: grid;
    min-height: 260px;
    place-items: center;
    padding: 24px;
    border: 1px dashed var(--copper);
    background: repeating-linear-gradient(45deg, #f6eddb, #f6eddb 10px, #efe1c9 10px, #efe1c9 20px);
    color: var(--green-900);
    text-align: center;
    text-transform: uppercase;
}

.stamp-sheet div:first-child {
    font-size: 4rem;
}

.stamp-sheet div {
    font-weight: 700;
}

.archive-grid {
    display: grid;
    width: min(100%, 960px);
    margin: 32px auto 0;
    gap: 18px;
}

.archive-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 249, 236, 0.06);
}

.archive-thumb {
    display: block;
}

.archive-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--paper);
}

.archive-card p,
.archive-card span {
    margin: 0;
    color: #c9d5cc;
    font-family: system-ui, sans-serif;
}

.archive-card h2 {
    margin: 4px 0;
    font-size: 1.35rem;
}

.archive-card .text-link {
    display: inline-block;
    margin-top: 8px;
    font-family: system-ui, sans-serif;
}

.notice,
.success,
.error {
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: rgba(255, 249, 236, 0.08);
    color: #f1eadf;
}

.success {
    border-color: rgba(114, 181, 119, 0.6);
}

.error {
    border-color: rgba(214, 95, 95, 0.7);
}

.legal {
    color: #e8efe8;
}

.legal h2 {
    margin-top: 30px;
    color: var(--paper-strong);
    font-size: 1.35rem;
}

.form-panel {
    margin-top: 26px;
    padding: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 249, 236, 0.07);
}

.form-panel.compact {
    max-width: 480px;
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #f0e5d4;
    font-family: system-ui, sans-serif;
    font-weight: 700;
}

label small {
    color: #c9d5cc;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(232, 239, 232, 0.28);
    background: #f8f0e4;
    color: var(--ink);
    font: 1rem system-ui, sans-serif;
    padding: 11px 12px;
}

textarea {
    resize: vertical;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 16px;
}

.upload-panels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.upload-panel {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 249, 236, 0.07);
}

.upload-panel span {
    color: var(--gold);
}

.upload-panel img {
    display: none;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    margin-top: 10px;
    padding: 6px;
    background: #fffaf0;
}

.upload-panel img[src] {
    display: block;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.checkbox input {
    width: 18px;
    height: 18px;
}

.admin-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-family: system-ui, sans-serif;
}

.admin-hint {
    max-width: 640px;
    margin: 10px 0 0;
    color: #c9d5cc;
    font-family: system-ui, sans-serif;
    font-size: 0.95rem;
}

.hash-output {
    overflow-x: auto;
    padding: 12px;
    background: #f8f0e4;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}

.admin-list {
    margin-top: 34px;
}

.admin-list h2 {
    font-size: 1.5rem;
}

.admin-list article {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.admin-list img {
    width: 96px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--paper);
}

.admin-list h3 {
    font-size: 1.1rem;
}

.admin-list p {
    margin: 4px 0;
    color: #c9d5cc;
    font-family: system-ui, sans-serif;
}

.panel-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    background: rgba(255, 249, 236, 0.08);
    border: 1px solid var(--line);
}

.panel-preview figure {
    position: relative;
    margin: 0;
    min-width: 0;
    background: var(--paper);
}

.panel-preview img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.inline-form {
    display: inline;
}

.text-button {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: #e9d6bd;
    font: 0.95rem system-ui, sans-serif;
    text-decoration: underline;
    text-decoration-color: rgba(184, 121, 70, 0.45);
    text-underline-offset: 5px;
    cursor: pointer;
}

.preview-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-bottom: 14px;
    padding: 5px 12px;
    border: 1px solid var(--gold);
    color: var(--gold);
    font: 700 0.9rem system-ui, sans-serif;
    text-transform: uppercase;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 24px;
    padding: 26px 0 36px;
    border-top: 1px solid var(--line);
    color: #c9d5cc;
    font-family: system-ui, sans-serif;
}

.site-footer div {
    display: grid;
    gap: 4px;
}

.site-footer nav {
    gap: 18px;
}

.site-footer a {
    color: var(--gold);
    font-weight: 700;
    text-decoration-thickness: 2px;
}

@media (max-width: 720px) {
    .site-header,
    .site-footer,
    .empty-comic,
    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header,
    .site-footer,
    .admin-header {
        display: flex;
    }

    .brand small {
        max-width: 210px;
    }

    .hero {
        padding-top: 30px;
    }

    .comic-focus {
        margin-top: 24px;
    }

    .hero h1,
    .page-intro h1 {
        font-size: 2.45rem;
    }

    .comic-focus h1,
    .comic-focus h2 {
        font-size: 2.1rem;
    }

    .empty-comic,
    .archive-card,
    .field-grid,
    .panel-preview,
    .upload-panels {
        grid-template-columns: 1fr;
    }

    .comic-panels {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .comic-frame {
        margin-inline: 0;
        padding: 0;
    }

    .stamp-sheet {
        min-height: 190px;
    }

    .comic-meta {
        flex-direction: column;
    }
}
