:root {
  --black: #030303;
  --near-black: #080404;
  --blood: #b60000;
  --bright-blood: #ff1a1a;
  --dark-blood: #3b0000;
  --ash: #c9baba;
  --muted: #725f5f;
  --line: rgba(182, 0, 0, .32);
}

* { box-sizing: border-box; }

html {
  background: var(--black);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ash);
  background:
    radial-gradient(circle at 50% -10%, rgba(120, 0, 0, .22), transparent 38rem),
    linear-gradient(180deg, #050000 0%, #020202 45%, #000 100%);
  font-family: "Cinzel", serif;
  letter-spacing: .06em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.012) 50%, transparent 50%);
  background-size: 100% 4px;
  mix-blend-mode: overlay;
  opacity: .35;
}

.noise {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  opacity: .055;
  animation: grain .22s steps(2) infinite;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

@keyframes grain {
  0% { transform: translate(0,0); }
  25% { transform: translate(2%, -3%); }
  50% { transform: translate(-3%, 2%); }
  75% { transform: translate(3%, 3%); }
  100% { transform: translate(-2%, -2%); }
}

.site-header {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 48px;
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--line);
}

.black-hole {
  position: relative;
  width: clamp(74px, 10vw, 118px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  text-decoration: none;
  filter: drop-shadow(0 0 18px rgba(255, 0, 0, .22));
}

.black-hole::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #000 0 28%, #050000 29% 38%, transparent 39%),
    conic-gradient(from 0deg, transparent 0 8%, #5a0000 16%, #ff1a1a 24%, #4b0000 35%, transparent 44% 58%, #8e0000 70%, #ff2a2a 78%, transparent 90% 100%);
  animation: blackHoleSpin 7s linear infinite;
  box-shadow:
    0 0 0 2px rgba(120, 0, 0, .25),
    0 0 28px rgba(255, 0, 0, .18),
    inset 0 0 18px #000;
}

.black-hole::after {
  content: "";
  position: absolute;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #000;
  box-shadow:
    0 0 10px 5px #000,
    0 0 25px 8px rgba(70, 0, 0, .55);
  z-index: 2;
}

.black-hole span {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  border-top: 1px solid rgba(255, 45, 45, .7);
  border-right: 1px solid transparent;
  transform: rotate(-18deg) scaleY(.62);
  animation: blackHoleTilt 4s ease-in-out infinite alternate;
}

@keyframes blackHoleSpin {
  to { transform: rotate(360deg); }
}

@keyframes blackHoleTilt {
  from { transform: rotate(-18deg) scaleY(.58); opacity: .65; }
  to { transform: rotate(-8deg) scaleY(.72); opacity: 1; }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blood);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .32em;
}

h1 {
  margin: 0;
  color: var(--bright-blood);
  font-family: "UnifrakturMaguntia", "Pirata One", serif;
  font-size: clamp(2.7rem, 8vw, 6.8rem);
  line-height: .82;
  letter-spacing: .025em;
  transform: scaleY(1.08);
  transform-origin: left center;
  text-shadow:
    0 0 5px rgba(255, 0, 0, .38),
    0 0 18px rgba(120, 0, 0, .25),
    2px 3px 0 #250000,
    -1px 0 0 #5a0000;
}

.feed-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 55vh;
}

.feed-heading {
  display: flex;
  justify-content: space-between;
  padding: 18px 4px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: .68rem;
  letter-spacing: .28em;
}

