/* ============================================================
   Syfo Design System — Foundations
   colors_and_type.css

   One stop for every visual token + semantic class.
   Import this file anywhere; everything below is namespaced
   via CSS custom properties or `.syfo-*` class names.
   ============================================================ */

/* ---------- Fonts (Google Fonts; swap to local woff2 if vendoring) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

/* ============================================================
   Tokens
   ============================================================ */
:root {
  /* --- Color: surfaces ---------------------------------------- */
  --bg-paper:        #F7F3EA;   /* app background, warm off-white */
  --bg-surface:      #FCFAF4;   /* cards, panels, composer */
  --bg-sunken:       #EFEADE;   /* sidebar, hover wells, code blocks */
  --bg-sunken-2:     #E8E2D2;   /* nested sunken */

  /* --- Color: foreground ------------------------------------- */
  --fg-1:            #1A1612;   /* primary text, graphite */
  --fg-2:            #65605A;   /* secondary text */
  --fg-3:            #9A938A;   /* tertiary / placeholder */
  --fg-inverse:      #FCFAF4;   /* on dark / on accent */

  /* --- Color: borders ---------------------------------------- */
  --border-1:        #E4DECF;   /* default divider */
  --border-2:        #D4CCB8;   /* stronger divider, input border */
  --border-strong:   #1A1612;   /* rare; focus/selection outlines */

  /* --- Color: accent ----------------------------------------- */
  --accent:          #D4501E;   /* primary action · burnt sienna, printer's ink on paper */
  --accent-hover:    #B8421A;
  --accent-press:    #9A3814;
  --accent-soft:     #F4DCC8;   /* selected row, accent chip fill */
  --accent-strong:   #9A3814;   /* dark variant for contrast */

  /* --- Color: status ----------------------------------------- */
  --success:         #7A7A4D;
  --success-soft:    #EFEDDE;
  --warning:         #B86E32;
  --warning-soft:    #F1E2CE;
  --danger:          #A8392A;
  --danger-soft:     #F0D8D3;
  --info:            #7A746A;
  --info-soft:       #EBE6DC;

  /* --- Type: families ---------------------------------------- */
  --font-sans:    'Inter', 'Noto Sans SC', 'Source Han Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif:   'Noto Serif SC', 'Source Han Serif SC', Georgia, 'Times New Roman', serif;
  --font-mono:    'IBM Plex Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* --- Type: scale (modular 1.125, baseline 16) -------------- */
  --text-display: 40px;    --lh-display: 48px;
  --text-h1:      28px;    --lh-h1:      36px;
  --text-h2:      18px;    --lh-h2:      26px;
  --text-h3:      15px;    --lh-h3:      22px;
  --text-body:    14px;    --lh-body:    22px;
  --text-small:   13px;    --lh-small:   20px;
  --text-label:   11px;    --lh-label:   16px;
  --text-mono-sm: 12px;    --lh-mono-sm: 18px;

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

  /* --- Tracking ----------------------------------------------- */
  --track-tight:    -0.01em;
  --track-normal:   0;
  --track-label:    0.04em;
  --track-mono:     0;

  /* --- Spacing (4px base) ------------------------------------ */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  56px;
  --space-10: 80px;

  /* --- Radii -------------------------------------------------- */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;

  /* --- Shadows ------------------------------------------------ */
  --shadow-1: 0 1px 0 rgba(17,19,26,0.04), 0 1px 2px rgba(17,19,26,0.04);
  --shadow-2: 0 4px 12px rgba(17,19,26,0.06), 0 1px 2px rgba(17,19,26,0.04);
  --shadow-3: 0 16px 40px rgba(17,19,26,0.10), 0 2px 6px rgba(17,19,26,0.06);

  /* --- Focus ring -------------------------------------------- */
  --focus-ring: 0 0 0 2px var(--bg-paper), 0 0 0 4px var(--accent);

  /* --- Layout ------------------------------------------------- */
  --rail-w:     56px;
  --sidebar-w:  280px;
  --topbar-h:   56px;
  --content-max: 980px;

  /* --- Motion ------------------------------------------------- */
  --ease-out:   cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur-fast:   120ms;
  --dur-base:   160ms;
  --dur-slow:   240ms;
}

/* ============================================================
   Base resets that Syfo expects
   ============================================================ */
html, body {
  background: var(--bg-paper);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  letter-spacing: var(--track-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  margin: 0;
}

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

::selection { background: var(--accent-soft); color: var(--accent-strong); }

/* ============================================================
   Semantic type classes
   ============================================================ */
.syfo-display {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: var(--text-display);
  line-height: var(--lh-display);
  letter-spacing: var(--track-tight);
  color: var(--fg-1);
}

.syfo-h1 {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: var(--text-h1);
  line-height: var(--lh-h1);
  letter-spacing: var(--track-tight);
  color: var(--fg-1);
}

.syfo-h2 {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-h2);
  line-height: var(--lh-h2);
  color: var(--fg-1);
}

.syfo-h3 {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-h3);
  line-height: var(--lh-h3);
  color: var(--fg-1);
}

.syfo-body {
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--fg-1);
}

.syfo-small {
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: var(--text-small);
  line-height: var(--lh-small);
  color: var(--fg-2);
}

.syfo-label {
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-label);
  line-height: var(--lh-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--fg-2);
}

.syfo-mono {
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
  font-size: var(--text-mono-sm);
  line-height: var(--lh-mono-sm);
  color: var(--fg-2);
}

.syfo-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.syfo-link:hover { border-bottom-color: var(--accent); }

/* ============================================================
   Utility — focus visible
   ============================================================ */
.syfo-focusable:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
