
/* ===== tokens/fonts.css ===== */
/* ============================================================
   Living Root Advisory — Webfonts
   Display : Spectral  — warm, organic transitional serif (gravitas)
   Body    : Hanken Grotesk — humanist sans (clean, friendly, modern)
   Mono    : Spline Sans Mono — for data/code in product surfaces
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Hanken+Grotesk:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=Spline+Sans+Mono:wght@400;500;600&display=swap');


/* ===== tokens/colors.css ===== */
/* ============================================================
   Living Root Advisory — Color System
   Derived from the brand mark: emerald spearhead, fresh green
   canopy, and golden-oak roots. Earthy, grounded, premium, human.
   ============================================================ */

:root {
  /* --- Forest Green : primary brand. Warm fresh emerald — spearhead & canopy. --- */
  --forest-950: #143619;
  --forest-900: #1C4A26;
  --forest-800: #265E31;
  --forest-700: #347A40;   /* PRIMARY brand green — warm leaf-emerald */
  --forest-600: #44904F;
  --forest-500: #55A360;
  --forest-400: #7ABA82;
  --forest-300: #A4D2A9;
  --forest-200: #CBE5CE;
  --forest-100: #E6F2E7;
  --forest-50:  #F3F8F3;

  /* --- Aged Oak : the roots & trunk. Muted antique bronze \u2014 a warm neutral. --- */
  --bark-950: #322413;
  --bark-900: #3F2F18;
  --bark-800: #4D3A1D;
  --bark-700: #5E4924;
  --bark-600: #735C31;   /* PRIMARY aged oak \u2014 muted bronze */
  --bark-500: #8B7342;
  --bark-400: #A89160;
  --bark-300: #C7B28C;
  --bark-200: #DFD1B4;
  --bark-100: #EFE7D5;
  --bark-50:  #F8F2E6;

  /* --- Leaf Lime : growth, energy, the bright accent. Use sparingly. --- */
  --leaf-800: #4F671B;
  --leaf-700: #627F22;
  --leaf-600: #73922A;   /* ACCENT */
  --leaf-500: #88A83F;
  --leaf-400: #9FBB5C;
  --leaf-300: #BBD088;
  --leaf-200: #D7E5B7;
  --leaf-100: #ECF3DA;

  /* --- Warm neutrals : earthy paper & stone, never pure grey. --- */
  --stone-950: #1A1611;   /* warm near-black ink */
  --stone-900: #2C2620;
  --stone-800: #443D33;
  --stone-700: #5A5247;
  --stone-600: #6B6256;
  --stone-500: #897F70;
  --stone-400: #ABA192;
  --stone-300: #CFC6B8;
  --stone-200: #E2DBCE;
  --stone-150: #ECE6DB;
  --stone-100: #F1EDE5;
  --stone-50:  #FAF8F4;   /* warm paper */
  --white:     #FFFFFF;

  /* --- Semantic : earthy, never neon. --- */
  --success-600: #347A40;
  --success-100: #E6F2E7;
  --warning-600: #B9842B;
  --warning-100: #F4E8CC;
  --danger-600:  #B14A35;   /* clay red */
  --danger-100:  #F4DDD5;
  --info-600:    #3E6B6E;   /* muted teal */
  --info-100:    #D8E6E5;

  /* ===========================================================
     Semantic aliases — reference these in components, not the
     raw scales above.
     =========================================================== */

  /* Brand */
  --brand-primary:   var(--forest-700);
  --brand-primary-hover: var(--forest-800);
  --brand-secondary: var(--bark-600);
  --brand-accent:    var(--leaf-600);

  /* Surfaces */
  --surface-page:    var(--stone-50);
  --surface-card:    var(--white);
  --surface-subtle:  var(--stone-100);
  --surface-sunken:  var(--stone-150);
  --surface-inverse: var(--forest-900);
  --surface-accent:  var(--forest-50);

  /* Text */
  --text-strong:  var(--stone-950);
  --text-body:    var(--stone-900);
  --text-muted:   var(--stone-600);
  --text-subtle:  var(--stone-500);
  --text-inverse: var(--stone-50);
  --text-brand:   var(--forest-700);
  --text-link:    var(--forest-700);

  /* Borders */
  --border-subtle:  var(--stone-200);
  --border-default: var(--stone-300);
  --border-strong:  var(--stone-400);
  --border-brand:   var(--forest-700);

  /* Focus */
  --focus-ring: var(--forest-500);
}


