/* Afterdark — dark & intimate theme. */

:root {
  --bg: #0d0b10;
  --bg-raised: #15121a;
  --bg-card: #16131d;
  --text: #e8e4ec;
  --text-muted: #9a93a6;
  --hairline: #2a2533;
  --accent: #b76e79;        /* dusty rose */
  --accent-soft: #7d5a8c;   /* plum */
  --danger: #c2616b;
  --ok: #7fae8a;
  --bulb: #ffce85;          /* warm fairy-light glow */
  --postcard: #1b1724;      /* card paper */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 720px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient dream-light: soft drifting glows behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 18% 12%, rgba(125, 90, 140, 0.18), transparent 60%),
    radial-gradient(34vmax 34vmax at 85% 22%, rgba(183, 110, 121, 0.14), transparent 60%),
    radial-gradient(40vmax 40vmax at 60% 95%, rgba(125, 90, 140, 0.12), transparent 60%);
  animation: drift 26s ease-in-out infinite alternate;
}

/* Faint starfield for depth. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(232, 228, 236, 0.5), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(232, 228, 236, 0.35), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(232, 228, 236, 0.4), transparent),
    radial-gradient(1px 1px at 85% 65%, rgba(232, 228, 236, 0.3), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(232, 228, 236, 0.25), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(232, 228, 236, 0.3), transparent);
  opacity: 0.6;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -3%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.2px; }
h1 { font-size: 2.2rem; }

/* --- Layout ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.75rem);   /* brand at left edge, tabs at right edge */
  background: rgba(13, 11, 16, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.brand { white-space: nowrap; }
.site-nav { flex-shrink: 0; }
.brand {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 600;
  color: var(--text); letter-spacing: 0.5px;
  text-shadow: 0 0 18px rgba(183, 110, 121, 0.35);
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 0.35rem; }
.site-nav a {
  color: var(--text); font-family: var(--sans); font-size: 0.92rem; line-height: 1;
  padding: 0.5rem 0.85rem; border-radius: 999px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.site-nav a:hover {
  color: var(--text); background: rgba(232, 228, 236, 0.07); text-decoration: none;
}
/* Admin — a keyholder's badge: plum-tinted pill with a warm gold shield,
   distinct from the rose "Share yours" CTA so the desk has its own identity. */
.site-nav a.nav-admin {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--serif); font-weight: 600; font-size: 1rem; letter-spacing: 0.3px;
  color: #efe6f3;
  background: color-mix(in srgb, var(--accent-soft) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-soft) 55%, transparent);
}
.site-nav a.nav-admin:hover {
  background: color-mix(in srgb, var(--accent-soft) 34%, transparent);
  border-color: var(--accent-soft); color: #fff;
  box-shadow: 0 0 16px rgba(125, 90, 140, 0.4);
}
.nav-admin-icon { color: var(--bulb); filter: drop-shadow(0 0 4px rgba(255, 206, 133, 0.5)); }
/* Call-to-action — understated fallback (the header invite pin leads on wide
   screens). A soft rose-tinted serif pill that warms up gently on hover. */
.site-nav a.nav-cta {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: #f3e7ea; font-family: var(--serif); font-weight: 600;
  font-size: 1.02rem; letter-spacing: 0.3px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, transparent);
}
.site-nav a.nav-cta:hover {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border-color: var(--accent); color: #fff;
  box-shadow: 0 0 16px rgba(183, 110, 121, 0.35);
}

/* Buy Me a Coffee corner cup — official logo on a themed dark disc. */
.coffee-corner { position: fixed; right: 18px; bottom: 18px; z-index: 60; }
.coffee-fab {
  display: flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: #f4ecdd; border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 206, 133, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.coffee-fab {
  position: relative;   /* anchors the pulse ring */
}
.coffee-fab img { width: 32px; height: 32px; display: block; position: relative; z-index: 1; }
.coffee-fab:hover {
  text-decoration: none; transform: translateY(-3px) rotate(-8deg);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6), 0 0 26px rgba(255, 206, 133, 0.5);
}

/* Hover slides out a cream note (same colour as the cup) with a few dark
   coffee beans spilled inside it, beneath the words. */
