/* ═══════════════════════════════════════════════════════════════════════
 * Lucidity Mirror — Reflection UX
 * Companion to Compass (looking back instead of forward).
 * Design language matches compass-v2.css; primary tone is evening lavender.
 * ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg-deep:         #050814;
  --bg-surface:      rgba(15, 22, 41, 0.76);
  --bg-surface-solid:rgba(5, 8, 20, 0.92);
  --bg-raised:       rgba(26, 31, 53, 0.72);
  --bg-card:         rgba(15, 22, 41, 0.84);
  --glass-border:    rgba(217, 168, 255, 0.16);

  --text-primary:    #ffffff;
  --text-secondary:  #d9d7e6;
  --text-muted:      #89849d;

  --accent-morning:      #8be7ff;
  --accent-morning-dim:  rgba(139, 231, 255, 0.12);
  --accent-morning-glow: rgba(139, 231, 255, 0.38);

  --accent-evening:      #d9a8ff;
  --accent-evening-dim:  rgba(217, 168, 255, 0.13);
  --accent-evening-glow: rgba(217, 168, 255, 0.42);

  --accent-coach:        #ec4899;
  --accent-coach-dim:    rgba(236, 72, 153, 0.13);
  --accent-coach-glow:   rgba(236, 72, 153, 0.38);

  --accent-blueprint:    #7c3aed;
  --accent-blueprint-dim:rgba(124, 58, 237, 0.16);
  --accent-blueprint-glow:rgba(124, 58, 237, 0.38);

  --accent-weekly:       #38BDF8;
  --accent-weekly-dim:   rgba(56, 189, 248, 0.13);
  --accent-weekly-glow:  rgba(56, 189, 248, 0.40);

  --accent-monthly:      #A78BFA;
  --accent-monthly-dim:  rgba(167, 139, 250, 0.13);
  --accent-monthly-glow: rgba(167, 139, 250, 0.40);

  --accent-quarterly:    #FB923C;
  --accent-quarterly-dim:rgba(251, 146, 60, 0.13);
  --accent-quarterly-glow:rgba(251, 146, 60, 0.40);

  --accent-annual:       #FBBF24;
  --accent-annual-dim:   rgba(251, 191, 36, 0.13);
  --accent-annual-glow:  rgba(251, 191, 36, 0.40);

  --success:         #22c55e;
  --success-dim:     rgba(34, 197, 94, 0.12);

  --warn:            #f59e0b;
  --warn-dim:        rgba(245, 158, 11, 0.12);

  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 18px;

  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-header-height: 64px;
  --app-header-total-height: calc(var(--app-header-height) + var(--app-safe-top));
}

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

body {
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  /* Subtle "mirror" gradient — softer, more inward than Compass (evening tones) */
  background-image:
    radial-gradient(circle at 80% 10%, rgba(217, 168, 255, 0.20), transparent 30rem),
    radial-gradient(circle at 15% 85%, rgba(124, 58, 237, 0.18), transparent 30rem),
    linear-gradient(180deg, #131428 0%, var(--bg-deep) 100%);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.app-header {
  height: var(--app-header-total-height);
  background: var(--bg-surface-solid);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--app-safe-top) 32px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-evening);
  filter: drop-shadow(0 0 14px rgba(217, 168, 255, 0.38));
}

.logo-mark::before {
  content: '';
  width: 100%;
  height: 100%;
  background: currentColor;
  -webkit-mask: url('/brand-mark.svg') center / contain no-repeat;
  mask: url('/brand-mark.svg') center / contain no-repeat;
}

