/* ═══════ PAPER & INK DESIGN TOKENS ═══════ */
/* Source of truth: homepage /products/ /tools/ as of 2026-08-26 */

:root {
  /* Core palette */
  --paper: #FFFEFB;
  --ivory: #F7F4ED;
  --ink: #17151F;
  --ink-muted: #858481;
  --ink-subtle: #B8B5B0;
  --violet: #7657F6;
  --violet-dark: #5B42D4;
  --violet-light: rgba(118, 87, 246, 0.1);
  --violet-glow: rgba(118, 87, 246, 0.15);
  --green: #10B981;
  --green-light: rgba(16, 185, 129, 0.1);
  --red: #EF4444;
  --red-light: rgba(239, 68, 68, 0.1);

  /* Semantic aliases */
  --bg: var(--paper);
  --bg-alt: var(--ivory);
  --text: var(--ink);
  --text-muted: var(--ink-muted);
  --text-subtle: var(--ink-subtle);
  --accent: var(--violet);
  --accent-hover: var(--violet-dark);
  --accent-bg: var(--violet-light);
  --border: rgba(118, 87, 246, 0.12);
  --border-subtle: rgba(118, 87, 246, 0.06);

  /* Typography */
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(118, 87, 246, 0.04);
  --shadow-md: 0 4px 16px rgba(118, 87, 246, 0.08);
  --shadow-lg: 0 8px 24px rgba(118, 87, 246, 0.12);
  --shadow-xl: 0 12px 32px rgba(118, 87, 246, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Nav height */
  --nav-height: 56px;
}

/* ═══════ RESET & BASE ═══════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: var(--nav-height);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.2;
  font-weight: 600;
}
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }

/* ═══════ TOP NAV (inline on home, or back-link on subpages) ═══════ */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: rgba(255, 254, 251, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-brand {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-dot { width: 8px; height: 8px; background: var(--violet); border-radius: 50%; }
.nav-brand span { color: var(--violet); }
.nav-links { display: flex; align-items: center; gap: var(--space-md); list-style: none; }
.nav-links a { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; text-decoration: none; transition: color var(--transition-fast); white-space: nowrap; }
.nav-links a:hover { color: var(--violet); }
.nav-btn {
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: #fff !important;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.nav-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Back link for subpages (replaces nav.js) */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: var(--space-lg) 0 var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.back-link:hover { color: var(--violet); }

/* ═══════ CONTAINER ═══════ */
.container { max-width: 900px; margin: 0 auto; padding: 0 var(--space-lg); }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 var(--space-lg); }

/* ═══════ BUTTONS ═══════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn-ghost {
  background: transparent;
  color: var(--violet);
  border: 2px solid var(--border);
}
.btn-ghost:hover {
  background: var(--accent-bg);
  border-color: var(--violet);
}
.btn-secondary {
  background: var(--ivory);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--accent-bg);
  border-color: var(--violet);
}
.btn-sm { padding: 10px 18px; font-size: 0.85rem; }
.btn-lg { padding: 18px 36px; font-size: 1.05rem; }

/* ═══════ BADGES ═══════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-violet { background: var(--accent-bg); color: var(--violet); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-amber { background: rgba(245, 158, 11, 0.1); color: #D97706; }

/* ═══════ CARDS ═══════ */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}
.card:hover { border-color: var(--violet); box-shadow: var(--shadow-md); }

/* ═══════ FORM ELEMENTS ═══════ */
.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: all var(--transition-fast);
}
.input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-light); }
.input::placeholder { color: var(--ink-subtle); }

/* ═══════ FOOTER ═══════ */
.footer {
  margin-top: var(--space-3xl);
  padding: var(--space-2xl) 0 var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg);
  text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: var(--space-lg); flex-wrap: wrap; margin-bottom: var(--space-md); }
.footer-links a { color: var(--text-muted); font-size: 0.8rem; text-decoration: none; transition: color var(--transition-fast); }
.footer-links a:hover { color: var(--violet); }
.footer-copy { color: var(--text-muted); font-size: 0.75rem; }

/* ═══════ UTILITIES ═══════ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ═══════ MOBILE RESPONSIVE ═══════ */
@media (max-width: 768px) {
  :root { --nav-height: 48px; }
  .top-nav { padding: 0 var(--space-md); height: 48px; }
  .nav-brand { font-size: 0.8rem; gap: 6px; }
  .nav-dot { width: 6px; height: 6px; }
  .nav-links { gap: var(--space-sm); }
  .nav-links a { font-size: 0.7rem; font-weight: 600; }
  .nav-btn { padding: 6px 12px; font-size: 0.7rem !important; }
  .container { padding: 0 var(--space-md); }
  .btn { padding: 12px 24px; font-size: 0.9rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}