:root {
    --brass: #f4c77d;
    --iron: #1c1a24;
    --ink: #0c0b10;
    --plum: #3e2a4f;
    --emerald: #1f4f4a;
    --bone: #f3e6cf;
    --blood: #9b1b30;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Book Antiqua", "Trebuchet MS", Georgia, serif;
    background: var(--ink);
    color: var(--bone);
}

a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }

.hero-panel {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2rem 0 1rem 0;
}

.hero-panel h1 {
    font-size: 2.8rem;
    letter-spacing: 0.08em;
    margin: 0.2rem 0 0.5rem 0;
}

.hero-panel .lede {
    max-width: 600px;
    color: #cbb89d;
    line-height: 1.6;
}

.eyebrow {
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(244, 199, 125, 0.7);
    font-size: 0.9rem;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.hero-orb {
    position: relative;
    justify-self: end;
}

.hero-orb .halo {
    width: 220px;
    height: 220px;
    border: 1px dashed rgba(244, 199, 125, 0.35);
    border-radius: 50%;
    filter: drop-shadow(0 0 25px rgba(244, 199, 125, 0.25));
}

.hero-orb .orb {
    position: absolute;
    inset: 35px;
    background: radial-gradient(circle, rgba(244, 199, 125, 0.25), rgba(45, 33, 50, 0.95));
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 199, 125, 0.6);
}

.hero-orb .glyph {
    font-size: 3rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.8);
}

.control-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0 2rem 0;
    padding: 1rem;
    border: 1px solid rgba(244, 199, 125, 0.3);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
}

.control label { color: #c5b9a1; font-size: 0.95rem; }
.control select {
    margin-top: 0.4rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(244, 199, 125, 0.5);
    background: rgba(17, 13, 24, 0.9);
    color: var(--bone);
}

.control.actions { display: flex; gap: 0.75rem; align-items: flex-end; }

.btn-ghost {
    border: 1px solid rgba(244, 199, 125, 0.6);
    background: linear-gradient(135deg, rgba(244, 199, 125, 0.18), rgba(71, 55, 87, 0.4));
    color: var(--bone);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-ghost:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35); }

.btn-link { color: var(--brass); font-weight: 600; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.gallery-card {
    border: 1px solid rgba(244, 199, 125, 0.25);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    display: grid;
    grid-template-rows: auto 1fr auto;
    position: relative;
}

.gallery-card header, .gallery-card footer {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
    font-size: 0.95rem;
    color: #d8cbb2;
}

.gallery-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.missing-image {
    position: relative;
    width: 100%;
    height: 220px;
}

.missing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.45) contrast(1.05);
}

.missing-image[role="button"] { cursor: pointer; }

.missing-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bone);
    background: linear-gradient(180deg, rgba(12, 11, 16, 0.2), rgba(12, 11, 16, 0.75));
}

.gallery-card .sigil {
    height: 220px;
    display: grid;
    place-items: center;
    background: repeating-linear-gradient(45deg, rgba(244, 199, 125, 0.05) 0, rgba(244, 199, 125, 0.05) 10px, rgba(50, 32, 15, 0.15) 10px, rgba(50, 32, 15, 0.15) 20px);
    color: #a08c70;
}

.gallery-card.locked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(155, 27, 48, 0.15) 100%);
}

.gallery-card .day {
    letter-spacing: 0.08em;
    color: var(--brass);
}

.gallery-card .status {
    font-weight: 600;
    color: #8ad3c2;
}

