/* ═══════════════════════════════════════════════════════════════════
   Phase Y — Editorial Codex
   Brutalist editorial layer over Claude warm aesthetic.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Atmospheric Background ───────────────────────────────────────── */
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(ellipse 90vw 60vh at 12% 8%, rgba(217, 119, 87, 0.06), transparent 55%),
    radial-gradient(ellipse 80vw 70vh at 88% 95%, rgba(217, 119, 87, 0.045), transparent 58%),
    radial-gradient(ellipse 50vw 50vh at 50% 45%, rgba(217, 119, 87, 0.018), transparent 70%);
  mix-blend-mode: multiply;
  animation: editorial-breathe 28s ease-in-out infinite alternate;
}
[data-theme="dark"] body::after {
  background:
    radial-gradient(ellipse 90vw 60vh at 12% 8%, rgba(217, 119, 87, 0.10), transparent 55%),
    radial-gradient(ellipse 80vw 70vh at 88% 95%, rgba(217, 119, 87, 0.07), transparent 58%);
  mix-blend-mode: screen;
}
@keyframes editorial-breathe {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.85; }
  50%  { transform: translate(-1.5vw, 1vh) scale(1.04); opacity: 1; }
  100% { transform: translate(1vw, -1vh) scale(1.02); opacity: 0.92; }
}

/* ── Hero / Welcome Block (Übersicht-Tab opener) ─────────────────── */
.editorial-hero {
  position: relative;
  padding: 2.5rem 0 2.2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}
.editorial-hero::before {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 14%, transparent 14%);
}
.editorial-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
  display: flex; align-items: center; gap: 0.7rem;
}
.editorial-hero-eyebrow::before {
  content: ''; display: inline-block; width: 26px; height: 1px;
  background: var(--accent);
}
.editorial-hero-title {
  font-family: var(--font-display);
  font-weight: 360;
  font-size: clamp(2.4rem, 6.2vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.editorial-hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 360;
  font-variation-settings: "opsz" 144;
}
.editorial-hero-meta {
  margin-top: 1rem;
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.editorial-hero-meta strong { color: var(--ink); font-weight: 500; }
/* BB.10.17 — Cleaner: weniger Schräge, mehr Ruhe, deutlicher als
   "Spruch von oben" lesbar. Subtilere Akzentlinie, mehr Atem zwischen
   Stern und Text — wirkt mehr wie Marginalie, weniger wie Sticker. */
.editorial-hero-marginalia {
  position: absolute;
  top: 3rem;
  right: 0.2rem;
  max-width: 250px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-dim);
  text-align: right;
  transform: rotate(-0.4deg);
  transform-origin: top right;
  border-right: 1px solid var(--accent);
  padding: 0.35rem 1rem 0.35rem 0;
  letter-spacing: 0.005em;
  transition: opacity 0.4s ease, color 0.3s ease;
}
.editorial-hero-marginalia::before {
  content: '∗  ';
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
  opacity: 0.75;
}
.editorial-hero-marginalia:hover { color: var(--ink); cursor: help; }

/* ── Section Numbering (codex-style chapters) ─────────────────────── */
.section-title { position: relative; }
.section-title.editorial-numbered {
  display: flex; align-items: baseline; gap: 0.85rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.65rem;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 36;
  margin-top: 0.4rem;
}
.editorial-numeral {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--accent);
  min-width: 2.4ch;
  letter-spacing: 0.06em;
  font-variation-settings: "opsz" 144;
  border-right: 1px solid var(--border-heavy);
  padding-right: 0.7rem;
  text-align: right;
  flex-shrink: 0;
}
.editorial-section-note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--ink-dim);
  margin-left: auto;
  padding-left: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* ── Sketch Divider (between sections) ───────────────────────────── */
.editorial-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0 1.6rem;
  gap: 0.8rem;
  color: var(--accent);
  opacity: 0.55;
}
.editorial-divider::before,
.editorial-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-heavy) 30%, var(--border-heavy) 70%, transparent);
}
.editorial-divider svg { flex-shrink: 0; }

/* ── Drop-Cap (for prose paragraphs in hero/docs) ────────────────── */
.editorial-prose p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 4em;
  line-height: 0.85;
  font-weight: 600;
  float: left;
  margin: 0.05em 0.12em -0.05em 0;
  color: var(--accent);
  font-variation-settings: "opsz" 144;
}