.coffee-label {
  position: absolute; right: 62px; top: 50%;
  display: block; white-space: nowrap; overflow: hidden;
  padding: 0.55rem 0.95rem; border-radius: 11px 13px 10px 12px;
  background: #f4ecdd;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0; transform: translateY(-50%) translateX(14px) rotate(2.5deg) scale(0.96);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.coffee-corner:hover .coffee-label {
  opacity: 1; transform: translateY(-50%) translateX(0) rotate(-1.5deg) scale(1);
}
.coffee-text {
  position: relative; z-index: 1;
  font-family: var(--sans); font-size: 0.85rem; line-height: 1; font-weight: 600;
  color: #3b2a1e; text-shadow: 0 1px 0 rgba(244, 236, 221, 0.7);
}
/* Scattered dark coffee beans behind the text. */
.coffee-beans { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.coffee-beans i {
  position: absolute; left: var(--x); top: var(--y);
  width: 12px; height: 9px; border-radius: 50%; background: #281a0e;
  transform: translate(-50%, -50%) rotate(var(--r));
}
.coffee-beans i::before {   /* the bean's centre crease */
  content: ""; position: absolute; left: 50%; top: 15%; bottom: 15%; width: 1.5px;
  transform: translateX(-50%);
  background: rgba(244, 236, 221, 0.4); border-radius: 50%;
}
@media (max-width: 600px) { .coffee-label { display: none; } }

.site-main { max-width: var(--maxw); margin: 0 auto; padding: 0.5rem 1.25rem 3rem; }

.site-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--hairline); text-align: center;
  color: var(--text-muted); font-size: 0.85rem;
}
.tip-jar a { color: var(--accent-soft); }
.footer-admin { margin-top: 0.6rem; }
.footer-admin a { color: var(--text-muted); font-size: 0.8rem; }
.footer-admin a:hover { color: var(--accent); }

/* --- Flash messages ---------------------------------------------------- */
.flashes { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.flash {
  padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 0.5rem;
  border: 1px solid var(--hairline); background: var(--bg-raised);
}
.flash-success { border-color: rgba(127,174,138,0.4); }
.flash-error { border-color: rgba(194,97,107,0.5); }

/* --- Controls (sort + category) --------------------------------------- */
.controls { margin-bottom: 2rem; }
.sort-controls { display: flex; gap: 1rem; margin-bottom: 0.9rem; }
.sort-link { color: var(--text-muted); font-size: 0.9rem; padding-bottom: 2px; }
.sort-link.active { color: var(--text); border-bottom: 1px solid var(--accent); }

.category-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-block; font-size: 0.78rem; padding: 0.2rem 0.7rem;
  border: 1px solid var(--hairline); border-radius: 999px;
  color: var(--text-muted); background: var(--bg-raised);
}
a.chip:hover { color: var(--text); text-decoration: none; border-color: var(--accent-soft); }
.chip.active { color: var(--text); border-color: var(--accent); }

/* --- Archive intro ----------------------------------------------------- */
.archive-intro { text-align: center; margin: 0.5rem 0 2rem; position: relative; }

/* A small swag of fairy lights over the title — same wire + bulb language
   as the postcard strings, filling the empty space beside the centred text. */
