/* The Sword of the Spirit – reflections and page transitions */
:root { --swd-line: #4f4c47; --swd-field: #0c0d0d; --swd-ease: cubic-bezier(.22, .61, .36, 1); }
.swd-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Page transition: white light with the logo ---------- */
@property --swd-m { syntax: "<percentage>"; inherits: false; initial-value: 150%; }
.swd-veil {
  position: fixed; inset: 0; z-index: 100005; pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, #fff 0%, #fcfaf5 55%, #f2eee5 100%);
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
html.swd-veil-on .swd-veil, .swd-veil.show { opacity: 1; visibility: visible; transition: opacity .45s ease, visibility 0s; }
.swd-veil-logo {
  position: absolute; left: 50%; top: 50%;
  width: clamp(110px, 22vw, 170px); height: auto;
  transform: translate(-50%, -50%) scale(.94); opacity: 0;
  filter: grayscale(1) contrast(1.05) drop-shadow(0 8px 22px rgba(0, 0, 0, .16));
  transition: opacity .5s ease .1s, transform 1.2s var(--swd-ease);
}
html.swd-veil-on .swd-veil-logo, .swd-veil.show .swd-veil-logo { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.swd-veil.leaving .swd-veil-logo { opacity: 0; transform: translate(-50%, -50%) scale(1.03); transition: opacity .35s ease, transform .5s ease; }
.swd-veil.recede {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(var(--swd-m) - 45%), transparent var(--swd-m));
          mask-image: linear-gradient(to bottom, #000 calc(var(--swd-m) - 45%), transparent var(--swd-m));
  animation: swd-recede 1.1s cubic-bezier(.45, 0, .2, 1) forwards;
}
@keyframes swd-recede { 0% { --swd-m: 150%; opacity: 1; } 70% { opacity: 1; } 100% { --swd-m: -5%; opacity: 0; } }

/* ---------- Reflections page: the typed verse ---------- */
.swd-landing {
  background: #000;
  border-bottom: 1px solid #5c5953;
  padding: clamp(70px, 11vw, 130px) 20px clamp(48px, 7vw, 84px);
  text-align: center;
}
.swd-quote {
  margin: 0 auto; max-width: 19em;
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-size: clamp(1.45rem, .9rem + 2.2vw, 2.55rem); line-height: 1.42;
}
.swd-quote-text { margin: 0; font-style: italic; color: #a9a7a2; text-wrap: balance; }
.swd-quote-ref {
  margin-top: 1.5em; min-height: 1.7em;
  font-family: var(--sans, 'Trebuchet MS', Arial, sans-serif);
  font-size: clamp(.66rem, .62rem + .2vw, .78rem);
  letter-spacing: .32em; text-transform: uppercase; color: #8a8781;
}
html.swd-type .swd-quote-text, html.swd-type .swd-quote-ref { visibility: hidden; }
.swd-ch { visibility: hidden; }
.swd-ch.v { visibility: visible; }
.swd-caret { position: relative; }
.swd-caret::after {
  content: ""; position: absolute; left: .05em; top: .14em; bottom: .06em;
  width: max(1.5px, .055em); background: currentColor; border-radius: 1px; transition: opacity .6s;
}
.swd-caret.blink::after { animation: swd-blink 1.05s steps(1) infinite; }
.swd-caret.gone::after { animation: none; opacity: 0; }
@keyframes swd-blink { 50% { opacity: 0; } }
.swd-after { transition: opacity 1s ease, transform 1s var(--swd-ease); }
html.swd-type .swd-after, .swd-landing.typing .swd-after { opacity: 0; transform: translateY(12px); }

/* ---------- Search ---------- */
.swd-search { position: relative; max-width: 640px; margin: clamp(40px, 6vw, 64px) auto 0; }
.swd-search input {
  width: 100%; height: 56px; padding: 0 58px 0 22px;
  background: var(--swd-field); border: 1px solid #5d5a54; border-radius: 0;
  color: #ece8df; font: 17px var(--serif, Georgia, serif);
  -webkit-appearance: none; appearance: none;
}
.swd-search input::placeholder { color: #85817a; font-style: italic; }
.swd-search input:focus { outline: none; border-color: #c8c4be; box-shadow: 0 0 0 3px rgba(200, 196, 190, .12); }
.swd-search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.swd-search button {
  position: absolute; right: 4px; top: 4px; width: 48px; height: 48px;
  display: grid; place-items: center; background: none; border: 0; color: #d9d5cb; cursor: pointer;
}
.swd-search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.swd-search button:hover { color: #fff; }

/* ---------- Share your own reflection ---------- */
.swd-share { max-width: 640px; margin: 16px auto 0; text-align: left; }
.swd-share > summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: center; align-items: center; gap: 12px;
  padding: 15px 20px; border: 1px solid #918c81; color: #dad6cd;
  font: 10px var(--sans, 'Trebuchet MS', Arial, sans-serif); letter-spacing: 3px; text-transform: uppercase;
  transition: background .15s;
}
.swd-share > summary::-webkit-details-marker { display: none; }
.swd-share > summary::after { content: "+"; font-size: 16px; letter-spacing: 0; line-height: 1; transition: transform .3s; }
.swd-share[open] > summary::after { transform: rotate(45deg); }
.swd-share > summary:hover { background: #1b1b1b; }
.swd-share-form { border: 1px solid #3d3b37; border-top: 0; padding: 26px clamp(18px, 4vw, 32px) 30px; background: #070707; }
.swd-share-intro { margin: 0 0 22px; color: #b8b4ad; font-size: 16px; line-height: 1.6; }

.swd-share-form p, .swd-replies .comment-form p { margin: 0 0 16px; }
.swd-share-form label, .swd-replies .comment-form label, .swd-topics legend {
  display: block; margin-bottom: 7px;
  font: 10px var(--sans, 'Trebuchet MS', Arial, sans-serif); letter-spacing: 2px; text-transform: uppercase; color: #c0bcb3;
}
.swd-share-form label span, .swd-replies .comment-form label span { letter-spacing: 1px; text-transform: none; color: #8a8781; }
.swd-share-form input[type=text], .swd-share-form input[type=email], .swd-share-form textarea,
.swd-replies .comment-form input[type=text], .swd-replies .comment-form input[type=email], .swd-replies .comment-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #56534d; border-radius: 0;
  background: var(--swd-field); color: #ece8df; font: 16px/1.5 var(--serif, Georgia, serif);
}
.swd-share-form textarea, .swd-replies .comment-form textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.swd-share-form input:focus, .swd-share-form textarea:focus,
.swd-replies .comment-form input:focus, .swd-replies .comment-form textarea:focus { outline: none; border-color: #c8c4be; }
.swd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.swd-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; border: 0; }
.swd-topics legend { width: 100%; padding: 0; }
.swd-topics label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 14px;
  border: 1px solid #56534d; color: #c7c1b6; letter-spacing: 1.5px; cursor: pointer;
}
.swd-topics input { margin: 0; accent-color: #d1cbc0; }
.swd-topics label:has(input:checked) { background: #c5c0b8; border-color: #c5c0b8; color: #121312; }
.swd-share-form .swd-consent label, .swd-replies .swd-consent label {
  display: flex; align-items: flex-start; gap: 10px;
  font: 14px/1.55 var(--serif, Georgia, serif); letter-spacing: 0; text-transform: none; color: #b8b4ad;
}
.swd-consent label span { letter-spacing: 0; color: inherit; }
.swd-consent input { margin-top: 4px; flex: none; accent-color: #d1cbc0; }
.swd-consent a { text-decoration: underline; text-underline-offset: 3px; }
.swd-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.swd-button, .swd-replies .form-submit .submit {
  display: inline-block; padding: 14px 22px; border: 1px solid #c5c0b8; border-radius: 0; cursor: pointer;
  background: #c5c0b8; color: #121312;
  font: 10px var(--sans, 'Trebuchet MS', Arial, sans-serif); letter-spacing: 3px; text-transform: uppercase;
  transition: background .15s, border-color .15s;
}
.swd-button:hover, .swd-replies .form-submit .submit:hover { background: #e0dbd1; border-color: #e0dbd1; }
.swd-errors { margin: 0 0 18px; padding: 12px 16px; border: 1px solid #8a4b44; background: rgba(138, 75, 68, .12); color: #e8c9c4; font-size: 15px; line-height: 1.5; }
.swd-errors ul { margin: 0; padding-left: 18px; }
.swd-thanks { max-width: 640px; margin: 18px auto 0; padding: 14px 18px; border: 1px solid #6b7a5c; background: rgba(107, 122, 92, .12); color: #d9e2cf; font-size: 16px; line-height: 1.55; text-align: left; }

/* ---------- Saved reflections (on this device) ---------- */
.swd-saved-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--swd-line); }
.swd-saved-list li { display: flex; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--swd-line); }
.swd-saved-list .kicker { min-width: 86px; font-size: 9px; letter-spacing: 2.5px; }
.swd-saved-list a { flex: 1; font-size: 20px; line-height: 1.3; }
.swd-saved-list a:hover { color: #fff; }
.swd-unsave { background: none; border: 0; color: #8f8b84; cursor: pointer; font: 10px var(--sans, 'Trebuchet MS', Arial, sans-serif); letter-spacing: 1.5px; text-transform: uppercase; }
.swd-unsave:hover { color: #e0dbd1; }
.swd-saved-note { margin: 10px 0 0; color: #77746e; font: 9px var(--sans, 'Trebuchet MS', Arial, sans-serif); letter-spacing: 1.5px; text-transform: uppercase; }

/* ---------- List of reflections ---------- */
#swd-results { transition: opacity .2s ease; }
#swd-results.swd-loading { opacity: .45; pointer-events: none; }
.swd-result-note { margin: -10px 0 22px; color: #b8b4ad; font-size: 16px; }
.swd-result-note a { text-decoration: underline; text-underline-offset: 4px; }
.swd-filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin: -6px 0 22px; }
.swd-chips, .swd-sort { display: flex; flex-wrap: wrap; gap: 8px; }
.swd-chips a, .swd-sort a { padding: 10px 14px; border: 1px solid #77736b; color: #c7c1b6; font: 10px var(--sans, 'Trebuchet MS', Arial, sans-serif); letter-spacing: 1.2px; text-transform: uppercase; }
.swd-chips a:hover, .swd-chips a.active { background: #c5c0b8; border-color: #c5c0b8; color: #121312; }
.swd-sort a { border-color: transparent; padding-left: 4px; padding-right: 4px; margin-left: 10px; }
.swd-sort a:hover, .swd-sort a.active { color: #fff; border-bottom-color: #ddd7cc; }
.swd-list { list-style: none; margin: 0 0 30px; padding: 0; border-top: 1px solid var(--swd-line); }
.swd-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) 40px; gap: 20px; align-items: start; padding: 24px 0; border-bottom: 1px solid var(--swd-line); }
.swd-card .kicker { font-size: 9px; letter-spacing: 2.5px; }
.swd-card h3 { margin: 9px 0 8px; font-size: 25px; font-weight: normal; line-height: 1.22; }
.swd-card h3 a:hover { color: #fff; }
.swd-card p { margin: 0 0 10px; color: #b8b4ad; font-size: 16px; line-height: 1.6; }
.swd-meta { color: #a6a39b; font: 10px/1.6 var(--sans, 'Trebuchet MS', Arial, sans-serif); letter-spacing: 1.2px; }
.swd-empty { padding: 30px 0 60px; }

.swd-up {
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; padding: 9px 0 7px;
  background: none; border: 1px solid #56534d; color: #c7c1b6; cursor: pointer;
  font: 13px var(--sans, 'Trebuchet MS', Arial, sans-serif);
  transition: background .15s, color .15s, border-color .15s;
}
.swd-up svg { width: 15px; height: 15px; fill: currentColor; }
.swd-up:hover { border-color: #c8c4be; color: #fff; }
.swd-up[aria-pressed=true] { background: #c5c0b8; border-color: #c5c0b8; color: #121312; }
.swd-up-big { flex-direction: row; width: auto; gap: 10px; padding: 11px 18px; }
.swd-up-label, .swd-fav-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }

.swd-fav { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; background: none; border: 0; color: #8f8b84; cursor: pointer; transition: color .15s; }
.swd-fav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; transition: fill .15s; }
.swd-fav:hover { color: #e0dbd1; }
.swd-fav[aria-pressed=true] { color: #e6d5a8; }
.swd-fav[aria-pressed=true] svg { fill: currentColor; }

/* ---------- A single reflection ---------- */
.swd-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.swd-actions .swd-fav { width: auto; height: auto; display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border: 1px solid #56534d; color: #c7c1b6; font: 13px var(--sans, 'Trebuchet MS', Arial, sans-serif); }
.swd-actions .swd-fav svg { width: 16px; height: 16px; }
.swd-actions .swd-fav:hover { border-color: #c8c4be; }
.swd-prose p:first-child::first-letter { float: none; padding: 0; font-size: inherit; line-height: inherit; color: inherit; }
.swd-replies { margin-top: 50px; padding-top: 30px; border-top: 1px solid #66615a; }
.swd-replies h2 { margin: 0 0 22px; color: #d8d5cf; font: 12px var(--sans, 'Trebuchet MS', Arial, sans-serif); letter-spacing: 5px; text-transform: uppercase; }
.swd-replies .swd-thanks { margin: 0 0 22px; }
.swd-reply-list { list-style: none; margin: 0 0 34px; padding: 0; border-top: 1px solid #3e3c38; }
.swd-reply { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid #3e3c38; }
.swd-reply-vote { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.swd-rv { width: 34px; height: 28px; display: grid; place-items: center; padding: 0; background: none; border: 0; color: #8f8b84; cursor: pointer; }
.swd-rv svg { width: 15px; height: 15px; fill: currentColor; }
.swd-rv:hover { color: #e0dbd1; }
.swd-rv[aria-pressed=true] { color: #e6d5a8; }
.swd-score { color: #d0ccc4; font: 13px var(--sans, 'Trebuchet MS', Arial, sans-serif); }
.swd-reply .swd-meta strong { color: #e0dbd1; font-weight: normal; letter-spacing: 1.5px; text-transform: uppercase; }
.swd-badge { display: inline-block; margin-left: 6px; padding: 2px 7px; border: 1px solid #8f8b84; font-size: 8px; letter-spacing: 1.5px; text-transform: uppercase; }
.swd-reply-text { color: #d5d0c7; font-size: 17px; line-height: 1.75; }
.swd-reply-text p { margin: 6px 0 0; }
.swd-reply-text p:first-child::first-letter { float: none; padding: 0; font-size: inherit; line-height: inherit; color: inherit; }
.swd-none, .swd-note { color: #a8a49e; font-size: 16px; }
.swd-replies .comment-reply-title { margin: 0 0 8px; font-size: 26px; font-weight: normal; }
.swd-replies .comment-form { font-size: 16px; }

@media (max-width: 640px) {
  .swd-row { grid-template-columns: 1fr; }
  .swd-card { grid-template-columns: 46px minmax(0, 1fr) 34px; gap: 12px; }
  .swd-up { width: 46px; }
  .swd-card h3 { font-size: 21px; }
  .swd-sort a { margin-left: 0; }
  .swd-saved-list li { flex-wrap: wrap; gap: 6px 14px; }
  .swd-saved-list .kicker { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .swd-veil.recede { -webkit-mask-image: none; mask-image: none; animation: swd-fade .4s ease forwards; }
  @keyframes swd-fade { to { opacity: 0; } }
  .swd-veil-logo, .swd-after { transition: none; }
}
