:root{
  --bg:#030303;
  --line:rgba(235,235,235,.12);
  --text:#f0efec;
  --muted:rgba(240,239,236,.72);
  --muted2:rgba(240,239,236,.48);
  --accent:#a7191d;
  --card:rgba(5,5,5,.72);
  --danger:#d2272b;
  --ok:#8ccf9b;
  --warn:#c9a766;
}

*{ box-sizing:border-box; }

html,
body{
  min-height:100%;
  background:var(--bg);
}

body{
  position:relative;
  isolation:isolate;
  min-height:100vh;
  color:var(--text);
  font-family:"IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  background:
    radial-gradient(900px 460px at 72% 28%, rgba(167,25,29,.18), transparent 62%),
    radial-gradient(620px 420px at 28% 70%, rgba(255,255,255,.045), transparent 64%),
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 38%),
    var(--bg);
  overflow-x:hidden;
}

body::before,
body::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
}

body::before{
  z-index:0;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px),
    url("/assets/undercurrent-reference.png") center / cover no-repeat;
  background-size:46px 46px, 46px 46px, cover;
  opacity:.18;
  mix-blend-mode:screen;
  filter:grayscale(1) contrast(1.18);
}

body::after{
  z-index:1;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 42%, transparent 0 32%, rgba(0,0,0,.76) 80%),
    linear-gradient(90deg, rgba(167,25,29,.14), transparent 22%, transparent 78%, rgba(167,25,29,.08));
  opacity:.55;
}

.nav,
.wrap{
  position:relative;
  z-index:2;
}

.nav{
  z-index:10;
}