.intro-lights {
  position: relative; display: block;
  width: min(480px, 82%); height: 30px;
  margin: 0 auto 0.7rem;
}
.intro-lights::before {                 /* the drooping wire */
  content: ""; position: absolute; top: 0; left: 4px; right: 4px; height: 20px;
  border-bottom: 2px solid rgba(183, 110, 121, 0.4);
  border-radius: 0 0 46% 46% / 0 0 100% 100%;
}
.intro-lights i {                       /* each lit bulb, hung along the swag */
  position: absolute; width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7e6, var(--bulb));
  box-shadow: 0 0 7px var(--bulb),
              0 0 16px color-mix(in srgb, var(--bulb) 55%, transparent);
  animation: twinkle 4s ease-in-out infinite;
  animation-delay: calc(var(--n, 0) * -0.5s);
}
.intro-lights i:nth-child(3n+1) { --bulb: #b76e79; }   /* dusty rose */
.intro-lights i:nth-child(3n+2) { --bulb: #9b7bb0; }   /* plum */
@media (max-width: 600px) { .intro-lights { width: 92%; } }
@media (prefers-reduced-motion: reduce) { .intro-lights i { animation: none; } }
.archive-title {
  font-size: 2.6rem; margin: 0 0 0.3rem;
  background: linear-gradient(120deg, var(--text), var(--accent) 60%, var(--accent-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.archive-tagline { color: var(--text-muted); font-style: italic; margin: 0; }

/* Invite pin — a tilted little postcard tucked into the left-side gutter
   beside the header (breaks out of the text column, clear of the coffee
   button on the right). Wide screens only. */
.invite-pin {
  display: none; position: absolute; top: 50%;
  right: calc(50% + 384px); width: 170px;
  transform: translateY(-50%) rotate(-3deg);
  text-align: left; text-decoration: none;
  padding: 0.85rem 0.95rem; border-radius: 6px;
  background:
    linear-gradient(165deg, rgba(255, 206, 133, 0.10), rgba(0, 0, 0, 0)),
    var(--postcard);
  border: 1px dashed rgba(255, 206, 133, 0.5);
  border-top: 3px solid color-mix(in srgb, var(--bulb) 55%, var(--hairline));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.invite-pin::before {   /* the lit peg it hangs from */
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7e6, var(--bulb));
  box-shadow: 0 0 8px var(--bulb);
}
.invite-pin:hover {
  text-decoration: none; transform: translateY(-50%) rotate(0deg) scale(1.03);
  /* settle straight on hover */
  border-color: rgba(255, 206, 133, 0.85);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 206, 133, 0.26);
}
.invite-pin-eyebrow {
  display: block; font-family: var(--sans); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--bulb);
  margin-bottom: 0.3rem;
}
.invite-pin-text { font-family: var(--serif); font-size: 1.05rem; line-height: 1.3; color: var(--text); }
@media (min-width: 1180px) { .invite-pin { display: block; } }

/* --- Postcard wall on fairy-light strings ------------------------------ */
.gallery {
  width: min(940px, 96vw);
  margin-left: 50%;
  transform: translateX(-50%);   /* break out of the narrower main column, stay centred */
  padding: 0.5rem 0 2rem;
}

/* Each row is a swag of wire holding two postcards; stacked rows zigzag. */
.gallery-row {
  position: relative;
  display: flex;
  gap: 2.2rem;
  align-items: flex-start;
  justify-content: center;
  padding-top: 54px;            /* room for the wire, cords + pegs */
  margin-bottom: 1.2rem;
}
/* The drooping garland wire across the row. */
.row-wire {
  position: absolute; top: 8px; left: 7%; right: 7%; height: 30px;
  border-bottom: 2px solid rgba(183, 110, 121, 0.45);
  border-radius: 0 0 46% 46% / 0 0 100% 100%;
  pointer-events: none;
}

.card {
  position: relative;
  flex: 1 1 0; min-width: 0; max-width: 440px;
}
.card:nth-of-type(even) { margin-top: 18px; }   /* offset = zigzag hang */

/* The cord a postcard hangs from. */
.card-link {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 26px;
  background: linear-gradient(to bottom, rgba(183, 110, 121, 0.6), var(--hairline));
}
/* The lit peg/bulb on the wire — colour set per category via --peg. */
.card-knot {
  position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
  width: 13px; height: 13px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #fff7e6, var(--peg, var(--bulb)));
  box-shadow: 0 0 8px var(--peg, var(--bulb)),
              0 0 18px color-mix(in srgb, var(--peg, var(--bulb)) 55%, transparent);
  animation: twinkle 4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.55s);
}
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.62; }
}

/* The postcard surface — tilted, swaying, lit. */
.card-inner {
  background:
    linear-gradient(165deg, rgba(40, 33, 52, 0.6), rgba(0, 0, 0, 0)),
    var(--postcard);
  border: 1px solid var(--hairline);
  border-top: 3px solid color-mix(in srgb, var(--peg, var(--accent)) 55%, var(--hairline));
  border-radius: 6px;
  padding: 1.2rem 1.25rem 1.4rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  transform-origin: top center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: sway 6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.7s);
}
.card:nth-of-type(odd) .card-inner { rotate: -1.8deg; }
.card:nth-of-type(even) .card-inner { rotate: 1.8deg; }

