/* base.css - Variables, Resets, Color Systems */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,500&display=swap');

:root {
  /* Font Stacks */
  --font-serif: 'Newsreader', 'Be Vietnam Pro', Georgia, Cambria, 'Times New Roman', serif;
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Be Vietnam Pro', var(--font-sans);
  --font-mono: 'IBM Plex Mono', 'Be Vietnam Pro', 'SF Mono', Consolas, Menlo, monospace;

  /* Theme: Warm Paper (Default) */
  --bg-app: #fbf9f5;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f0e8;
  --bg-hover: #ece6dc;
  --bg-card: #f8f5ee;
  
  --text-main: #1c1917;
  --text-muted: #655e56;
  --text-faint: #9c9489;
  
  --border-subtle: #e7e2d8;
  --border-medium: #d4ccbf;
  --border-strong: #b8ac9a;

  /* Brand Accents */
  --primary: #1a56db;
  --primary-subtle: #eef4ff;
  --primary-hover: #1342ad;

  --amber: #b45309;
  --amber-subtle: #fef3c7;
  --emerald: #15803d;
  --emerald-subtle: #dcfce7;
  --rose: #be123c;
  --rose-subtle: #ffe4e6;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(44, 39, 32, 0.05);
  --shadow-md: 0 4px 12px rgba(44, 39, 32, 0.08), 0 1px 3px rgba(44, 39, 32, 0.04);
  --shadow-lg: 0 16px 36px rgba(44, 39, 32, 0.12), 0 2px 6px rgba(44, 39, 32, 0.06);

  /* Dimensions */
  --sidebar-width: 320px;
  --reader-max-width: 720px;
  --topbar-height: 56px;

  /* Transitions */
  --trans-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --trans-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="sepia"] {
  --bg-app: #f3ebd9;
  --bg-surface: #fbf5e8;
  --bg-subtle: #e9deca;
  --bg-hover: #decbb4;
  --bg-card: #eee4ce;
  
  --text-main: #2b221a;
  --text-muted: #6b5c4f;
  --text-faint: #998675;
  
  --border-subtle: #dfd2be;
  --border-medium: #cbbba5;
  --border-strong: #b09e86;

  --primary: #124cb8;
  --primary-subtle: #e6eeff;
}

[data-theme="dark"] {
  --bg-app: #121417;
  --bg-surface: #181b20;
  --bg-subtle: #21262d;
  --bg-hover: #2d333b;
  --bg-card: #1c2026;
  
  --text-main: #e6edf3;
  --text-muted: #8b949e;
  --text-faint: #656d76;
  
  --border-subtle: #30363d;
  --border-medium: #444c56;
  --border-strong: #636e7b;

  --primary: #388bfd;
  --primary-subtle: #162438;
  --primary-hover: #58a6ff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.7);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--trans-normal), color var(--trans-normal);
}
