:root {
    /* ---- the control panel: change these first ---- */
    --void: #08080a;
    /* background, near-black */
    --panel: #101015;
    /* lifted surfaces (cards, forms) */
    --ink: #e7e7ea;
    /* body text, off-white */
    --dim: #74747f;
    /* muted / secondary text */

    --hot: #ff2e88;
    /* PRIMARY accent - hot pink */
    --cyan: #1ae0ff;
    /* SECONDARY accent - electric cyan */
    --acid: #c6ff00;
    /* rare third - acid green (success / placed) */
    --blood: #ff3b3b;
    /* danger / destructive */

    --line: #26262f;
    /* default border - thick, not hairline */

    /* fonts - swap --display to experiment. --hand is the human voice. */
    --mono: "Space Mono", ui-monospace, "Cascadia Code", "JetBrains Mono", monospace;
    --display: "Space Mono", ui-monospace, monospace;
    /* <-- SWAP ME for headings */
    --hand: "EB Garamond", Georgia, serif;
    /* the prayers' voice */

    --maxw: 940px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--void);
    background-image:
        linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.018) 100%),
        linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.018) 100%);
    background-size: 28px 28px;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
}

/* CRT scanlines + a barely-there flicker, painted over the .grain element */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9;
    background: repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0px,
            rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0.20) 3px,
            rgba(0, 0, 0, 0.20) 3px);
    mix-blend-mode: multiply;
    animation: flicker 6s infinite steps(60);
}

@keyframes flicker {

    0%,
    100% {
        opacity: .55
    }

    50% {
        opacity: .42
    }

    97% {
        opacity: .6
    }
}

/* ---- links: they look like links. deal with it. ---- */
a {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

a:hover {
    color: var(--hot);
    border-bottom-color: var(--hot);
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px 100px;
    position: relative;
    z-index: 2;
}

/* ============================ masthead ============================ */
.masthead {
    position: relative;
    z-index: 2;
    max-width: var(--maxw);
    margin: 0 auto 40px;
    padding: 40px 20px 26px;
    border-bottom: 2px solid var(--line);
}

.masthead__home {
    display: inline-block;
}

.masthead__title {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(26px, 5.5vw, 50px);
    line-height: 1.0;
    letter-spacing: -0.02em;
    text-transform: lowercase;
    color: var(--ink);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.masthead__tagline {
    font-family: var(--mono);
    color: var(--dim);
    margin: 14px 0 0;
    font-size: 0.84rem;
}

.masthead__tagline::before {
    content: "// ";
    color: var(--cyan);
}

/* ============================ zone chips ============================ */
.zones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 40px;
}

.zone-chip {
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: lowercase;
    padding: 6px 11px;
    border: 2px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    background: var(--panel);
    transition: none;
}

.zone-chip::before {
    content: "#";
    color: var(--hot);
    margin-right: 1px;
}

.zone-chip:hover {
    border-color: var(--hot);
    color: var(--hot);
}

.zone-chip .n {
    color: var(--dim);
    margin-left: 6px;
}

/* ============================ prayer grid ============================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

.card {
    position: relative;
    display: block;
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 5px 5px 0 #000;
    color: var(--ink);
}

.card:hover {
    border-color: var(--hot);
    box-shadow: 5px 5px 0 var(--hot);
}

.card__img {
    display: block;
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    filter: grayscale(0.15) contrast(1.05);
    border-bottom: 2px solid var(--line);
}

.card:hover .card__img {
    filter: none;
}

.card__body {
    padding: 10px 12px 14px;
}

.card__zone {
    font-family: var(--mono);
    font-size: 0.66rem;
    text-transform: lowercase;
    color: var(--cyan);
}

.card__zone::before {
    content: "#";
}

.card__excerpt {
    margin: 6px 0 0;
    color: var(--dim);
    font-size: 0.82rem;
    font-family: var(--mono);
}

.card__unplaced {
    color: var(--hot);
}

.card__unplaced::before {
    content: "!";
    margin-right: 2px;
}

/* ============================ single prayer ============================ */
.prayer {
    max-width: 720px;
    margin: 0 auto;
}

.prayer__figure {
    border: 2px solid var(--line);
    border-radius: 0;
    box-shadow: 6px 6px 0 #000;
    background: #000;
    position: relative;
}

.prayer__img {
    display: block;
    width: 100%;
    height: auto;
}

.prayer__pin {
    position: absolute;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--hot);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--void), 0 0 14px var(--hot);
    pointer-events: none;
}

.prayer__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: baseline;
    margin: 20px 2px 0;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: lowercase;
}

.prayer__meta .label {
    color: var(--cyan);
}

.prayer__meta .label::after {
    content: ":";
}

/* THE HUMAN VOICE - the one place that isn't a terminal. let it breathe. */
.prayer__reflection {
    margin: 28px 2px 0;
    font-family: var(--hand);
    font-size: 1.35rem;
    line-height: 1.7;
    color: var(--ink);
    border-left: 3px solid var(--hot);
    padding-left: 20px;
}