/* ===== tokens/typography.css ===== */
/* ============================================================
   Living Root Advisory — Typography
   Spectral (display serif) + Hanken Grotesk (body sans).
   A modular scale (1.20 minor-third) on a 16px base.
   ============================================================ */

:root {
  /* Families */
  --font-display: 'Spectral', Georgia, 'Times New Roman', serif;
  --font-body:    'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Weights */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Type scale (1.20) */
  --text-2xs:  11px;
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   21px;
  --text-xl:   25px;
  --text-2xl:  31px;
  --text-3xl:  37px;
  --text-4xl:  47px;
  --text-5xl:  60px;
  --text-6xl:  76px;

  /* Line heights */
  --leading-tight:  1.1;
  --leading-snug:   1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Letter spacing */
  --tracking-tighter: -0.02em;
  --tracking-tight:   -0.01em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-wider:   0.12em;   /* eyebrow / overline caps */

  /* Semantic roles */
  --display-font:  var(--font-display);
  --display-weight: var(--weight-semibold);
  --heading-font:  var(--font-display);
  --body-font:     var(--font-body);
  --eyebrow-font:  var(--font-body);
}


/* ===== tokens/spacing.css ===== */
/* ============================================================
   Living Root Advisory — Spacing, Radii, Shadows, Layout
   Boxy and architectural: generous border space, restrained radii,
   soft earthy shadows. (Foundation → Pillars → Mantle.)
   ============================================================ */

:root {
  /* Spacing scale (4px base) */
  --space-0:  0;
  --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;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Radii — architectural, restrained. */
  --radius-none: 0;
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   10px;
  --radius-xl:   16px;
  --radius-full: 999px;

  /* Borders */
  --border-width: 1px;
  --border-width-thick: 2px;

  /* Shadows — soft, warm-tinted (bark-toned, never pure black). */
  --shadow-xs: 0 1px 2px rgba(46, 34, 23, 0.06);
  --shadow-sm: 0 1px 3px rgba(46, 34, 23, 0.08), 0 1px 2px rgba(46, 34, 23, 0.04);
  --shadow-md: 0 4px 12px rgba(46, 34, 23, 0.08), 0 2px 4px rgba(46, 34, 23, 0.05);
  --shadow-lg: 0 12px 28px rgba(46, 34, 23, 0.10), 0 4px 10px rgba(46, 34, 23, 0.05);
  --shadow-xl: 0 24px 56px rgba(46, 34, 23, 0.14);
  --shadow-inset: inset 0 1px 2px rgba(46, 34, 23, 0.08);

  /* Layout */
  --container-sm:  640px;
  --container-md:  820px;
  --container-lg:  1080px;
  --container-xl:  1280px;
  --gutter:        var(--space-6);
  --section-y:     var(--space-24);

  /* Motion */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);   /* @kind other */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);  /* @kind other */
  --dur-fast:   120ms;   /* @kind other */
  --dur-base:   200ms;   /* @kind other */
  --dur-slow:   360ms;   /* @kind other */
}


/* ===== tokens/base.css ===== */
/* ============================================================
   Living Root Advisory — Base / reset
   Light normalization + brand defaults. Consumers get this for free.
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--forest-800); }

code, pre, kbd, samp { font-family: var(--font-mono); }

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

::selection { background: var(--leaf-200); color: var(--stone-950); }

/* Eyebrow / overline utility */
.lr-eyebrow {
  font-family: var(--eyebrow-font);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--forest-600);
}


/* ===== components/components.css ===== */
/* ============================================================
   Living Root Advisory — Component styles
   Class-based so primitives get real hover / focus / active /
   disabled states. Everything references the design tokens.
   Prefix: .lr-
   ============================================================ */

/* ---------- Button ---------- */
.lr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  border: var(--border-width) solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  text-decoration: none;
}
.lr-btn:active { transform: translateY(1px); }
.lr-btn:disabled, .lr-btn[aria-disabled="true"] {
  opacity: 0.45; cursor: not-allowed; transform: none;
}

/* sizes */
.lr-btn--sm { font-size: var(--text-sm); padding: 7px 14px; }
.lr-btn--md { font-size: var(--text-sm); padding: 10px 20px; }
.lr-btn--lg { font-size: var(--text-base); padding: 14px 28px; }