.gallery-card.locked .status { color: #c35f6b; }
.gallery-card.missing .status { color: #f4c77d; }

.loading, .empty { padding: 2rem; text-align: center; color: #cbb89d; }

.upload-panel {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 14px;
    background: rgba(17, 13, 24, 0.9);
    border: 1px dashed rgba(244, 199, 125, 0.4);
}

.upload-panel h2 { margin-top: 0; letter-spacing: 0.05em; }

.upload-control { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.upload-status { color: #8ad3c2; }

.gallery {
    border: 1px solid rgba(244, 199, 125, 0.25);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.gallery-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.gallery-bar select {
    padding: 0.4rem 0.6rem;
    background: #120f18;
    color: var(--bone);
    border: 1px solid rgba(244, 199, 125, 0.4);
    border-radius: 8px;
}

.gallery-stage {
    margin-top: 1rem;
    height: 65vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 20%, rgba(244, 199, 125, 0.12), rgba(10, 9, 14, 0.95));
    border-radius: 12px;
    overflow: hidden;
}

.gallery-stage figure { margin: 0; position: relative; width: 100%; height: 100%; }
.gallery-stage a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.gallery-stage img { width: 100%; height: 100%; object-fit: contain; }
.gallery-stage .missing-image { height: 100%; }
.gallery-stage .missing-image img { object-fit: contain; }
.gallery-stage .missing-text { font-size: 1rem; }
.gallery-stage figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8rem 1rem;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.65));
    display: flex;
    justify-content: space-between;
    color: var(--bone);
}

.calendar-stage {
    height: auto;
    min-height: 320px;
    padding: 1.25rem;
    align-items: start;
    justify-items: stretch;
}

.event-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.event-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(244, 199, 125, 0.2);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.event-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.event-date {
    display: grid;
    grid-template-rows: auto auto;
    text-align: center;
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(244, 199, 125, 0.3);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(244, 199, 125, 0.08), rgba(17, 13, 24, 0.9));
    min-width: 78px;
}

.event-date .month {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    color: var(--brass);
}

.event-date .day {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--bone);
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(244, 199, 125, 0.35);
    background: rgba(244, 199, 125, 0.15);
    color: var(--bone);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pill.subtle {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #cbb89d;
}

.pill.repeat {
    border-color: rgba(138, 211, 194, 0.35);
    background: rgba(31, 79, 74, 0.2);
    color: #8ad3c2;
}

.event-body h3 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
}

.event-time {
    margin: 0;
    color: #c5b9a1;
    font-size: 0.95rem;
}

.error-body {
    background: radial-gradient(circle at 15% 20%, rgba(12, 11, 16, 0.95), rgba(12, 11, 16, 0.5));
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.error-shell {
    position: relative;
    width: min(960px, 100%);
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid rgba(244, 199, 125, 0.35);
    background: linear-gradient(135deg, rgba(244, 199, 125, 0.06), rgba(17, 13, 24, 0.95));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.error-glow {
    position: absolute;
    inset: -40px;
    background:
        radial-gradient(circle at 80% 20%, rgba(62, 42, 79, 0.6), transparent 45%),
        radial-gradient(circle at 18% 75%, rgba(31, 79, 74, 0.5), transparent 48%);
    filter: blur(40px);
    opacity: 0.65;
    pointer-events: none;
}

.error-content {
    position: relative;
    display: grid;
    gap: 0.75rem;
}

.error-content h1 {
    margin: 0.2rem 0 0.5rem 0;
    letter-spacing: 0.08em;
}

.error-lede {
    margin: 0;
    max-width: 760px;
    color: #cbb89d;
    line-height: 1.6;
}

.id-pill {
    align-self: flex-start;
    gap: 0.35rem;
    border-color: rgba(244, 199, 125, 0.45);
    background: rgba(244, 199, 125, 0.12);
    color: var(--bone);
}

.id-pill .pill-label {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.id-pill code {
    color: var(--bone);
}

.error-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.ghost-secondary {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
    color: #dcd0b9;
}

.error-note {
    margin-top: 0.35rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(244, 199, 125, 0.28);
    background: rgba(255, 255, 255, 0.03);
    color: #cbb89d;
}

.error-note h3 {
    margin: 0 0 0.35rem 0;
    letter-spacing: 0.05em;
    color: var(--bone);
}

.error-note p {
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .hero-panel { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .gallery-stage { height: 50vh; }
    .calendar-stage { height: auto; }
    .error-shell { padding: 1.35rem; }
    .error-actions { flex-direction: column; align-items: stretch; }
}