.prayer__reflection.is-empty {
    color: var(--dim);
    font-style: italic;
    border-color: var(--line);
    font-family: var(--mono);
    font-size: 0.95rem;
}

/* ============================ section headings ============================ */
.section-title {
    font-family: var(--display);
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: -0.01em;
    font-size: 1.1rem;
    color: var(--ink);
    border-bottom: 2px solid var(--line);
    padding-bottom: 8px;
    margin: 0 0 22px;
}

.section-title::before {
    content: "> ";
    color: var(--cyan);
}

/* ============================ flashes ============================ */
.flashes {
    max-width: var(--maxw);
    margin: 0 auto 20px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.flash {
    font-family: var(--mono);
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 0;
    margin-bottom: 8px;
    border: 2px solid var(--line);
    background: var(--panel);
}

.flash::before {
    content: ">> ";
}

.flash--ok {
    border-color: var(--acid);
    color: var(--acid);
}

.flash--error {
    border-color: var(--blood);
    color: var(--blood);
}

/* ============================ forms / admin ============================ */
.panel {
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: 0;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 6px 6px 0 #000;
}

label {
    display: block;
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: lowercase;
    color: var(--dim);
    margin: 14px 0 5px;
}

label::before {
    content: "\203A ";
    color: var(--cyan);
}

input[type=text],
input[type=password],
input[type=date],
input[type=file],
textarea,
select {
    width: 100%;
    background: var(--void);
    color: var(--ink);
    border: 2px solid var(--line);
    border-radius: 0;
    padding: 10px 12px;
    font-family: var(--mono);
    font-size: 0.95rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--cyan);
}

textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.6;
}

.btn {
    font-family: var(--mono);
    text-transform: lowercase;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    background: var(--hot);
    color: var(--void);
    border: 2px solid var(--hot);
    padding: 10px 18px;
    border-radius: 0;
    margin-top: 16px;
    box-shadow: 3px 3px 0 #000;
    transition: none;
}

.btn::before {
    content: "[ ";
}

.btn::after {
    content: " ]";
}

.btn:hover {
    background: var(--void);
    color: var(--hot);
    box-shadow: 3px 3px 0 var(--hot);
}

.btn--ghost {
    background: transparent;
    color: var(--cyan);
    border-color: var(--cyan);
}

.btn--ghost:hover {
    background: transparent;
    color: var(--hot);
    border-color: var(--hot);
    box-shadow: 3px 3px 0 var(--hot);
}

.btn--danger {
    background: transparent;
    color: var(--blood);
    border-color: var(--blood);
}

.btn--danger:hover {
    background: var(--blood);
    color: var(--void);
    box-shadow: 3px 3px 0 #000;
}

.admin-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.admin-row img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border: 2px solid var(--line);
    border-radius: 0;
}

.tag-stage {
    font-size: 0.64rem;
    text-transform: lowercase;
    padding: 2px 7px;
    border-radius: 0;
    font-family: var(--mono);
}

.tag-stage--rough {
    color: var(--hot);
    border: 1px solid var(--hot);
}

.tag-stage--placed {
    color: var(--acid);
    border: 1px solid var(--acid);
}

.tag-hidden {
    color: var(--dim);
}

.tag-hidden::before {
    content: "(";
}

.tag-hidden::after {
    content: ")";
}

/* ============================ pin editor ============================ */
.pinstage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    cursor: crosshair;
    border: 2px solid var(--line);
    border-radius: 0;
    overflow: hidden;
}

.pinstage img {
    display: block;
    max-width: 100%;
    height: auto;
}

.pinstage .marker {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid var(--hot);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--void), 0 0 12px var(--hot);
    pointer-events: none;
}

.coords {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--dim);
    margin-top: 10px;
}

.coords::before {
    content: "// ";
    color: var(--cyan);
}

/* ============================ footer ============================ */
.footer {
    max-width: var(--maxw);
    margin: 0 auto;
    text-align: left;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.76rem;
    text-transform: lowercase;
    padding: 28px 20px 60px;
    border-top: 2px solid var(--line);
    position: relative;
    z-index: 2;
}

.footer::before {
    content: "// non illegitimus carborundum";
    display: block;
    color: var(--cyan);
    margin-bottom: 6px;
}

/* ============================ misc ============================ */
.empty {
    text-align: center;
    color: var(--dim);
    font-family: var(--mono);
    padding: 70px 0;
    text-transform: lowercase;
}

.empty::before {
    content: "// ";
    color: var(--hot);
}

::selection {
    background: var(--hot);
    color: var(--void);
}

@media (prefers-reduced-motion: reduce) {
    .grain {
        animation: none;
    }

    .masthead__title::after {
        animation: none;
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 14px;
    }

    .prayer__reflection {
        font-size: 1.18rem;
    }
}
