/* DesignKit — StanHattie Design Tokens v1.0
   Copy this file into any new project's static/ folder.
   Override --accent and --font-display per project.
   See accents.css for per-project overrides.
   ─────────────────────────────────────────── */


/* ═══════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════ */

:root {
  /* ── Background scale (dark theme default) ── */
  --bg:            #0a0a0a;
  --bg-raised:     #111111;
  --bg-overlay:    #1a1a1a;
  --bg-hover:      #222222;

  /* ── Text scale ── */
  --text:           #f0f0ec;
  --text-secondary: #999999;
  --text-muted:     rgba(240, 240, 236, 0.45);
  --text-faint:     rgba(240, 240, 236, 0.18);

  /* ── Accent — override per project ── */
  --accent:       #ff6b35;
  --accent-dim:   rgba(255, 107, 53, 0.12);
  --accent-glow:  rgba(255, 107, 53, 0.28);
  --accent-hover: #e55a28;

  /* ── Semantic colors ── */
  --success: #27ae60;
  --warning: #f39c12;
  --danger:  #e74c3c;
  --info:    #3498db;

  /* ── Border scale ── */
  --border:        rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.14);
  --border-focus:  var(--accent);

  /* ── Gray scale ── */
  --gray-50:  #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-400: #bdbdbd;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;

  /* ── Shadow scale ── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow:    0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);

  /* ── Typography ── */
  --font-body:    'Instrument Sans', system-ui, -apple-system, sans-serif;
  --font-code:    'DM Mono', monospace;
  --font-display: var(--font-body);

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

  /* ── Radius ── */
  --radius:      8px;
  --radius-sm:   4px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* ── Transitions ── */
  --transition:      0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.12s ease;

  /* ── Layout ── */
  --max-width:     1200px;
  --sidebar-width: 240px;
}


/* ── Light theme override ── */
[data-theme="light"],
.theme-light {
  --bg:            #ffffff;
  --bg-raised:     #f8f8f8;
  --bg-overlay:    #f0f0f0;
  --bg-hover:      #eeeeee;
  --text:          #1a1a1a;
  --text-secondary:#666666;
  --text-muted:    rgba(0, 0, 0, 0.45);
  --text-faint:    rgba(0, 0, 0, 0.18);
  --border:        rgba(0, 0, 0, 0.08);
  --border-bright: rgba(0, 0, 0, 0.15);
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow:        0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md:     0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg:     0 8px 32px rgba(0, 0, 0, 0.12);
}


/* ═══════════════════════════════════════════
   2. RESET
   ═══════════════════════════════════════════ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-hover);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}


/* ═══════════════════════════════════════════
   3. TYPOGRAPHY
   ═══════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: 2.25rem; letter-spacing: -0.025em; }
h2 { font-size: 1.75rem; letter-spacing: -0.02em; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

small {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

code, pre {
  font-family: var(--font-code);
  font-size: 0.875em;
}

code {
  background: var(--bg-overlay);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

pre {
  background: var(--bg-overlay);
  padding: var(--space-md);
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--border);
}
pre code {
  background: none;
  padding: 0;
  color: inherit;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}


/* ═══════════════════════════════════════════
   4. UTILITY CLASSES
   ═══════════════════════════════════════════ */

/* ── Display ── */
.flex          { display: flex; }
.inline-flex   { display: inline-flex; }
.grid          { display: grid; }
.block         { display: block; }
.inline-block  { display: inline-block; }
.hidden        { display: none !important; }

/* ── Flex alignment ── */
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.flex-col       { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.flex-1         { flex: 1; }
.flex-shrink-0  { flex-shrink: 0; }

/* ── Gap ── */
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.gap-xl  { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* ── Grid layouts ── */
.grid-2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Text ── */
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.text-danger    { color: var(--danger) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-sm        { font-size: 0.8125rem; }
.text-xs        { font-size: 0.75rem; }
.text-lg        { font-size: 1.125rem; }
.text-xl        { font-size: 1.375rem; }
.font-mono      { font-family: var(--font-code) !important; }
.font-bold      { font-weight: 700; }
.font-medium    { font-weight: 500; }
.uppercase      { text-transform: uppercase; letter-spacing: 0.05em; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Spacing ── */
.m-0   { margin: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-sm  { padding: var(--space-sm); }
.p-md  { padding: var(--space-md); }
.p-lg  { padding: var(--space-lg); }
.p-xl  { padding: var(--space-xl); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* ── Borders & Radius ── */
.border       { border: 1px solid var(--border); }
.border-b     { border-bottom: 1px solid var(--border); }
.rounded      { border-radius: var(--radius); }
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* ── Backgrounds ── */
.bg-raised   { background: var(--bg-raised); }
.bg-overlay  { background: var(--bg-overlay); }
.bg-accent   { background: var(--accent); color: #fff; }

/* ── Shadows ── */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow    { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

/* ── Position ── */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; top: 0; z-index: 10; }

/* ── Overflow ── */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ── Cursor ── */
.pointer     { cursor: pointer; }
.not-allowed { cursor: not-allowed; opacity: 0.5; }

/* ── Transitions ── */
.transition { transition: all var(--transition); }

/* ── Screen reader only ── */
.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;
}
