/* Very Private Nothing — a dark liturgy in CSS */

:root {
  --bg: #06060a;
  --bg-2: #0b0a10;
  --panel: rgba(17, 15, 23, 0.72);
  --panel-edge: rgba(140, 120, 160, 0.14);
  --ink: #cbc7d4;
  --ink-dim: #7b7488;
  --ink-faint: #4b4656;
  --blood: #c01030;
  --blood-bright: #ff2b46;
  --ember: #ff5a36;
  --moon: #9aa6cf;
  --gold: #c9a24a;
  --glow: 0 0 24px rgba(255, 43, 70, 0.35);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 50% -10%, #16121d 0%, transparent 60%),
    radial-gradient(900px 600px at 50% 120%, #120a10 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Atmosphere layers ──────────────────────────────────────────────── */
#embers {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 88%, rgba(0,0,0,0.9) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 8s steps(6) infinite;
}
@keyframes drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-12px, 10px); }
}

/* ── Stage ──────────────────────────────────────────────────────────── */
.stage {
  position: relative; z-index: 2;
  max-width: 720px; margin: 0 auto;
  min-height: 100dvh; padding: clamp(28px, 6vh, 72px) 22px 28px;
  display: flex; flex-direction: column; align-items: center;
}

.masthead { text-align: center; margin-bottom: clamp(22px, 5vh, 44px); }

.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 7vw, 3.7rem);
  letter-spacing: 0.04em;
  line-height: 1.04;
  color: #e7e3ee;
  text-shadow: 0 0 1px rgba(255,255,255,0.2), 0 0 26px rgba(120,90,140,0.25);
  animation: flicker 6s infinite;
}
.title .nothing {
  color: var(--blood-bright);
  text-shadow: 0 0 18px rgba(255,43,70,0.55), 0 0 42px rgba(192,16,48,0.4);
  font-style: italic;
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.72; }
  94% { opacity: 1; }
  96% { opacity: 0.85; }
  97% { opacity: 1; }
}
.tagline {
  margin-top: 14px; color: var(--ink-dim);
  font-family: var(--serif); font-style: italic;
  letter-spacing: 0.06em; font-size: clamp(0.95rem, 2.4vw, 1.1rem);
}

/* ── The emblem: angel & demon as yin and yang ──────────────────────── */
.emblem {
  width: clamp(176px, 31vw, 236px);
  margin: 0 auto 4px;
  filter: drop-shadow(0 14px 46px rgba(0, 0, 0, 0.65));
  animation: emblemFloat 7s ease-in-out infinite;
}
.emblem__svg { width: 100%; height: auto; display: block; overflow: visible; }
.emblem__ring {
  transform-box: fill-box; transform-origin: center;
  animation: emblemSpin 96s linear infinite;
}
@keyframes emblemFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@keyframes emblemSpin { to { transform: rotate(360deg); } }