.thread {
  --delay: 0ms;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 18px;
  align-items: start;
  padding: 34px 4px;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(10px);
  animation: reveal .65s var(--delay) forwards;
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

.thread:hover h2 {
  color: #ff3333;
  text-shadow: 0 0 18px rgba(255, 0, 0, .25);
}

.thread-number {
  color: var(--dark-blood);
  font-size: .75rem;
  font-weight: 900;
}

.thread h2 {
  margin: 0 0 14px;
  color: #d60c0c;
  font-size: clamp(1.25rem, 3vw, 2.5rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
  transition: color .2s, text-shadow .2s;
}

.thread time {
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .18em;
}

.empty {
  padding: 80px 0;
  color: var(--dark-blood);
  text-align: center;
  font-weight: 900;
  letter-spacing: .18em;
}

footer {
  width: min(1080px, calc(100% - 40px));
  margin: 80px auto 0;
  padding: 24px 0 40px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--dark-blood);
  font-size: .6rem;
}

footer a, .back-link {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover, .back-link:hover { color: var(--bright-blood); }

.admin-shell {
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0 90px;
}

.back-link {
  display: inline-block;
  margin-bottom: 40px;
  font-size: .68rem;
  letter-spacing: .18em;
}

.panel {
  padding: clamp(24px, 6vw, 54px);
  border: 1px solid var(--line);
  background: rgba(10, 2, 2, .72);
  box-shadow:
    0 35px 90px rgba(0, 0, 0, .65),
    inset 0 0 80px rgba(110, 0, 0, .04);
}

.panel h1 {
  font-size: clamp(2.6rem, 9vw, 5rem);
  margin-bottom: 34px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .24em;
}

input, textarea {
  width: 100%;
  border: 1px solid #3d0909;
  outline: none;
  background: #030101;
  color: var(--bright-blood);
  font: inherit;
  font-size: 1rem;
  letter-spacing: .08em;
  padding: 16px;
  resize: vertical;
}

input:focus, textarea:focus {
  border-color: var(--blood);
  box-shadow: 0 0 0 3px rgba(182, 0, 0, .09);
}

button {
  margin-top: 18px;
  border: 1px solid var(--blood);
  background: var(--blood);
  color: #050000;
  padding: 14px 20px;
  font-family: "Cinzel", serif;
  font-weight: 900;
  letter-spacing: .16em;
  cursor: pointer;
}

button:hover {
  background: var(--bright-blood);
  box-shadow: 0 0 26px rgba(255, 0, 0, .2);
}

.ghost {
  margin: 0;
  background: transparent;
  color: var(--blood);
}

.panel-top, .form-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.form-row {
  align-items: center;
  color: var(--muted);
  font-size: .65rem;
}

.message {
  min-height: 1.2em;
  color: var(--bright-blood);
  font-size: .7rem;
}

.manage-heading {
  margin-top: 50px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .66rem;
  letter-spacing: .2em;
}

.manage-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: #c71111;
  line-height: 1.5;
}

.delete {
  margin: 0;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  border-color: #3d0909;
  font-size: .58rem;
}

.centered {
  display: grid;
  place-items: center;
  padding: 20px;
}

@media (max-width: 600px) {
  .site-header { padding-top: 50px; }
  .thread { grid-template-columns: 38px 1fr; gap: 8px; padding: 26px 2px; }
  .panel-top { display: block; }
  .ghost { margin: 18px 0 28px; }
}

.thread-body {
  margin: 0 0 18px;
  color: #bfaeae;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.98rem, 1.7vw, 1.14rem);
  line-height: 1.85;
  letter-spacing: .018em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 78ch;
}

.counter-row {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: .65rem;
}

#body {
  min-height: 260px;
  line-height: 1.6;
}

.manage-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.manage-copy strong {
  color: #d11212;
  line-height: 1.35;
}

.manage-copy span {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Multi-writer Red Archive */
.intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      circle at 50% 45%,
      rgba(120, 0, 0, .10),
      transparent 28%
    ),
    #020000;
  transition: opacity .8s ease, filter .8s ease;
}

.intro-mark {
  text-align: center;
}

.intro-out {
  opacity: 0;
  filter: blur(4px);
  pointer-events: none;
}

