:root {
    --accent: #7a2e3a;
    --ink: #2b2522;
    --muted: #6f6560;
    --paper: #fbf7f2;
    --card: #ffffff;
    --line: #e8dfd6;
    --danger: #b3261e;
    --ok: #2e7d4f;
    color-scheme: light;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--paper);
    color: var(--ink);
    margin: 0;
}

.page {
    margin: 0 auto;
    max-width: 40rem;
    padding: max(1.5rem, env(safe-area-inset-top)) 1rem 3rem;
}

h1,
h2 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-weight: 600;
}

h1 {
    color: var(--accent);
    font-size: clamp(2.2rem, 9vw, 3.4rem);
    line-height: 1.05;
    margin: 0.5rem 0;
}

h2 {
    font-size: 1.4rem;
    margin: 2.2rem 0 0.8rem;
}

.hero {
    padding: 1.5rem 0 1rem;
    text-align: center;
}

.eyebrow,
.date {
    color: var(--muted);
    letter-spacing: 0.04em;
    margin: 0;
}

.lead {
    font-size: 1.1rem;
    line-height: 1.55;
    margin: 1rem 0 0;
}

a {
    color: var(--accent);
}

.steps {
    line-height: 1.6;
    margin: 1.5rem 0;
    padding-left: 1.4rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.button {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 600;
    justify-content: center;
    min-height: 3rem;
    padding: 0.7rem 1.4rem;
    text-decoration: none;
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.button.subtle {
    background: transparent;
}

.button.big {
    font-size: 1.15rem;
    min-height: 3.75rem;
    width: 100%;
}

.upload {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(60, 40, 30, 0.06);
    padding: 1.2rem;
}

.field {
    display: block;
    margin-bottom: 1rem;
}

.field span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.field small {
    color: var(--muted);
    font-weight: 400;
}

.field input {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    color: inherit;
    font: inherit;
    padding: 0.75rem 0.85rem;
    width: 100%;
}

.field input:focus {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.picker {
    display: block;
    position: relative;
}

/* The file input stays focusable and usable for screen readers, under the big button. */
.picker input {
    cursor: pointer;
    height: 100%;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

.picker:focus-within .button {
    outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
    outline-offset: 2px;
}

.hint,
.privacy {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.privacy {
    margin-top: 2.5rem;
    text-align: center;
}

.js .no-js-only {
    display: none;
}

.no-js-only {
    margin-top: 0.5rem;
    width: 100%;
}

.queue {
    list-style: none;
    margin: 0;
    padding: 0;
}

.queue li {
    align-items: center;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 0.25rem 0.75rem;
    grid-template-columns: 3rem 1fr auto;
    padding: 0.6rem 0;
}

.queue .thumb {
    background: var(--paper);
    border-radius: 0.4rem;
    grid-row: span 2;
    height: 3rem;
    object-fit: cover;
    width: 3rem;
}

.queue .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue .status {
    color: var(--muted);
    font-size: 0.85rem;
}

.queue progress {
    accent-color: var(--accent);
    grid-column: 2 / 4;
    height: 0.4rem;
    width: 100%;
}

.queue .done .status {
    color: var(--ok);
}

.queue .failed .status {
    color: var(--danger);
}

.queue .retry {
    background: none;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 0;
}

.grid {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.tile {
    aspect-ratio: 1;
    background: var(--line);
    border-radius: 0.6rem;
    overflow: hidden;
    position: relative;
}

.tile img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.tile .delete {
    margin: 0;
    position: absolute;
    right: 0.3rem;
    top: 0.3rem;
}

.tile .delete button {
    background: rgba(20, 15, 12, 0.65);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: 1.3rem;
    height: 2.2rem;
    line-height: 1;
    width: 2.2rem;
}

.notice {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.2rem;
    text-align: center;
}

.messages {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.message {
    background: #eef7f1;
    border: 1px solid #cfe7d7;
    border-radius: 0.6rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem 0.9rem;
}

.message.error {
    background: #fdf0ef;
    border-color: #f2cfcc;
    color: var(--danger);
}

[hidden] {
    display: none !important;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.9rem;
    gap: 0.5rem 1.25rem;
    justify-content: center;
    padding: 0 1rem max(2rem, env(safe-area-inset-bottom));
}

.footer a {
    color: var(--muted);
}

.legal {
    line-height: 1.6;
}

.legal h1 {
    font-size: clamp(1.9rem, 7vw, 2.6rem);
}

.legal h3 {
    font-size: 1.05rem;
    margin: 1.4rem 0 0.4rem;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
}

.legal-nav a[aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.legal .updated,
.legal-archived {
    color: var(--muted);
}

.legal-archived {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.legal table {
    border-collapse: collapse;
    display: block;
    font-size: 0.95rem;
    overflow-x: auto;
    width: 100%;
}

.legal th,
.legal td {
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0.75rem 0.5rem 0;
    text-align: left;
    vertical-align: top;
}

.legal .missing {
    background: #fff3cd;
    color: var(--danger);
}

/* The ALTCHA check runs by itself in the background; guests never need to touch it. */
.check {
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
    clip-path: inset(50%);
}

.field .saved,
.field .not-saved {
    font-weight: 600;
    margin-left: 0.4rem;
}

.field .saved {
    color: var(--ok);
}

.field .not-saved {
    color: var(--danger);
}

.tile a {
    display: block;
    height: 100%;
}