.card:hover .card-inner {
  rotate: 0deg;
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(183, 110, 121, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55),
              0 0 26px color-mix(in srgb, var(--peg, var(--bulb)) 28%, transparent);
  animation-play-state: paused;
}
.card:hover .card-knot {
  box-shadow: 0 0 11px var(--peg, var(--bulb)),
              0 0 26px color-mix(in srgb, var(--peg, var(--bulb)) 75%, transparent);
}

/* Per-category light + accent colours. */
.cat-fantasy           { --peg: #9b7bb0; }
.cat-confession        { --peg: #d8a657; }
.cat-intrusive-thought { --peg: #6f9aa8; }

.card-meta {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  color: var(--text-muted); font-size: 0.78rem; margin-bottom: 0.55rem;
}
.cat-chip {
  color: color-mix(in srgb, var(--peg, var(--text-muted)) 75%, #ffffff);
  border-color: color-mix(in srgb, var(--peg, var(--hairline)) 55%, transparent);
  background: color-mix(in srgb, var(--peg, var(--bg-raised)) 14%, var(--bg-raised));
}
.card-title { margin: 0.2rem 0 0.5rem; font-size: 1.4rem; }
.card-body {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.7;
  color: var(--text); white-space: pre-wrap; margin: 0.4rem 0 1rem;
}
.empty { color: var(--text-muted); text-align: center; padding: 3rem 0; font-style: italic; }

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(0.7deg); }
}

/* Reveal-on-scroll (only when JS is active, so no-JS users see everything). */
.has-js .gallery .card { opacity: 0; }
.has-js .gallery .card.in-view { opacity: 1; animation: rise 0.6s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .card-inner, .card-knot { animation: none; }
  .has-js .gallery .card { opacity: 1; }
  .has-js .gallery .card.in-view { animation: none; }
}

/* --- Resonance button -------------------------------------------------- */
.resonance { margin: 0; }
.resonate-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 0.4rem 0.9rem; font-family: var(--sans); font-size: 0.9rem;
  transition: color 0.2s, border-color 0.2s, transform 0.1s;
}
.resonate-btn:hover { color: var(--accent); border-color: var(--accent); }
.resonate-btn .spark { font-size: 1rem; transition: transform 0.2s; }
.resonate-btn:hover .spark { transform: scale(1.2); }
.resonate-btn .count { font-variant-numeric: tabular-nums; opacity: 0.8; }
.resonate-btn.resonated {
  color: var(--accent); border-color: var(--accent);
  background: rgba(183,110,121,0.12); cursor: default;
}
.resonate-btn.resonated .spark { animation: spark-pop 0.35s ease; }
.resonate-btn:disabled { cursor: default; }
@keyframes spark-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* --- Forms ------------------------------------------------------------- */
.submit-page, .admin-login { max-width: 600px; }
.submit-notice {
  color: var(--text-muted); font-size: 0.9rem; background: var(--bg-raised);
  border: 1px solid var(--hairline); border-radius: 10px; padding: 1rem 1.1rem;
}
.submit-form { margin-top: 1.5rem; }
.field { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.field-inline { flex-direction: row; align-items: center; gap: 0.5rem; }
.field-row { display: flex; gap: 1rem; }
.field-row .field { flex: 1; }
.field label { font-size: 0.85rem; color: var(--text-muted); }
.field input[type="text"], .field input[type="password"],
.field input[type="email"],
.field textarea, .field select {
  width: 100%; background: var(--bg-raised); color: var(--text);
  border: 1px solid var(--hairline); border-radius: 8px;
  padding: 0.6rem 0.75rem; font-family: var(--sans); font-size: 1rem;
}
.field textarea { font-family: var(--serif); font-size: 1.15rem; line-height: 1.6; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
}
.field input:disabled, .field textarea:disabled, .field select:disabled {
  opacity: 0.35; cursor: not-allowed;
  border-color: var(--hairline); color: var(--text-muted);
}
.field label:has(+ input:disabled),
.field label:has(+ select:disabled) {
  opacity: 0.35;
}
.field-error { color: var(--danger); font-size: 0.82rem; }

/* Notification section — visually separated, tonally softer than the main form */
.notify-section {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.notify-heading {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 0.35rem;
}
.notify-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.55;
}
.notify-section .field {
  margin-bottom: 0;
}

/* --- Buttons ----------------------------------------------------------- */
.btn {
  cursor: pointer; font-family: var(--sans); font-size: 0.95rem;
  padding: 0.6rem 1.2rem; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--bg-raised); color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #160f12; font-weight: 600; }
.btn-primary:hover { background: #c47e88; }
.btn-approve { border-color: rgba(127,174,138,0.6); color: var(--ok); }
.btn-reject { border-color: rgba(194,97,107,0.6); color: var(--danger); }

/* --- Admin review ------------------------------------------------------ */
.admin-bar { display: flex; align-items: center; justify-content: space-between; }
.mod-note {
  color: var(--text-muted); font-size: 0.85rem; background: var(--bg-raised);
  border: 1px solid var(--hairline); border-radius: 10px; padding: 0.9rem 1rem;
}
.mod-card {
  background: var(--bg-card); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.mod-meta { display: flex; gap: 0.7rem; flex-wrap: wrap; color: var(--text-muted); font-size: 0.78rem; }
.mod-title { margin: 0.4rem 0 0.3rem; font-size: 1.2rem; }
.mod-body { font-family: var(--serif); font-size: 1.15rem; white-space: pre-wrap; }
.mod-actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; }

/* Status filter as little postcards strung on the wire, echoing the wall. */
.mod-strung {
  position: relative; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1.6rem; padding-top: 46px; margin: 1.4rem 0 2.2rem;
}
.pin-pending  { --peg: var(--bulb); }
.pin-approved { --peg: #7fae8a; }
.pin-rejected { --peg: #c2616b; }
.mod-pin {
  position: relative; flex: 0 1 190px; min-width: 150px;
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem;
  padding: 0.75rem 1rem; border-radius: 6px;
  background: linear-gradient(165deg, rgba(40, 33, 52, 0.6), rgba(0, 0, 0, 0)), var(--postcard);
  border: 1px solid var(--hairline);
  border-top: 3px solid color-mix(in srgb, var(--peg) 55%, var(--hairline));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.mod-pin:nth-of-type(odd)  { rotate: -1.6deg; }
.mod-pin:nth-of-type(even) { rotate: 1.6deg; margin-top: 14px; }
.mod-pin:hover {
  rotate: 0deg; transform: translateY(-2px); text-decoration: none;
  border-color: color-mix(in srgb, var(--peg) 60%, var(--hairline));
}
.mod-pin.active {
  border-color: color-mix(in srgb, var(--peg) 75%, transparent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5),
              0 0 22px color-mix(in srgb, var(--peg) 35%, transparent);
}
/* --- The Gatekeeper's Desk side panels --------------------------------- */
/* Stats live in the empty gutters beside the 720px column on wide screens,
   and reflow stacked to the bottom of the desk on narrow screens. */
.desk-aside {
  margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--hairline);
}
.desk-aside-title {
  font-family: var(--serif); font-size: 1.05rem; margin: 0 0 0.85rem;
  color: var(--text-muted); letter-spacing: 0.4px;
}
.desk-group { margin-bottom: 1.1rem; }
.desk-group-label {
  display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent-soft); margin-bottom: 0.45rem;
}
/* Left: each row is a labelled proportion bar — count on the right, a glowing
   rose→plum fill underneath showing its share of the group. */
.desk-bar { margin-bottom: 0.7rem; }
.desk-bar:last-child { margin-bottom: 0; }
.desk-bar-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  font-size: 0.84rem; color: var(--text-muted); margin-bottom: 0.3rem;
}
.desk-bar-head b { font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--text); }
.desk-bar-track {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--bg-raised); border: 1px solid var(--hairline);
}
.desk-bar-fill {
  display: block; height: 100%; min-width: 2px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: width 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Right: the tally — softly lit cards with big gradient numerals. */
.desk-figure {
  display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.9rem;
  padding: 1.1rem 1.15rem; border-radius: 14px; text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(183, 110, 121, 0.12), transparent 70%),
    var(--bg-card);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(232, 228, 236, 0.04), 0 6px 18px rgba(0, 0, 0, 0.3);
}
.desk-figure-num {
  font-family: var(--serif); font-size: 2.7rem; line-height: 1; font-weight: 600;
  background: linear-gradient(120deg, var(--text), var(--accent) 70%, var(--accent-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.desk-figure-label {
  font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.desk-figure-heart {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(183, 110, 121, 0.2), transparent 70%),
    var(--bg-card);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline));
}
.desk-heart {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(183, 110, 121, 0.7);
  animation: heart-glow 3.5s ease-in-out infinite;
}
@keyframes heart-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; text-shadow: 0 0 12px rgba(183, 110, 121, 0.95); }
}
@media (prefers-reduced-motion: reduce) { .desk-heart { animation: none; } }
.desk-cats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stat-cat {
  font-size: 0.8rem; color: var(--text-muted);
  padding: 0.3rem 0.7rem; border-radius: 999px;
  background: var(--bg-raised); border: 1px solid var(--hairline);
}
.stat-cat-name { color: var(--text); }