.nav a,
#adminPlus,
#accountBtn,
.btn,
.tool,
.sideToggle,
.dots,
.navBtn{
  border-radius:4px;
  border:1px solid var(--line);
  background:rgba(3,3,3,.56);
  color:rgba(240,239,236,.78);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.nav a:hover,
#adminPlus:hover,
#accountBtn:hover,
.btn:hover,
.tool:hover,
.dots:hover,
.navBtn:hover{
  border-color:rgba(210,39,43,.62);
  box-shadow:0 10px 28px rgba(167,25,29,.20), inset 0 -1px 0 rgba(210,39,43,.42);
  color:#fff4f4;
}

.nav a.active,
.btnPrimary{
  background:var(--accent);
  color:#fff4f4;
  border-color:rgba(238,67,71,.68);
  box-shadow:0 10px 30px rgba(167,25,29,.30);
}

h1,
h2,
.title,
.postTitle,
.previewTitle,
.modalTitle{
  color:#f6f2ee;
}

h1{
  font-family:"Cormorant Garamond", Georgia, serif;
  font-weight:700;
  letter-spacing:.16em;
  text-shadow:0 0 12px rgba(255,255,255,.12), 2px 0 0 rgba(167,25,29,.3);
}

h1::after{
  content:"";
  display:block;
  width:min(520px, 72vw);
  height:1px;
  margin:16px auto 0;
  background:linear-gradient(90deg, transparent, rgba(240,239,236,.58), rgba(167,25,29,.88), transparent);
  box-shadow:0 0 18px rgba(167,25,29,.34);
}

.head,
.panel,
.card,
.postCard,
.backdrop > .modal,
.modalCard,
.sideCard,
.previewPanel,
.dropBox{
  border-radius:4px;
  border:1px solid var(--line);
  background:var(--card);
  box-shadow:0 28px 80px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.card,
.postCard{
  border-radius:4px;
}

.card:hover,
.postCard:hover{
  border-color:rgba(210,39,43,.42);
  box-shadow:0 30px 70px rgba(0,0,0,.72), 0 0 24px rgba(167,25,29,.12);
}

.sub,
.hint,
.postExcerpt,
.excerpt,
.crumb,
.meta,
.status,
.statusLine,
.content,
.editor,
.previewContent,
.previewExcerpt,
label,
.account-menu a,
.menu button{
  color:rgba(240,239,236,.72);
}

input,
textarea,
select,
.editor{
  border-radius:4px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.34);
  color:var(--text);
}

input:focus,
textarea:focus,
select:focus,
.editor:focus{
  border-color:rgba(210,39,43,.62);
  box-shadow:0 0 0 3px rgba(167,25,29,.18);
}

.meta{
  background:linear-gradient(to top, rgba(3,3,3,.95), rgba(3,3,3,.72), rgba(3,3,3,0));
}

.dots,
.menu,
.account-menu,
.modalHeader{
  border-radius:4px;
  background:rgba(7,7,7,.88);
  border-color:var(--line);
}

.btnDanger,
.menu .danger,
.err,
.bad{
  color:rgba(238,67,71,.95);
}

.btnDanger:hover{
  border-color:rgba(238,67,71,.62);
  box-shadow:0 12px 34px rgba(167,25,29,.2);
}

.content blockquote,
.editor blockquote,
.previewContent blockquote{
  border-left-color:rgba(210,39,43,.62);
  background:rgba(167,25,29,.08);
  border-radius:4px;
}

.content mark,
.editor mark,
.previewContent mark{
  background:rgba(167,25,29,.28);
  color:#fff4f4;
  border-radius:4px;
}

.cover,
.content img,
.editor img,
.previewContent img{
  border-radius:4px;
  border-color:var(--line);
}

.dot.ok{ background:var(--ok); }
.dot.warn{ background:var(--warn); }
.dot.err{ background:var(--danger); }

.decrypt-char{
  display:inline-block;
  min-width:.56em;
}

.decrypt-char.is-random{
  color:rgba(238,67,71,.82);
  text-shadow:0 0 12px rgba(167,25,29,.72);
}

.archiveFlags{
  position:absolute;
  top:14px;
  left:14px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  z-index:6;
  pointer-events:none;
}

.archiveFlag{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:28px;
  padding:6px 9px;
  border-radius:4px;
  border:1px solid rgba(235,235,235,.14);
  background:rgba(3,3,3,.72);
  color:rgba(240,239,236,.84);
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.archiveFlagMark{
  width:13px;
  height:13px;
  border-radius:50%;
  border:1px solid rgba(240,239,236,.58);
  position:relative;
}

.archiveFlag-read .archiveFlagMark::after,
.archiveFlag-saved .archiveFlagMark::after{
  content:"";
  position:absolute;
  left:3px;
  top:1px;
  width:5px;
  height:8px;
  border-right:2px solid rgba(255,244,244,.92);
  border-bottom:2px solid rgba(255,244,244,.92);
  transform:rotate(42deg);
}

.archiveFlag-started .archiveFlagMark{
  border-color:rgba(201,167,102,.88);
}

.archiveFlag-started .archiveFlagMark::after{
  content:"";
  position:absolute;
  inset:3px;
  border-radius:50%;
  background:rgba(201,167,102,.88);
}

.archiveFlag-read{
  border-color:rgba(140,207,155,.32);
}

.archiveFlag-saved{
  border-color:rgba(210,39,43,.38);
}

.savePostBtn{
  min-width:86px;
  justify-content:center;
}

.savePostBtn.is-saved{
  background:rgba(167,25,29,.28);
  border-color:rgba(238,67,71,.68);
  color:#fff4f4;
}

.readerProgressBar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:3px;
  z-index:1000;
  background:rgba(255,255,255,.04);
}

.readerProgressFill{
  display:block;
  width:0;
  height:100%;
  background:linear-gradient(90deg, rgba(238,67,71,.2), rgba(238,67,71,.95), rgba(255,244,244,.7));
  box-shadow:0 0 16px rgba(167,25,29,.72);
  transition:width .18s ease;
}

.lockedStrip{
  margin-top:24px;
  padding:13px 14px;
  border-radius:4px;
  border:1px solid rgba(210,39,43,.26);
  background:rgba(167,25,29,.08);
  color:rgba(240,239,236,.72);
  font-size:12px;
  letter-spacing:.08em;
  line-height:1.7;
  text-transform:uppercase;
}

@keyframes archiveRise{
  from{
    opacity:0;
    transform:translateY(14px);
    filter:blur(3px);
  }
  to{
    opacity:1;
    transform:translateY(0);
    filter:blur(0);
  }
}

.wrap > *,
.card,
.postCard,
.panel,
.head{
  animation:archiveRise .55s cubic-bezier(.2,.8,.2,1) both;
}

.grid > *:nth-child(2){ animation-delay:.05s; }
.grid > *:nth-child(3){ animation-delay:.1s; }
.grid > *:nth-child(4){ animation-delay:.15s; }
.grid > *:nth-child(5){ animation-delay:.2s; }
.grid > *:nth-child(6){ animation-delay:.25s; }

@media (prefers-reduced-motion: reduce){
  .wrap > *,
  .card,
  .postCard,
  .panel,
  .head{
    animation:none;
  }
}
