/* ============================================
   Prakruti — Base Styles
   Design system, variables, typography, reset
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  /* Brand colours */
  --sage:        #3B6D11;
  --sage-mid:    #639922;
  --sage-light:  #EAF3DE;
  --sage-pale:   #C0DD97;

  --amber:       #BA7517;
  --amber-mid:   #EF9F27;
  --amber-light: #FAEEDA;
  --amber-pale:  #FAC775;

  --teal:        #0F6E56;
  --teal-mid:    #1D9E75;
  --teal-light:  #E1F5EE;
  --teal-pale:   #5DCAA5;

  --coral:       #993C1D;
  --coral-light: #FAECE7;
  --coral-pale:  #F5C4B3;

  /* Neutrals */
  --ink:         #1A1A1A;
  --ink-mid:     #3D3D3D;
  --muted:       #6B7280;
  --subtle:      #9CA3AF;
  --border:      #E5E7EB;
  --border-mid:  #D1D5DB;

  /* Backgrounds */
  --bg:          #FFFFFF;
  --bg-2:        #F9FAFB;
  --bg-3:        #F3F4F6;

  /* Typography */
  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'DM Mono', 'Courier New', monospace;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

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

  /* 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.10);
  --shadow-xl:  0 16px 40px rgba(0,0,0,0.12);

  /* Transitions */
  --transition: 0.15s ease;

  /* Sidebar width */
  --sidebar-width: 220px;
  --topbar-height: 56px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  line-height: 1.7;
  color: var(--ink-mid);
}

a {
  color: var(--sage);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--sage-mid);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ── Selection ── */
::selection {
  background: var(--sage-light);
  color: var(--sage);
}

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--sage-mid);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Utilities ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-serif   { font-family: var(--font-serif); }
.text-mono    { font-family: var(--font-mono); }
.text-muted   { color: var(--muted); }
.text-subtle  { color: var(--subtle); }
.text-sage    { color: var(--sage); }
.text-amber   { color: var(--amber); }
.text-teal    { color: var(--teal); }
.text-coral   { color: var(--coral); }

.text-xs  { font-size: 11px; }
.text-sm  { font-size: 12px; }
.text-md  { font-size: 14px; }
.text-lg  { font-size: 16px; }
.text-xl  { font-size: 18px; }
.text-2xl { font-size: 22px; }

.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }

.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }

.w-full  { width: 100%; }
.h-full  { height: 100%; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.border     { border: 0.5px solid var(--border); }
.border-mid { border: 0.5px solid var(--border-mid); }

.bg-2 { background: var(--bg-2); }
.bg-3 { background: var(--bg-3); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.hidden  { display: none !important; }
.visible { display: block !important; }

.cursor-pointer { cursor: pointer; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes slideIn {
  from { transform: translateX(-10px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.animate-fade  { animation: fadeIn 0.2s ease forwards; }
.animate-spin  { animation: spin 0.7s linear infinite; }
.animate-pulse { animation: pulse 1.2s ease infinite; }
