/* =========================================================
   Life OS — base.css
   Colors for light and dark mode, fonts, buttons, motion.
   ========================================================= */
:root {
  --accent: #2f80ed;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --base-size: 16px;
  --sidebar-width: 248px;
  --sidebar-compact-width: 56px;

  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --panel: #ffffff;
  --text: #37352f;
  --text-muted: #787774;
  --text-faint: #a5a29c;
  --border: rgba(55, 53, 47, 0.12);
  --hover: rgba(55, 53, 47, 0.06);
  --active: rgba(55, 53, 47, 0.1);
  --switch-off: rgba(55, 53, 47, 0.2);
  --danger: #e5484d;
  --shadow: 0 10px 30px rgba(15, 15, 15, 0.12), 0 2px 6px rgba(15, 15, 15, 0.06);
  --backdrop: rgba(15, 15, 15, 0.25);

  --radius: 6px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 0.18s;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #191919;
  --bg-soft: #202020;
  --panel: #252525;
  --text: #e6e6e4;
  --text-muted: #9b9a97;
  --text-faint: #6f6e6b;
  --border: rgba(255, 255, 255, 0.09);
  --hover: rgba(255, 255, 255, 0.055);
  --active: rgba(255, 255, 255, 0.09);
  --switch-off: rgba(255, 255, 255, 0.18);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --backdrop: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: var(--base-size); }
html, body { margin: 0; height: 100%; }

body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif,
    "Segoe UI Emoji", "Apple Color Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Icons and icon buttons ---------- */
.icon { display: inline-flex; }
.icon svg { width: 18px; height: 18px; display: block; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: 0 0 auto;
  border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background-color var(--dur), color var(--dur);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  font-size: 0.85rem; padding: 5px 11px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur), border-color var(--dur);
}
.btn:hover { background: var(--hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger.solid:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.btn-link {
  border: 0; background: none; padding: 0; cursor: pointer; font-size: inherit;
  color: var(--accent); text-decoration: underline; text-underline-offset: 2px;
}

/* ---------- Motion ---------- */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.page-enter { animation: pageIn 0.28s var(--ease) both; }

/* No animations while the page first loads */
html.booting *, html.booting *::before, html.booting *::after { transition: none !important; }

/* Reduce motion setting */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  transition-duration: 0s !important;
  animation-duration: 0s !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
}
