/* 864z-verse-shell.css — Reusable 3-Surface Living-Verse Micro-SaaS & PWA Shell (<12 KB) */
:root {
  --vs-bg: #0A0806;
  --vs-surface: #16120D;
  --vs-ink: #F6F1E7;
  --vs-muted: #B9AD9B;
  --vs-gold: #E5C17B;
  --vs-bronze: #8C6239;
  --vs-line: rgba(229, 193, 123, 0.22);
  --vs-glow: rgba(168, 116, 58, 0.28);
  --vs-pill-bg: rgba(255, 255, 255, 0.06);
}

html[data-theme="day"] {
  --vs-bg: #F6F1E7;
  --vs-surface: #FFFDF9;
  --vs-ink: #1F1D1A;
  --vs-muted: #5C564E;
  --vs-gold: #6E4B28;
  --vs-bronze: #8C6239;
  --vs-line: rgba(140, 98, 57, 0.24);
  --vs-glow: rgba(196, 154, 92, 0.14);
  --vs-pill-bg: rgba(31, 29, 26, 0.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--vs-bg);
  color: var(--vs-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.vs-shell {
  position: relative;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 12px) 16px env(safe-area-inset-bottom, 18px);
}

.vs-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 44%, var(--vs-glow) 0%, transparent 66%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.4s ease;
}

.vs-motes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Header & Lens Bar */
.vs-top {
  position: relative;
  z-index: 5;
  padding-top: 8px;
}

.vs-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.vs-brand-title {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vs-ink);
  text-decoration: none;
  font-weight: 700;
}

.vs-brand-title span { color: var(--vs-gold); font-weight: 500; }

.vs-util-btns { display: flex; gap: 6px; align-items: center; }

.vs-chip-btn {
  background: var(--vs-pill-bg);
  color: var(--vs-ink);
  border: 1px solid var(--vs-line);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.vs-lens-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.vs-lens-btn {
  background: var(--vs-pill-bg);
  color: var(--vs-ink);
  border: 1px solid var(--vs-line);
  border-radius: 999px;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.vs-lens-btn[aria-pressed="true"] {
  background: rgba(229, 193, 123, 0.20);
  border-color: var(--vs-gold);
  color: var(--vs-gold);
}

html[data-theme="day"] .vs-lens-btn[aria-pressed="true"] {
  background: var(--vs-bronze);
  border-color: var(--vs-bronze);
  color: #FFFDF9;
}

.vs-emo-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.vs-emo-row::-webkit-scrollbar { display: none; }

.vs-emo-chip {
  background: transparent;
  color: var(--vs-muted);
  border: 1px dashed var(--vs-line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.vs-emo-chip[aria-pressed="true"] {
  color: var(--vs-ink);
  border-style: solid;
  border-color: var(--vs-gold);
  font-weight: 700;
}

/* Surface 1: Living Verse Canvas */
.vs-stage {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 20px 14px;
  user-select: text;
}

.vs-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vs-gold);
  font-weight: 700;
  margin-bottom: 10px;
}

.vs-divider {
  width: 96px;
  height: 1px;
  background: var(--vs-line);
  margin: 0 auto 26px;
}

.vs-fade-line {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(24px, 5.6vw, 31px);
  line-height: 1.36;
  margin: 0 0 14px;
  opacity: 0;
  transform: translateY(12px);
  animation: vsFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.vs-fade-line.l2 { animation-delay: 0.24s; }
.vs-fade-line.l3 {
  animation-delay: 0.48s;
  color: var(--vs-gold);
  font-style: italic;
}

.vs-whisper {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: var(--vs-muted);
  max-width: 440px;
  margin: 18px auto 14px;
  line-height: 1.5;
  opacity: 0;
  animation: vsFadeUp 0.65s ease 0.7s forwards;
}

.vs-citation {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vs-muted);
  opacity: 0.8;
}

.vs-nav-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.vs-step-btn {
  background: var(--vs-pill-bg);
  color: var(--vs-ink);
  border: 1px solid var(--vs-line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.vs-counter {
  font-size: 12px;
  color: var(--vs-muted);
  font-variant-numeric: tabular-nums;
}

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

/* Bottom Single-Thumb Action Bar */
.vs-bottom {
  position: relative;
  z-index: 5;
  padding-top: 8px;
}

.vs-actions {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  gap: 8px;
}

.vs-act-btn {
  background: var(--vs-pill-bg);
  color: var(--vs-ink);
  border: 1px solid var(--vs-line);
  border-radius: 14px;
  padding: 13px 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.vs-act-btn.primary {
  background: rgba(229, 193, 123, 0.18);
  border-color: var(--vs-gold);
  color: var(--vs-gold);
}

html[data-theme="day"] .vs-act-btn.primary {
  background: var(--vs-bronze);
  border-color: var(--vs-bronze);
  color: #FFFDF9;
}

.vs-foot-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
}

.vs-foot-links a, .vs-foot-links button {
  color: var(--vs-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
}

/* Slide-Up Drawers (Surface 2 & Surface 3) */
.vs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.vs-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.vs-drawer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 104%);
  width: 100%;
  max-width: 580px;
  max-height: 86dvh;
  background: var(--vs-surface);
  color: var(--vs-ink);
  border-top: 2px solid var(--vs-gold);
  border-radius: 22px 22px 0 0;
  padding: 20px 22px 32px;
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -16px 44px rgba(0, 0, 0, 0.45);
}

.vs-drawer.open { transform: translate(-50%, 0); }

.vs-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--vs-line);
}

.vs-highlight-quote {
  border-left: 3px solid var(--vs-gold);
  background: rgba(229, 193, 123, 0.10);
  padding: 14px 16px;
  border-radius: 0 10px 10px 0;
  font-family: Georgia, serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 14px 0;
  white-space: pre-wrap;
}

.vs-journal-area {
  width: 100%;
  min-height: 120px;
  border-radius: 12px;
  border: 1px solid var(--vs-line);
  background: var(--vs-bg);
  color: var(--vs-ink);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  margin: 10px 0;
}

.vs-pwa-card {
  margin-top: 16px;
  border: 1px solid var(--vs-gold);
  background: rgba(229, 193, 123, 0.09);
  border-radius: 14px;
  padding: 14px 16px;
}

.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;
}