.logo h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.logo h1 span {
  color: var(--text-secondary);
  font-weight: 400;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-pill {
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  padding: 5px 12px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

/* ── Main mirror layout ─────────────────────────────────────────────────── */

.mirror {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px calc(100px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.map-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Section labels ─────────────────────────────────────────────────────── */

.section-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 18px color-mix(in srgb, currentColor 34%, transparent);
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.section-label.compass-card-link {
  cursor: pointer;
}

.section-label.compass-card-link:hover {
  color: var(--text-primary);
}

.section-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
}

.section-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Section-specific label coloring */
.map-reflection .section-label  { color: var(--accent-evening); }
.map-movements .section-label   { color: var(--accent-weekly); }
.map-alignment .section-label   { color: var(--accent-coach); }
.map-snapshots .section-label   { color: var(--accent-quarterly); }

/* ── Cards (matches compass-v2.css) ─────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.card-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── CTA Links ──────────────────────────────────────────────────────────── */

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 38px;
}

.cta-link--full {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
}

.cta-link.blueprint-cta {
  background: var(--accent-evening-dim);
  border: 1px solid rgba(217, 168, 255, 0.3);
  color: var(--accent-evening);
}

.cta-link.blueprint-cta:hover {
  background: rgba(217, 168, 255, 0.22);
  box-shadow: 0 0 14px var(--accent-evening-glow);
}

.cta-link.quarterly-cta {
  background: var(--accent-quarterly-dim);
  border: 1px solid rgba(251, 146, 60, 0.3);
  color: var(--accent-quarterly);
}

.cta-link.quarterly-cta:hover {
  background: rgba(251, 146, 60, 0.22);
  box-shadow: 0 0 14px var(--accent-quarterly-glow);
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* 🪞 REFLECTION — Blueprint (I Am)                                        */
/* ═══════════════════════════════════════════════════════════════════════ */

.blueprint-card {
  border-color: rgba(217, 168, 255, 0.24);
  background: linear-gradient(135deg, rgba(217, 168, 255, 0.08), rgba(15, 22, 41, 0.92));
}

.blueprint-eyebrow {
  color: var(--accent-evening);
}

.blueprint-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.blueprint-title-label {
  font-weight: 800;
}

.blueprint-title-sep {
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.55;
}

.blueprint-identity {
  display: block;
  margin-bottom: 16px;
}

.blueprint-statements {
  border: 1px solid rgba(217, 168, 255, 0.16);
  border-radius: var(--r-md);
  background: rgba(5, 8, 20, 0.32);
  color: var(--text-secondary);
}

.blueprint-statements summary {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.blueprint-statements summary::-webkit-details-marker {
  display: none;
}

.blueprint-statements summary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s ease;
}

.blueprint-statements[open] summary svg {
  transform: rotate(180deg);
}

.blueprint-statements ul {
  margin: 0;
  padding: 0 14px 14px 30px;
  font-size: 14px;
  line-height: 1.55;
}

.blueprint-statements li + li {
  margin-top: 8px;
}

.blueprint-vision-details .blueprint-vision-text {
  padding: 0 14px 14px;
}

.blueprint-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.blueprint-sub-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.blueprint-core-values {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-secondary);
}

.blueprint-vision-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.blueprint-empty-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
}

.blueprint-empty-text:last-of-type {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* 🌊 MOVEMENTS — Patterns since last reflection                           */
/* ═══════════════════════════════════════════════════════════════════════ */

.movements-card {
  border-color: rgba(56, 189, 248, 0.18);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.05), rgba(15, 22, 41, 0.92));
}

.chapter-context {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  padding: 8px 12px;
  background: var(--accent-weekly-dim);
  border-radius: var(--r-md);
  border: 1px solid rgba(56, 189, 248, 0.18);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chapter-context-label {
  color: var(--accent-weekly);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 10px;
}

.movements-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.movement-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(56, 189, 248, 0.04);
  border-left: 2px solid;
  border-radius: var(--r-md);
}

/* Kind-specific accent — pattern/growth/tension/wins */
.movement-item.kind-pattern  { border-left-color: var(--accent-weekly); }
.movement-item.kind-growth   { border-left-color: var(--success); background: rgba(34, 197, 94, 0.04); }
.movement-item.kind-tension  { border-left-color: var(--warn); background: rgba(245, 158, 11, 0.04); }
.movement-item.kind-win      { border-left-color: var(--accent-evening); background: rgba(217, 168, 255, 0.04); }
.movement-item.kind-shift    { border-left-color: var(--accent-monthly); background: rgba(167, 139, 250, 0.04); }

.movement-kind {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  margin-top: 2px;
}

.movement-item.kind-pattern .movement-kind { background: var(--accent-weekly-dim); color: var(--accent-weekly); }
.movement-item.kind-growth  .movement-kind { background: var(--success-dim); color: var(--success); }
.movement-item.kind-tension .movement-kind { background: var(--warn-dim); color: var(--warn); }
.movement-item.kind-win     .movement-kind { background: var(--accent-evening-dim); color: var(--accent-evening); }
.movement-item.kind-shift   .movement-kind { background: var(--accent-monthly-dim); color: var(--accent-monthly); }

.movement-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.movement-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