/* the feather and the ember orbit the disc, always opposite each other */
.emblem__orbit {
  transform-box: view-box; transform-origin: 180px 180px;
  animation: emblemOrbit 26s linear infinite;
}
@keyframes emblemOrbit { to { transform: rotate(360deg); } }
.emblem__feather {
  transform-box: fill-box; transform-origin: center;
  animation: emblemFlutter 4.5s ease-in-out infinite;
}
@keyframes emblemFlutter {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(9deg); }
}
.emblem__ember {
  transform-box: fill-box; transform-origin: center;
  animation: emberPulse 2.4s ease-in-out infinite;
}
@keyframes emberPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.creed {
  margin-top: 16px;
  font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-faint);
}
.creed-lt { color: #d9be7e; }
.creed-dk { color: #d33b50; }
.creed-mid { opacity: 0.5; margin: 0 0.2em; }

/* ── Views ──────────────────────────────────────────────────────────── */
.view { width: 100%; animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.view[hidden] { display: none; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 30px);
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* ── Compose ────────────────────────────────────────────────────────── */
textarea {
  width: 100%; min-height: 168px; resize: vertical;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(140,120,160,0.16);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem; line-height: 1.6;
  padding: 16px 18px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
textarea::placeholder { color: var(--ink-faint); font-style: italic; }
textarea:focus {
  outline: none;
  border-color: rgba(255,43,70,0.5);
  box-shadow: 0 0 0 1px rgba(255,43,70,0.25), inset 0 0 24px rgba(255,43,70,0.05);
}

.meter { display: flex; align-items: center; gap: 14px; margin: 14px 2px 4px; }
.meter__bar {
  flex: 1; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.meter__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--moon), var(--blood));
  transition: width 0.18s ease, background 0.3s;
}
.counter {
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--ink-dim); letter-spacing: 0.04em; min-width: 78px; text-align: right;
}
.counter.warn { color: var(--ember); }

.terms {
  list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px;
  margin: 20px 2px; font-size: 0.86rem; color: var(--ink-dim);
}
.terms li { display: flex; align-items: center; gap: 9px; }
.terms b { color: var(--ink); font-weight: 600; }
.terms .rune { color: var(--blood); width: 1.1em; text-align: center; filter: drop-shadow(0 0 6px rgba(255,43,70,0.4)); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 0.98rem; font-weight: 600;
  letter-spacing: 0.03em;
  padding: 14px 22px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; user-select: none;
  transition: transform 0.12s, box-shadow 0.25s, background 0.25s, border-color 0.25s, color 0.25s;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:focus-visible { outline: 2px solid var(--blood-bright); outline-offset: 3px; }

.btn--primary {
  width: 100%; margin-top: 6px;
  color: #fff;
  background: linear-gradient(180deg, #7a0a1d, #4a0612);
  border-color: rgba(255,80,100,0.35);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn--primary:hover {
  background: linear-gradient(180deg, #9c1226, #5e0817);
  box-shadow: 0 0 34px rgba(255,43,70,0.5), inset 0 1px 0 rgba(255,255,255,0.16);
}
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn--ghost {
  color: var(--ink); background: rgba(255,255,255,0.03);
  border-color: rgba(140,120,160,0.2);
}
.btn--ghost:hover { border-color: rgba(255,43,70,0.45); color: #fff; box-shadow: 0 0 18px rgba(255,43,70,0.15); }
.btn--small { padding: 10px 16px; font-size: 0.88rem; margin-top: 18px; text-decoration: none; }

.fineprint { margin-top: 16px; text-align: center; color: var(--ink-faint); font-size: 0.78rem; letter-spacing: 0.03em; }
.error {
  margin-top: 14px; color: #ff6b7e; font-size: 0.88rem; text-align: center;
  font-family: var(--mono);
}

/* ── Sealed / Reveal / Gone shared ──────────────────────────────────── */
.panel--sealed, .panel--reveal, .panel--gone, .panel--revealed { text-align: center; }
.sigil {
  font-size: 3rem; line-height: 1; color: var(--blood-bright);
  text-shadow: 0 0 24px rgba(255,43,70,0.6); margin-bottom: 12px;
}
.sigil--pulse { animation: pulse 2.4s ease-in-out infinite; color: var(--moon); text-shadow: 0 0 24px rgba(154,166,207,0.6); }
.sigil--dim { color: var(--ink-faint); text-shadow: none; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}
.panel__title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 4vw, 1.9rem); color: #ece8f2; }
.panel__sub { margin-top: 10px; color: var(--ink-dim); font-size: 0.96rem; }

.linkbox { display: flex; gap: 10px; margin: 24px 0 14px; }
.link {
  flex: 1; min-width: 0;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(140,120,160,0.2);
  border-radius: 10px; color: var(--ember);
  font-family: var(--mono); font-size: 0.86rem; padding: 13px 14px;
}
.link:focus { outline: none; border-color: rgba(255,43,70,0.5); }
.btn--ghost.copied { color: #8effa1; border-color: rgba(120,255,150,0.4); }

.expiry { color: var(--ink-dim); font-size: 0.84rem; font-family: var(--mono); }
.warnscroll {
  margin-top: 20px; padding: 14px 16px;
  border: 1px dashed rgba(201,162,74,0.3); border-radius: 10px;
  color: var(--gold); background: rgba(201,162,74,0.04);
  font-size: 0.84rem; line-height: 1.55;
}

/* ── Revealed secret ────────────────────────────────────────────────── */
.revealed-title { color: var(--blood-bright); }
.secret {
  margin: 20px 0 10px; text-align: left;
  white-space: pre-wrap; word-break: break-word;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(140,120,160,0.18);
  border-left: 3px solid var(--blood);
  border-radius: 10px; padding: 18px 20px;
  font-family: var(--mono); font-size: 1rem; line-height: 1.7; color: #e7e3ee;
  max-height: 50vh; overflow: auto;
}
.ash { color: var(--ink-faint); font-size: 0.82rem; font-style: italic; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer {
  margin-top: auto; padding-top: 40px;
  color: var(--ink-faint); font-size: 0.76rem; letter-spacing: 0.08em;
  display: flex; gap: 10px; align-items: center; text-transform: lowercase;
}
.footer .dot { opacity: 0.5; }

@media (max-width: 480px) {
  .terms { grid-template-columns: 1fr; }
  .linkbox { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