/* variants */
.lr-btn--primary { background: var(--forest-700); color: var(--stone-50); }
.lr-btn--primary:hover:not(:disabled) { background: var(--forest-800); }

.lr-btn--secondary { background: var(--bark-600); color: var(--bark-50); }
.lr-btn--secondary:hover:not(:disabled) { background: var(--bark-700); }

.lr-btn--accent { background: var(--leaf-600); color: var(--stone-950); }
.lr-btn--accent:hover:not(:disabled) { background: var(--leaf-700); color: var(--stone-50); }

.lr-btn--outline {
  background: transparent; color: var(--forest-700);
  border-color: var(--forest-700);
}
.lr-btn--outline:hover:not(:disabled) { background: var(--forest-50); }

.lr-btn--ghost { background: transparent; color: var(--forest-700); }
.lr-btn--ghost:hover:not(:disabled) { background: var(--forest-50); }

.lr-btn--block { display: flex; width: 100%; }

/* ---------- IconButton ---------- */
.lr-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: var(--border-width) solid transparent;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.lr-iconbtn:hover:not(:disabled) { background: var(--surface-subtle); color: var(--text-body); }
.lr-iconbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.lr-iconbtn--sm { width: 30px; height: 30px; }
.lr-iconbtn--md { width: 38px; height: 38px; }
.lr-iconbtn--lg { width: 46px; height: 46px; }
.lr-iconbtn--solid { background: var(--forest-700); color: var(--stone-50); }
.lr-iconbtn--solid:hover:not(:disabled) { background: var(--forest-800); color: var(--stone-50); }

/* ---------- Field / label ---------- */
.lr-field { display: flex; flex-direction: column; gap: var(--space-2); }
.lr-field__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-body); }
.lr-field__req { color: var(--danger-600); margin-left: 2px; }
.lr-field__hint { font-size: var(--text-xs); color: var(--text-muted); }
.lr-field__error { font-size: var(--text-xs); color: var(--danger-600); font-weight: var(--weight-medium); }

/* ---------- Input / Textarea / Select ---------- */
.lr-input, .lr-textarea, .lr-select {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-body);
  background: var(--surface-card);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.lr-input::placeholder, .lr-textarea::placeholder { color: var(--text-subtle); }
.lr-input:focus, .lr-textarea:focus, .lr-select:focus {
  outline: none; border-color: var(--forest-600);
  box-shadow: 0 0 0 3px var(--forest-100);
}
.lr-input:disabled, .lr-textarea:disabled, .lr-select:disabled {
  background: var(--surface-subtle); color: var(--text-subtle); cursor: not-allowed;
}
.lr-input--invalid, .lr-textarea--invalid, .lr-select--invalid {
  border-color: var(--danger-600);
}
.lr-input--invalid:focus { box-shadow: 0 0 0 3px var(--danger-100); }
.lr-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.lr-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B6256' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ---------- Checkbox / Radio ---------- */
.lr-check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--text-sm); color: var(--text-body); }
.lr-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.lr-check__box {
  width: 18px; height: 18px; flex: none; border: var(--border-width-thick) solid var(--border-strong);
  border-radius: var(--radius-xs); background: var(--surface-card);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.lr-check__box svg { opacity: 0; }
.lr-check input:checked + .lr-check__box { background: var(--forest-700); border-color: var(--forest-700); }
.lr-check input:checked + .lr-check__box svg { opacity: 1; }
.lr-check input:focus-visible + .lr-check__box { box-shadow: 0 0 0 3px var(--forest-100); }
.lr-check--radio .lr-check__box { border-radius: var(--radius-full); }
.lr-check--radio .lr-check__dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--stone-50); opacity: 0; transition: opacity var(--dur-fast); }
.lr-check input:checked + .lr-check__box .lr-check__dot { opacity: 1; }

/* ---------- Switch ---------- */
.lr-switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: var(--text-sm); color: var(--text-body); }
.lr-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.lr-switch__track {
  width: 40px; height: 22px; border-radius: var(--radius-full);
  background: var(--stone-300); position: relative; flex: none;
  transition: background var(--dur-base) var(--ease-out);
}
.lr-switch__thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: var(--radius-full); background: var(--white); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out);
}
.lr-switch input:checked + .lr-switch__track { background: var(--forest-600); }
.lr-switch input:checked + .lr-switch__track .lr-switch__thumb { transform: translateX(18px); }
.lr-switch input:focus-visible + .lr-switch__track { box-shadow: 0 0 0 3px var(--forest-100); }

