/* ── Lantern OS Shared Site Styles ──────────────────────────────── */
/*  Loads on every surface. Keeps nav, footer, theme, and base     */
/*  layout consistent across the entire app.                         */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Skip to content link (accessibility) ── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  top: 0;
}

:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface2: #f1f3f5;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #0ea5e9;
  --accent-dim: #cffafe;
  --accent-hover: #06b6d4;
  --green: #10b981;
  --gold: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #0a0e17;
  --surface: #111827;
  --surface2: #1a2332;
  --border: #1f2937;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #06b6d4;
  --accent-dim: #164e63;
  --accent-hover: #0891b2;
  --green: #34d399;
  --gold: #fbbf24;
  --danger: #ef4444;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.45);
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* ── Top nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  flex-shrink: 0;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
  margin-right: 8px;
}
.nav-brand img { width: 18px; height: 18px; vertical-align: middle; }
.nav-brand .brand-icon { font-size: 18px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.nav-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active { color: var(--accent); font-weight: 600; }
/* On narrow screens, keep the nav reachable: compact, horizontally scrollable
   row instead of hiding it entirely (there is no hamburger menu). */
@media (max-width: 580px) {
  .nav-links {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 6px 8px; font-size: 12.5px; }
}
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--muted); cursor: pointer; font-size: 15px;
  transition: all 0.15s;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-cta {
  font-size: 13px; font-weight: 600; padding: 7px 16px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; cursor: pointer; text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent-hover); }

/* ── Patreon support link in nav ── */
.nav-support {
  font-size: 13px; color: #ff6b6b; font-weight: 600;
  text-decoration: none; transition: color 0.15s;
  padding: 6px 10px;
}
.nav-support:hover { color: #ff8787; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  margin-top: auto;
  background: var(--surface);
  flex-shrink: 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-inner a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-inner a:hover { color: var(--text); text-decoration: underline; }
.footer-inner .sep { color: var(--border); }
.footer-inner .ml { margin-left: auto; }
.footer-meta { color: var(--muted); opacity: 0.75; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Screen-reader-only text */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) { .footer-inner .ml { margin-left: 0; width: 100%; } }

/* ── Page container ── */
.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px 80px;
}
/* Use more of a wide display instead of stranding content in a narrow ribbon.
   Card/panel grids inside reflow to more columns as the container grows. */
@media (min-width: 1100px) { .page { max-width: 1100px; } }
@media (min-width: 1700px) { .page { max-width: 1400px; } }
@media (min-width: 2400px) { .page { max-width: 1720px; } }

/* ── Common utilities ── */
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); display: inline-block;
}
.dot.online { background: var(--green); }
.dot.warn { background: var(--gold); }
.dot.offline { background: var(--danger); }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
}
.pill.live { background: rgba(16,185,129,0.12); color: var(--green); }
.pill.held { background: var(--surface2); color: var(--muted); }
.pill.active { background: rgba(245,158,11,0.12); color: var(--gold); }
.pill.completed { background: rgba(16,185,129,0.12); color: var(--green); }
.pill.queued { background: var(--accent-dim); color: var(--accent); }
.pill.ready { background: rgba(16,185,129,0.12); color: var(--green); }
.pill.optional { background: var(--accent-dim); color: var(--accent); }

.section { margin-bottom: 40px; }
.section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: var(--text); }

/* ── Index Page Styles ── */

/* Hero section */
.hero {
  text-align: center;
  padding: 64px 0 48px;
}
.hero-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  line-height: 1.15;
}
.hero h1 span { color: var(--accent); }
.hero .tagline {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 28px;
  line-height: 1.55;
}
.hero-cta-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 24px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  padding: 11px 24px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--surface2);
}
.hero .sub {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.6;
}

/* Panels and sections */
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  margin-top: 44px;
}
.no-margin-top { margin-top: 0; }

.panels-primary { margin-bottom: 12px; }

.panel-full {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.panel-full:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.panel-full-icon {
  font-size: 36px;
  flex-shrink: 0;
}
.panel-full-body {
  flex: 1;
}
.panel-full-body .tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.panel-full-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.panel-full-body p {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.5;
}
.panel-full-arrow {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
@media (max-width: 540px) {
  .panel-full {
    flex-direction: column;
    align-items: flex-start;
  }
  .panel-full-arrow {
    align-self: flex-end;
  }
}

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.panels-margin-bottom {
  margin-bottom: 40px;
}
@media (max-width: 560px) {
  .panels {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 22px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.panel:hover {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.panel-icon {
  font-size: 26px;
}
.panel-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}
.panel h2 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}
.panel p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}
.panel-arrow {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}
.panel.patreon {
  border-color: var(--accent-dim);
}
.panel.patreon:hover {
  border-color: var(--accent);
}

/* Feature strip */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 8px 0 44px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.15s;
}
.feature:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.feature .icon {
  font-size: 18px;
  margin-bottom: 7px;
}
.feature h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 3px;
}
.feature p {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Benchmark/status table */
.benchmark {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 44px;
  box-shadow: var(--shadow);
}
.benchmark-header {
  padding: 16px 22px 13px;
  border-bottom: 1px solid var(--border);
}
.benchmark-header h2 {
  font-size: 0.97rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.benchmark-header p {
  font-size: 0.8rem;
  color: var(--muted);
}
.benchmark table {
  width: 100%;
  border-collapse: collapse;
}
.benchmark th,
.benchmark td {
  padding: 11px 22px;
  text-align: left;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}
.benchmark th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.benchmark tr:last-child td {
  border-bottom: none;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.status-bar-right {
  margin-left: auto;
  opacity: 0.5;
}

/* Mandala animation */
.mandala-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-image: url('/mandala-network.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: -0.125em;
  font-size: inherit;
  color: inherit;
  filter: drop-shadow(0 0 2px currentColor);
}
.mandala-icon.healthy {
  color: var(--green);
}
.mandala-icon.warning {
  color: var(--gold);
}
.mandala-icon.critical {
  color: var(--accent);
}
.mandala-icon.spin-slow {
  animation: mandala-spin 5s linear infinite;
}
.mandala-icon.spin-normal {
  animation: mandala-spin 2.5s linear infinite;
}
.mandala-icon.spin-fast {
  animation: mandala-spin 1s linear infinite;
}
.mandala-icon.wobble {
  animation: mandala-wobble 2s ease-in-out infinite;
}

@keyframes mandala-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes mandala-wobble {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

[data-theme="dark"] .mandala-icon {
  filter: drop-shadow(0 0 4px currentColor) brightness(1.3);
}

/* Utility: hidden in production */
[data-prod-hidden][hidden] {
  display: none !important;
}

.hidden-by-default {
  display: none;
}

.recent-entries-list-padding {
  padding: 0 22px 18px;
}

.recent-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.recent-entry-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.recent-entry-kind {
  font-weight: 600;
  text-transform: capitalize;
}

.recent-entry-ts {
  font-size: 0.72rem;
  color: var(--muted);
}

.recent-lucidity {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: 8px;
}

.recent-entry-text {
  color: var(--text);
  line-height: 1.45;
}

.recent-entry-tags {
  margin-top: 4px;
}

.pill-recent {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.65rem;
  padding: 1px 7px;
  margin-right: 4px;
}

/* ── Accessibility: respect reduced motion preference ── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
