/* ── shared.css — ReplyBuddy Design System ── */

/* ══════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════ */
:root {
  /* Core Brand Palette */
  --chalk: #F8F6F1;
  --chalk2: #F0EBE3;
  --navy: #1E1812;
  --navy2: #18130E;
  --white: #FFFFFF;

  /* Short aliases (used by dashboard) */
  --cr: #DC2626;
  --cr2: #E84444;
  --cr3: rgba(220,38,38,0.08);
  --bl: #2563EB;
  --em: #059669;
  --am: #D97706;

  /* Long aliases (for marketing pages) */
  --crimson: #DC2626;
  --crimson-soft: #E84444;
  --blue: #2563EB;
  --emerald: #059669;
  --amber: #D97706;

  /* Inks for Borders & Muted Text */
  --ink: rgba(26,26,46,0.06);
  --ink2: rgba(26,26,46,0.15);
  --ink3: rgba(26,26,46,0.68);
  --ink4: rgba(26,26,46,0.75);
  --border: rgba(26,26,46,0.1);

  /* Typography */
  --ff: 'Fraunces', Georgia, serif;
  --fb: 'DM Sans', system-ui, sans-serif;

  /* Type Scale */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;
  --text-4xl: clamp(32px, 6vw, 42px);
  --text-5xl: clamp(40px, 8vw, 56px);

  /* Border Radius */
  --rs: 8px;
  --r: 14px;
  --rl: 18px;
  --rxl: 22px;
  --rpill: 100px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);
  --sh: 0 2px 12px rgba(26,26,46,0.06);
  --sh2: 0 12px 40px rgba(26,26,46,0.1);

  /* Transitions */
  --transition-fast: 0.15s;
  --transition-base: 0.2s;
  --transition-slow: 0.3s;
}

/* ══════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--fb);
  background: var(--chalk);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-base) ease;
}

img, svg {
  max-width: 100%;
  display: block;
}

/* ══════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════ */

/* Focus indicators */
:focus-visible {
  outline: 2px solid var(--cr);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -50px;
  left: 16px;
  background: var(--cr);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--rs);
  font-size: var(--text-base);
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 16px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════
   TYPOGRAPHY CLASSES
   ══════════════════════════════════════ */
.h-editorial {
  font-family: var(--ff);
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--navy);
  line-height: 1.1;
}

.t-eyebrow {
  font-family: var(--fb);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink4);
  display: inline-block;
}

/* ══════════════════════════════════════
   LAYOUT UTILITIES
   ══════════════════════════════════════ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.text-center { text-align: center; }

/* ══════════════════════════════════════
   SHARED NAVIGATION (marketing pages)
   ══════════════════════════════════════ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px;
  background: rgba(248,246,241,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-nav-brand {
  font-family: var(--ff);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: var(--navy);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav-brand .acc {
  color: var(--cr);
}

.site-nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.site-nav-links a {
  font-size: var(--text-sm);
  color: var(--ink3);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--navy);
}

.site-nav-cta {
  font-family: var(--ff);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--white) !important;
  background: var(--cr);
  border-radius: var(--rpill);
  padding: 8px 20px;
  text-decoration: none;
  transition: all var(--transition-base);
}

.site-nav-cta:hover {
  background: var(--cr2);
  box-shadow: 0 4px 16px rgba(220,38,38,0.25);
  color: var(--white) !important;
}

/* Mobile hamburger button */
.site-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--navy);
}

.site-nav-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* Mobile menu drawer */
.site-nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
}

.site-nav-drawer.open {
  display: block;
}

.site-nav-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30,24,18,0.4);
  backdrop-filter: blur(2px);
}

.site-nav-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--white);
  padding: 24px;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.site-nav-drawer-close {
  align-self: flex-end;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink3);
  border-radius: var(--rs);
  margin-bottom: 16px;
}

.site-nav-drawer-close:hover {
  background: var(--ink);
  color: var(--navy);
}

.site-nav-drawer-panel a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--rs);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.site-nav-drawer-panel a:hover {
  background: var(--ink);
}

.site-nav-drawer-panel .site-nav-cta {
  display: block;
  text-align: center;
  margin-top: 12px;
}

/* ══════════════════════════════════════
   SHARED FOOTER (marketing pages)
   ══════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--ink2);
  padding: 32px 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer-copy {
  font-size: 12px;
  color: var(--ink3);
}

.site-footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer-links a {
  font-size: 12px;
  color: var(--ink3);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-footer-links a:hover {
  color: var(--navy);
}

/* ══════════════════════════════════════
   SHARED CTA BUTTON
   ══════════════════════════════════════ */
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--white);
  background: var(--cr);
  border: none;
  border-radius: var(--rl);
  padding: 16px 40px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: 0 6px 24px rgba(220,38,38,0.3);
}

.cta-primary:hover {
  background: var(--cr2);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(220,38,38,0.4);
  color: var(--white);
}

/* ══════════════════════════════════════
   SHARED CARD HOVER
   ══════════════════════════════════════ */
.card-hover {
  transition: all var(--transition-slow);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh2);
}

/* ══════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(26,26,46,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(26,26,46,0.22); }

/* ══════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════ */
@media print {
  .site-nav, .site-nav-drawer, .site-footer,
  .skip-link, .toast-stack { display: none !important; }
  body { background: white; color: black; }
  a { color: inherit; }
}

/* ══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════ */
@media (max-width: 900px) {
  .container { padding: 0 24px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 40px; }
  .site-nav { padding: 0 24px; }
  .site-footer { padding: 24px; }
}

@media (max-width: 768px) {
  .site-nav-links { display: none; }
  .site-nav-toggle { display: block; }
}

@media (max-width: 480px) {
  .site-nav { padding: 0 16px; }
  .site-footer { padding: 20px 16px; flex-direction: column; text-align: center; }
  .site-footer-links { justify-content: center; }
}