/* ---------- Card ---------- */
.lr-card {
  background: var(--surface-card);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.lr-card--flat { box-shadow: none; }
.lr-card--raised { box-shadow: var(--shadow-md); }
.lr-card--pad-sm { padding: var(--space-4); }
.lr-card--pad-md { padding: var(--space-6); }
.lr-card--pad-lg { padding: var(--space-8); }
.lr-card--interactive { cursor: pointer; transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), border-color var(--dur-base); }
.lr-card--interactive:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border-default); }
.lr-card--accent { border-top: 3px solid var(--forest-700); }

/* ---------- Badge ---------- */
.lr-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  padding: 3px 9px; border-radius: var(--radius-full); line-height: 1.4;
}
.lr-badge--neutral { background: var(--stone-150); color: var(--stone-700); }
.lr-badge--brand   { background: var(--forest-100); color: var(--forest-700); }
.lr-badge--accent  { background: var(--leaf-100); color: var(--leaf-700); }
.lr-badge--success { background: var(--success-100); color: var(--success-600); }
.lr-badge--warning { background: var(--warning-100); color: var(--warning-600); }
.lr-badge--danger  { background: var(--danger-100); color: var(--danger-600); }
.lr-badge--info    { background: var(--info-100); color: var(--info-600); }
.lr-badge__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }

/* ---------- Tag ---------- */
.lr-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--surface-card); border: var(--border-width) solid var(--border-default);
  color: var(--text-body);
}
.lr-tag__x { cursor: pointer; color: var(--text-subtle); display: inline-flex; }
.lr-tag__x:hover { color: var(--text-body); }

/* ---------- Avatar ---------- */
.lr-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full); overflow: hidden; flex: none;
  background: var(--forest-700); color: var(--stone-50);
  font-family: var(--font-body); font-weight: var(--weight-semibold);
}
.lr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lr-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.lr-avatar--md { width: 38px; height: 38px; font-size: 14px; }
.lr-avatar--lg { width: 52px; height: 52px; font-size: 18px; }

/* ---------- Stat ---------- */
.lr-stat { display: flex; flex-direction: column; gap: 4px; }
.lr-stat__label { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--text-muted); }
.lr-stat__value { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--weight-semibold); color: var(--text-strong); line-height: 1; letter-spacing: -0.01em; }
.lr-stat__delta { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.lr-stat__delta--up { color: var(--success-600); }
.lr-stat__delta--down { color: var(--danger-600); }

/* ---------- Alert ---------- */
.lr-alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); border-radius: var(--radius-md);
  border: var(--border-width) solid; font-size: var(--text-sm);
}
.lr-alert__icon { flex: none; margin-top: 1px; }
.lr-alert__title { font-weight: var(--weight-semibold); margin-bottom: 2px; }
.lr-alert__body { color: var(--text-body); line-height: 1.5; }
.lr-alert--info    { background: var(--info-100); border-color: var(--info-600); color: var(--info-600); }
.lr-alert--success { background: var(--success-100); border-color: var(--success-600); color: var(--success-600); }
.lr-alert--warning { background: var(--warning-100); border-color: var(--warning-600); color: var(--warning-600); }
.lr-alert--danger  { background: var(--danger-100); border-color: var(--danger-600); color: var(--danger-600); }

/* ---------- Progress ---------- */
.lr-progress { height: 8px; background: var(--stone-200); border-radius: var(--radius-full); overflow: hidden; width: 100%; }
.lr-progress__bar { height: 100%; background: var(--forest-600); border-radius: var(--radius-full); transition: width var(--dur-slow) var(--ease-out); }
.lr-progress__bar--accent { background: var(--leaf-600); }

/* ---------- Tabs ---------- */
.lr-tabs { display: flex; gap: var(--space-1); border-bottom: var(--border-width) solid var(--border-subtle); }
.lr-tab {
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.lr-tab:hover { color: var(--text-body); }
.lr-tab--active { color: var(--forest-700); border-bottom-color: var(--forest-700); font-weight: var(--weight-semibold); }