/* ── Tab-View Stagger Reveal ─────────────────────────────────────── */
.tab-view.active > * {
  opacity: 0;
  transform: translateY(8px);
  animation: editorial-reveal 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.tab-view.active > *:nth-child(1) { animation-delay: 30ms; }
.tab-view.active > *:nth-child(2) { animation-delay: 100ms; }
.tab-view.active > *:nth-child(3) { animation-delay: 170ms; }
.tab-view.active > *:nth-child(4) { animation-delay: 240ms; }
.tab-view.active > *:nth-child(5) { animation-delay: 310ms; }
.tab-view.active > *:nth-child(6) { animation-delay: 380ms; }
.tab-view.active > *:nth-child(7) { animation-delay: 440ms; }
.tab-view.active > *:nth-child(n+8) { animation-delay: 500ms; }
@keyframes editorial-reveal {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tab-view.active > * { animation: none !important; opacity: 1; transform: none; }
  body::after { animation: none !important; }
}

/* ── Page-load: prevent flash on chats tab (split layout) ────────── */
#tab-chats > * { opacity: 1; transform: none; animation: none; }

/* ── Refined typography for headings already in app ──────────────── */
.section-title:not(.editorial-numbered) {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-weight: 460;
  letter-spacing: -0.005em;
}

/* ── Stat-Card: editorialer Look ─────────────────────────────────── */
.stat-card {
  position: relative;
  border-color: var(--border);
  transition: border-color 250ms, transform 250ms;
}
.stat-card:hover {
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}
.stat-card-value {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-weight: 380;
  letter-spacing: -0.02em;
}
.stat-card-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ── Tab-Nav: refined active underline ───────────────────────────── */
.nav-tab.active::after {
  content: ''; position: absolute; left: 14%; right: 14%; bottom: 0;
  height: 2px; background: var(--accent); border-radius: 1px;
  animation: editorial-tab-underline 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-tab { position: relative; }
@keyframes editorial-tab-underline {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}

/* ── Cards (.card): paper-feel ───────────────────────────────────── */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 28px; height: 1.5px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 240ms;
}
.card:hover::before { opacity: 1; }

/* ── Quote-Block-Style for empty-states ──────────────────────────── */
.empty-state {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-dim);
  line-height: 1.55;
  padding: 1.5rem 1.5rem 1.7rem;
  text-align: center;
  position: relative;
}
.empty-state::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 0.55rem;
  background-image: url('img/akhilius/header-sparkle-128.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.42;
  filter: grayscale(0.2);
}
.empty-state.no-mark::before { display: none; }

/* ── Mobile (Phase Y respects Phase X breakpoints) ────────────────── */
@media (max-width: 720px) {
  .editorial-hero { padding: 1.5rem 0 1.4rem; margin-bottom: 1.4rem; }
  .editorial-hero-marginalia { display: none; }
  .editorial-hero-meta { font-size: 0.65rem; gap: 0.9rem; }
  .editorial-numeral { font-size: 0.85rem; min-width: 1.8ch; padding-right: 0.45rem; }
  .editorial-section-note { display: none; }
  .section-title.editorial-numbered { font-size: 1.25rem; gap: 0.55rem; }
}
@media (max-width: 520px) {
  .editorial-hero-eyebrow { font-size: 0.6rem; letter-spacing: 0.18em; }
  .editorial-divider svg { width: 18px; height: 18px; }
}

/* BB.10.43 — Session-Lineage (OpenClaw v2026.5.10-beta.5 adaption) */
.chat-group {
  padding: 0.5rem 0.7rem 0.3rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.chat-group:hover { background: var(--bg-hover); }
.chat-group.active { background: var(--bg-card-active, var(--bg-hover)); border-left-color: var(--accent); }
.persona-current {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--accent);
  opacity: 0.85;
}
.chat-persona-item {
  padding: 0.18rem 0.7rem 0.18rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: default;
}
.chat-persona-item.is-current { color: var(--ink); }
.chat-persona-item .lineage-prefix {
  color: var(--ink-faint, #5a6072);
  font-family: var(--font-mono);
  user-select: none;
}
.chat-persona-item .persona-name {
  font-weight: 500;
}
.chat-persona-item .persona-badge {
  font-size: 0.62rem;
  background: var(--accent-soft, rgba(43,138,163,0.18));
  color: var(--accent);
  padding: 0.02rem 0.35rem;
  border-radius: 3px;
  text-transform: lowercase;
}
.chat-persona-item .persona-stats {
  margin-left: auto;
  opacity: 0.6;
  font-size: 0.7rem;
}

[data-theme="dark"] .chat-persona-item .lineage-prefix { color: #4a5066; }
[data-theme="dark"] .chat-persona-item.is-current { color: #d4cfc4; }