@keyframes introTitle {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes introWords {
  from { opacity: 0; }
  to { opacity: 1; }
}

.intro h2 {
  margin: 0;
  color: #d90d0d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 8vw, 7.5rem);
  line-height: .9;
  letter-spacing: -.045em;
  font-weight: 700;
  text-shadow: 0 0 16px rgba(210, 0, 0, .15);
  animation: introTitle 1.2s .2s both;
}

.thread-body {
  white-space: pre-wrap;
  line-height: 1.75;
  color: #b9aaaa;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: .025em;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.thread-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.author {
  color: #8b2929;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .72rem;
  font-style: italic;
  letter-spacing: .04em;
}

.author:hover {
  color: var(--bright-blood);
}

.write-entry {
  padding: 52px 0 8px;
  text-align: center;
}

.write-entry a {
  color: #5f1717;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: .82rem;
  letter-spacing: .08em;
  transition: .2s;
}

.write-entry a:hover {
  color: #d11616;
  text-shadow: 0 0 14px rgba(255, 0, 0, .18);
}

.writer-shell {
  width: min(680px, calc(100% - 38px));
  margin: 0 auto;
  padding: 42px 0 90px;
}

.identity-card {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.identity-card[hidden] {
  display: none !important;
}

.writer-composer[hidden] {
  display: none !important;
}

.identity-brand {
  font-family: Georgia, serif;
  color: #501010;
  font-size: .72rem;
  letter-spacing: .26em;
  margin-bottom: 58px;
}

.identity-title {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
  font-size: clamp(1.65rem, 5vw, 2.5rem);
  color: #df1717;
  margin: 0 0 38px;
}

.identity-input {
  display: block;
  width: min(430px, 100%);
  margin: 0 auto 20px;
  border: 0;
  border-bottom: 1px solid #371010;
  background: transparent;
  text-align: center;
  padding: 14px 3px;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-style: italic;
  font-size: 18px;
  color: #d8bcbc;
}

.identity-input::placeholder {
  color: #681616;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-style: italic;
  font-size: 15px;
  text-transform: lowercase;
  letter-spacing: .065em;
  opacity: .72;
}

.identity-input:focus {
  box-shadow: none;
  border-color: #9c1717;
}

.text-action,
.returning-link,
.quiet-button {
  border: 0;
  background: transparent;
}

.text-action {
  display: block;
  margin: 28px auto 0;
  color: #8f1515;
  padding: 10px;
  font-size: .62rem;
  letter-spacing: .32em;
}

.returning-link {
  display: block;
  margin: 38px auto 0;
  color: #641313;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-style: italic;
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: lowercase;
}

.identity-note {
  margin-top: 17px;
  color: #3f3232;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: .72rem;
}

.writer-composer {
  padding: 36px 0;
}

.writer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
}

.writer-name {
  margin: 0;
  color: #d60c0c;
  font-family: "UnifrakturMaguntia", Georgia, serif;
  font-size: clamp(2.5rem, 8vw, 4.7rem);
  font-weight: 400;
}

.writer-composer textarea {
  margin-bottom: 25px;
}

.quiet-button {
  color: #641313;
  padding: 8px;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: .76rem;
}

.archive-button {
  display: block;
  margin: 28px 0 0 auto;
}

.permanence {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 0, 0, .97);
  backdrop-filter: blur(7px);
  padding: 28px;
  place-items: center;
}

.permanence:not([hidden]) {
  display: grid;
}

.permanence > div {
  max-width: 590px;
  text-align: center;
}

.permanence h2 {
  margin: 8px 0 18px;
  color: #e01616;
  font-family: "UnifrakturMaguntia", Georgia, serif;
  font-size: clamp(2.7rem, 8vw, 5rem);
  font-weight: 400;
}

.permanence p:not(.eyebrow) {
  color: #9d8585;
  font-family: Georgia, serif;
  line-height: 1.7;
}

.permanence-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
}

.permanence .archive-button {
  margin: 0;
}

.message {
  min-height: 1.2em;
  color: #a73b3b;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: .78rem;
}

.owner-link {
  opacity: .32;
}

@media (max-width: 640px) {
  .thread {
    grid-template-columns: 36px 1fr;
    gap: 10px;
  }
  .site-header {
    padding-top: 48px;
    gap: 15px;
  }
  .black-hole {
    width: 68px;
  }
  .thread-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .intro p {
    letter-spacing: .28em;
  }
  .writer-top {
    align-items: center;
  }
}

/* FIX: once authenticated, identity/login UI fully disappears */
.auth-hidden,
.identity-hidden {
  display: none !important;
}

.composer-active {
  display: block !important;
}

html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}