.movement-when {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

/* Empty state — muted hints until movements exist (see compass journey-focus-empty) */
.movements-empty-headline {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.5;
}

.movements-empty-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.movements-empty-text em {
  color: var(--accent-weekly);
  font-style: normal;
  font-weight: 600;
}

.movements-empty-text:last-of-type {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* 🎯 ALIGNMENT — Echoes & Drift                                           */
/* ═══════════════════════════════════════════════════════════════════════ */

.alignment-card {
  border-color: rgba(236, 72, 153, 0.18);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), rgba(15, 22, 41, 0.92));
}

.alignment-block {
  padding: 14px 0;
  border-top: 1px solid rgba(217, 168, 255, 0.08);
}

.alignment-block:first-child {
  border-top: none;
  padding-top: 0;
}

.alignment-block:last-child {
  padding-bottom: 0;
}

.alignment-sub-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#echoes-block .alignment-sub-label   { color: var(--success); }
#drift-block  .alignment-sub-label   { color: var(--warn); }

.alignment-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.echo-icon {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.drift-icon {
  background: var(--warn-dim);
  color: var(--warn);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.alignment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alignment-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--r-md);
  border-left: 2px solid;
}

#echoes-list .alignment-item { border-left-color: var(--success); }
#drift-list  .alignment-item { border-left-color: var(--warn); }

.alignment-quote {
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.alignment-quote::before {
  content: 'Blueprint: ';
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: var(--accent-evening);
  display: inline-block;
  margin-right: 6px;
}

.alignment-evidence {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

.alignment-empty-text {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}

.alignment-empty-text em {
  color: var(--accent-evening);
  font-style: normal;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* 📸 PAST CHAPTERS — Quarterly snapshots                                  */
/* ═══════════════════════════════════════════════════════════════════════ */

.snapshots-card {
  border-color: rgba(251, 146, 60, 0.18);
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.05), rgba(15, 22, 41, 0.92));
}

.snapshots-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.snapshot-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(251, 146, 60, 0.04);
  border-radius: var(--r-md);
  border: 1px solid rgba(251, 146, 60, 0.12);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  cursor: pointer;
}

.snapshot-item:hover {
  background: rgba(251, 146, 60, 0.08);
  border-color: rgba(251, 146, 60, 0.25);
  transform: translateX(2px);
}

.snapshot-marker {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-quarterly-dim);
  border: 1px solid rgba(251, 146, 60, 0.3);
  color: var(--accent-quarterly);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.snapshot-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.snapshot-period {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.snapshot-headline {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.snapshot-date {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  flex-shrink: 0;
}

.snapshots-empty-text {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* Skeletons                                                                */
/* ═══════════════════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* Animations                                                               */
/* ═══════════════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.map-section:nth-child(1) .card { animation-delay: 0.05s; }
.map-section:nth-child(2) .card { animation-delay: 0.10s; }
.map-section:nth-child(3) .card { animation-delay: 0.15s; }
.map-section:nth-child(4) .card { animation-delay: 0.20s; }

/* Refresh hint */
.refresh-hint {
  text-align: center;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 4px;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* Mobile responsive (mirrors compass-v2)                                  */
/* ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 860px) {
  .app-header { padding: var(--app-safe-top) 18px 0; }
  .logo { gap: 12px; }
  .logo h1 {
    font-size: 16px;
    letter-spacing: 0.18em;
  }
  .mirror {
    padding: 20px 16px calc(80px + env(safe-area-inset-bottom, 0px));
    gap: 24px;
  }
  .card { padding: 18px; }
  .movement-text { font-size: 13px; }
  .alignment-evidence { font-size: 13px; }
}

@media (max-width: 480px) {
  .app-header { padding: var(--app-safe-top) 14px 0; }
  .logo h1 { font-size: 14px; letter-spacing: 0.16em; }
  .date-pill { font-size: 10.5px; padding: 4px 8px; }
  .mirror {
    padding: 16px 14px calc(80px + env(safe-area-inset-bottom, 0px));
    gap: 22px;
  }
  .card { padding: 16px; }
  .blueprint-title {
    font-size: 13px;
  }
  .movement-item { padding: 10px 12px; gap: 10px; }
  .movement-text { font-size: 12.5px; }
  .snapshot-item { padding: 12px; gap: 12px; }
  .snapshot-marker { width: 40px; height: 40px; font-size: 10px; }
}

@media (max-width: 360px) {
  .logo h1 { font-size: 13px; letter-spacing: 0.14em; }
  .date-pill { font-size: 10px; padding: 3px 7px; }
  .mirror { padding: 14px 12px calc(80px + env(safe-area-inset-bottom, 0px)); }
}