/* Wide screens: float each panel into its gutter beside the centred column. */
@media (min-width: 1240px) {
  .desk-aside {
    position: fixed; top: 92px; width: 210px;
    max-height: calc(100vh - 120px); overflow-y: auto;
    margin-top: 0; padding-top: 0; border-top: none;
    z-index: 5;
  }
  .desk-aside-left  { right: calc(50% + (var(--maxw) / 2) + 24px); }
  .desk-aside-right { left:  calc(50% + (var(--maxw) / 2) + 24px); }
}

.mod-search { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1.2rem; }
.mod-search input[type="search"] {
  flex: 1 1 auto; min-width: 0; padding: 0.5rem 0.8rem;
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: 8px;
  color: var(--text); font-size: 0.9rem;
}
.mod-search input[type="search"]:focus { outline: none; border-color: var(--accent-soft); }
.mod-search-clear { color: var(--text-muted); font-size: 0.85rem; }

.mod-pin-label { font-family: var(--sans); font-size: 0.85rem; color: var(--text); }
.mod-pin-count {
  font-family: var(--serif); font-size: 1.4rem; line-height: 1;
  color: color-mix(in srgb, var(--peg) 70%, #ffffff);
}

/* --- Pagination -------------------------------------------------------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: 2rem;
}
.pager-link { color: var(--accent); font-size: 0.95rem; }
.pager-link.disabled { color: var(--text-muted); opacity: 0.5; }
.pager-status { color: var(--text-muted); font-size: 0.85rem; }

/* --- Error pages ------------------------------------------------------- */
.error-page { text-align: center; padding: 3rem 0; }
.error-page h1 { font-size: 3rem; color: var(--accent); margin-bottom: 0.5rem; }
.error-page p { color: var(--text-muted); }

/* --- Age gate ---------------------------------------------------------- */
body.age-gated .site-header,
body.age-gated .site-main,
body.age-gated .site-footer { filter: blur(8px); pointer-events: none; user-select: none; }

.age-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
  background: rgba(6, 5, 8, 0.92); backdrop-filter: blur(4px);
}
.age-gate[hidden] { display: none; }
.age-gate-card {
  max-width: 460px; background: var(--bg-card); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 2rem; text-align: center;
}
.age-gate-card h2 { margin-top: 0; font-size: 1.8rem; }
.age-gate-card p { color: var(--text-muted); }
.age-gate-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; align-items: center; }
.age-gate-leave { color: var(--text-muted); font-size: 0.9rem; }

/* On narrow screens, stack the row's postcards; each hangs on its own peg. */
@media (max-width: 620px) {
  .gallery { width: 100%; margin-left: 0; transform: none; }
  .gallery-row { flex-direction: column; gap: 2.6rem; padding-top: 40px; }
  .row-wire { display: none; }
  .card, .card:nth-of-type(even) { max-width: 100%; margin-top: 0; }
}

/* Tighten the header so brand + 3 tabs always fit on small phones. */
@media (max-width: 560px) {
  .site-header { padding: 0.7rem 0.9rem; }
  .brand { font-size: 1.3rem; }
  .site-nav { gap: 0.15rem; }
  .site-nav a { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .card-body { font-size: 1.2rem; }
  .field-row { flex-direction: column; gap: 0; }
  .archive-title { font-size: 2.1rem; }
}

@media (max-width: 360px) {
  .brand { font-size: 1.15rem; }
  .site-nav a { padding: 0.35rem 0.45rem; font-size: 0.8rem; }
}
