:root {
  --bg: #100205;
  --bg-deep: #050102;
  --panel: rgba(35, 6, 12, 0.82);
  --panel-strong: rgba(24, 3, 8, 0.94);
  --wine: #5f0617;
  --wine-bright: #8f1027;
  --blue: #4d6fc4;
  --blue-bright: #86a2ff;
  --silver: #dce0ef;
  --text: #f7eef0;
  --muted: #d9c7cb;
  --line: rgba(194, 211, 255, 0.2);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cormorant Garamond", serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 18%, rgba(93, 103, 190, 0.18), transparent 18%),
    radial-gradient(circle at 50% 24%, rgba(169, 19, 44, 0.52), transparent 30%),
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.06), transparent 16%),
    linear-gradient(180deg, #2a040c 0%, #120205 38%, #090103 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0 18%, rgba(220, 224, 239, 0.12) 18.3%, transparent 18.8%),
    radial-gradient(circle at center, transparent 0 25%, rgba(220, 224, 239, 0.08) 25.25%, transparent 25.7%),
    radial-gradient(circle at center, transparent 0 31%, rgba(220, 224, 239, 0.06) 31.2%, transparent 31.7%);
  opacity: 0.45;
  transform: scale(1.3);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 32% 8%, rgba(255, 255, 255, 0.65) 0 1px, transparent 2px),
    radial-gradient(circle at 74% 16%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 36%, rgba(255, 255, 255, 0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 24% 78%, rgba(255, 255, 255, 0.85) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 72%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 64% 54%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px);
  opacity: 0.75;
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.ambient {
  position: fixed;
  width: 20rem;
  height: 20rem;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}

.ambient-left {
  top: 6vh;
  left: -8rem;
  background: rgba(143, 16, 39, 0.42);
}

.ambient-right {
  top: 10vh;
  right: -8rem;
  background: rgba(77, 111, 196, 0.2);
}

.site-chrome,
.hero,
.panel-section,
.quote-banner,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(17, 3, 7, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-lockup-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.brand-lockup-text {
  display: flex;
  flex-direction: column;
  line-height: 0.9;
}

.site-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--silver);
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  border-color: rgba(194, 211, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.nav-link-button {
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.top-ribbon {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1.75rem;
  position: relative;
  z-index: 2;
}

.top-ribbon span,
.hero-chips span,
.portal-meta,
.tag-pill,
.story-status {
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(194, 211, 255, 0.22);
  border-radius: 999px;
  background: rgba(15, 3, 7, 0.55);
  color: var(--silver);
  font-family: "Cinzel", serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  align-items: center;
  justify-items: center;
  min-height: 34rem;
  padding: 4.2rem 1.25rem 2rem;
  text-align: center;
}

.hero-copy-wrap {
  max-width: 44rem;
  display: grid;
  justify-items: center;
}

.eyebrow,
.section-kicker {
  margin: 0;
  font-family: "Cinzel", serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver);
  font-size: 0.78rem;
}

h2,
h3,
p {
  margin: 0;
}

.brand-velvet {
  font-family: "Cinzel", serif;
  font-size: clamp(2.5rem, 7vw, 5rem);
  color: var(--blue);
  text-shadow:
    0 0 0.5px var(--silver),
    0 0 18px rgba(134, 162, 255, 0.22),
    0 6px 22px rgba(0, 0, 0, 0.4);
}

.brand-whorecrux {
  font-family: "UnifrakturCook", serif;
  font-size: clamp(2.7rem, 7vw, 5.4rem);
  color: #090909;
  -webkit-text-stroke: 1px rgba(220, 224, 239, 0.7);
  text-shadow:
    0 0 1px rgba(220, 224, 239, 0.8),
    0 10px 24px rgba(0, 0, 0, 0.5);
}

.hero-copy,
.section-subcopy,
.portal-card p,
.event-card p,
.library-book p,
.footer-note,
.story-card p {
  color: var(--muted);
}

.hero-copy {
  margin-top: 1rem;
  font-size: 1.35rem;
  line-height: 1.45;
  max-width: 40rem;
}

.hero-chips {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  padding: 0.95rem 1.35rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.button:hover,
.button:focus-visible,
.portal-card:hover,
.portal-card:focus-visible,
.event-card:hover,
.story-card:hover {
  transform: translateY(-3px);
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
  box-shadow: 0 10px 30px rgba(77, 111, 196, 0.35);
}

.button-secondary {
  color: var(--silver);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-mark {
  position: relative;
  width: min(360px, 78vw);
  margin: 0 auto;
}

.hero-mark::before {
  content: "";
  position: absolute;
  inset: 10% 10%;
  border-radius: 50%;
  border: 1px solid rgba(220, 224, 239, 0.22);
  box-shadow:
    0 0 0 22px rgba(220, 224, 239, 0.04),
    0 0 70px rgba(143, 16, 39, 0.3);
}

.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.twinkle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.twinkle {
  position: absolute;
  width: var(--size, 6px);
  height: var(--size, 6px);
  left: var(--left, 50%);
  top: var(--top, 50%);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 28%, rgba(134, 162, 255, 0.75) 30%, transparent 72%);
  opacity: 0;
  filter: blur(0.3px);
  animation: twinkle-fade var(--duration, 5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.twinkle::before,
.twinkle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, 0.72);
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.twinkle::before {
  width: 1px;
  height: calc(var(--size, 6px) * 1.8);
}

.twinkle::after {
  width: calc(var(--size, 6px) * 1.8);
  height: 1px;
}

@keyframes twinkle-fade {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(0.55);
  }

  40% {
    opacity: 0.95;
    transform: scale(1);
  }

  60% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}

.panel-section,
.quote-banner {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.section-heading {
  text-align: center;
}

.section-heading h2 {
  margin-top: 0.5rem;
  font-family: "Cinzel", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.section-subcopy {
  max-width: 42rem;
  margin: 0.9rem auto 0;
  font-size: 1.14rem;
}

.calling-card {
  width: min(580px, 100%);
  margin: 1.25rem auto 0;
  padding: 1.25rem 1.1rem 1.35rem;
  border-radius: 26px;
  border: 1px solid rgba(194, 211, 255, 0.24);
  background:
    radial-gradient(circle at top, rgba(134, 162, 255, 0.14), transparent 30%),
    radial-gradient(circle at 20% 20%, rgba(169, 19, 44, 0.24), transparent 26%),
    linear-gradient(180deg, rgba(15, 3, 7, 0.96), rgba(36, 8, 13, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 18px 40px rgba(0, 0, 0, 0.28);
  position: relative;
  overflow: hidden;
}

.calling-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  border: 1px solid rgba(194, 211, 255, 0.12);
  pointer-events: none;
}

.calling-card-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.calling-card-sigil,
.portal-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(194, 211, 255, 0.18);
  color: var(--blue-bright);
  font-size: 1.3rem;
}

.calling-card-label {
  color: var(--silver);
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bio-block {
  margin-top: 1rem;
  text-align: center;
}

.bio-block p {
  margin: 0.4rem 0;
  font-size: 1.15rem;
  color: var(--muted);
}

.bio-block p:nth-child(2),
.bio-block p:nth-child(3) {
  color: var(--silver);
}

.bio-block p:first-child {
  font-size: 1.28rem;
}

.bio-block p:last-child {
  margin-top: 0.8rem;
  color: var(--blue-bright);
  font-style: italic;
}

.section-grid,
.calendar-grid,
.story-grid,
.tag-cloud {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col,
.story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calendar-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-card,
.event-card,
.story-card,
.library-book {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.2rem;
  border-radius: 24px;
  text-decoration: none;
  border: 1px solid rgba(194, 211, 255, 0.18);
  background:
    radial-gradient(circle at top right, rgba(134, 162, 255, 0.12), transparent 30%),
    linear-gradient(120deg, rgba(143, 16, 39, 0.3), rgba(255, 255, 255, 0.03)),
    var(--panel-strong);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.portal-card:hover,
.portal-card:focus-visible,
.event-card:hover,
.story-card:hover {
  border-color: rgba(194, 211, 255, 0.42);
}

.portal-card strong,
.event-card h3,
.library-book h3,
.story-card h3 {
  font-family: "Cinzel", serif;
  font-size: 1.35rem;
}

.event-date {
  color: var(--blue-bright);
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-teaser .library-shelf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.library-book {
  width: min(420px, 100%);
}

.book-label {
  color: var(--blue-bright);
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-banner {
  text-align: center;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-style: italic;
  color: var(--silver);
}

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

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
}

.footer-note {
  max-width: 42rem;
  margin: 0.5rem auto 0;
}

.footer-year {
  color: var(--blue-bright);
  margin-top: 0.5rem;
}

.page-hero {
  min-height: 30rem;
}

.tag-cloud {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tag-pill {
  text-align: center;
}

.story-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.story-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.story-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.text-link {
  color: var(--blue-bright);
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.text-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
}

body.modal-open {
  overflow: hidden;
}

.story-modal[hidden] {
  display: none;
}

.story-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(6, 1, 2, 0.7);
  backdrop-filter: blur(10px);
}

.story-modal-shell {
  position: relative;
  width: min(860px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  padding: 1.4rem 1.4rem 1.4rem;
  border-radius: 28px;
  border: 1px solid rgba(194, 211, 255, 0.24);
  background:
    radial-gradient(circle at top, rgba(134, 162, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(23, 4, 8, 0.98), rgba(15, 3, 6, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.56);
}

.story-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  min-width: 72px;
  height: 42px;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(194, 211, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--silver);
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.story-modal-header,
.story-feedback-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.story-modal-header {
  padding-right: 5.25rem;
}

.story-modal-header h2,
.story-feedback h3 {
  font-family: "Cinzel", serif;
}

.story-modal-header h2 {
  margin-top: 0.35rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.story-modal-body {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--text);
}

.story-feedback {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(194, 211, 255, 0.12);
}

.rating-summary {
  display: grid;
  justify-items: end;
  gap: 0.2rem;
}

.rating-summary strong {
  font-family: "Cinzel", serif;
  font-size: 1.65rem;
  color: var(--blue-bright);
}

.rating-summary span {
  color: var(--muted);
}

.comment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.comment-field {
  display: grid;
  gap: 0.45rem;
}

.comment-field span {
  color: var(--silver);
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.comment-field input,
.comment-field textarea {
  width: 100%;
  border: 1px solid rgba(194, 211, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.8rem 0.9rem;
  font: inherit;
}

.comment-field input:focus,
.comment-field textarea:focus {
  outline: 1px solid rgba(134, 162, 255, 0.6);
  border-color: rgba(134, 162, 255, 0.6);
}

.comment-field-wide,
.comment-form .button {
  grid-column: 1 / -1;
}

.rating-picker {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rating-star {
  appearance: none;
  border: 1px solid rgba(194, 211, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(220, 224, 239, 0.45);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.3rem;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease;
}

.rating-star:hover,
.rating-star.is-selected {
  color: #ffd77c;
  border-color: rgba(255, 215, 124, 0.45);
  background: rgba(255, 215, 124, 0.08);
  transform: translateY(-2px);
}

.comment-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.3rem;
}

.comment-card,
.comment-empty {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(194, 211, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.comment-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.comment-card-header strong {
  font-family: "Cinzel", serif;
}

.comment-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.comment-stars {
  color: #ffd77c;
  letter-spacing: 0.08em;
}

.comment-empty {
  color: var(--muted);
  text-align: center;
}

.story-card-empty {
  align-items: flex-start;
}

.admin-layout {
  display: grid;
  gap: 2rem;
}

.admin-auth-panel {
  width: min(640px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-form .button {
  width: auto;
}

.admin-helper,
.admin-success,
.admin-error {
  grid-column: 1 / -1;
  font-size: 1rem;
}

.admin-helper {
  color: var(--muted);
}

.admin-success {
  color: var(--blue-bright);
}

.admin-error {
  color: #ff9ea8;
}

.admin-form-actions,
.admin-card-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-card-button {
  min-width: 0;
}

.admin-delete-button {
  border-color: rgba(255, 158, 168, 0.28);
  color: #ffd3d9;
}

.admin-story-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-story-card {
  align-items: flex-start;
}

.admin-section-heading {
  text-align: left;
}

.admin-section-heading .section-subcopy {
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 960px) {
  .site-chrome {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    justify-content: center;
  }

  .hero {
    min-height: 30rem;
    padding-top: 3.25rem;
  }

  .tag-cloud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .two-col,
  .three-col,
  .calendar-grid,
  .story-grid {
    grid-template-columns: 1fr;
  }

  .comment-form,
  .admin-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 1rem, 1120px);
  }

  .hero-copy {
    font-size: 1.15rem;
  }

  .hero {
    min-height: 28rem;
    padding-top: 2.75rem;
  }

  .panel-section,
  .quote-banner,
  .site-chrome {
    padding: 1.1rem;
    border-radius: 22px;
  }

  .button {
    width: 100%;
  }

  .top-ribbon,
  .hero-chips,
  .site-nav,
  .story-tags,
  .story-links {
    gap: 0.5rem;
  }

  .story-modal-shell {
    padding: 1rem;
    border-radius: 22px;
  }

  .story-modal-header {
    padding-right: 0;
  }

  .story-modal-close {
    position: static;
    margin-bottom: 1rem;
  }

  .story-modal-header,
  .story-feedback-header,
  .comment-card-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .tag-cloud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
