/* ==== DocForge — design tokens and resets ==== */

/* App chrome tokens. Document tokens are named --df-* and live inside the
   preview iframe, so the two palettes can never repaint each other. */
:root {
  /* surfaces, coolest to warmest */
  --bg: #F6F8FA;
  --surface: #FFFFFF;
  --surface-2: #F0F3F7;
  --surface-3: #E6EBF1;

  /* ink */
  --txt: #14181F;
  --txt-2: #37414F;
  --txt-muted: #5D6874;
  --txt-faint: #8A94A1;

  /* lines */
  --border: #E2E7ED;
  --border-strong: #CBD3DD;

  /* brand */
  --pri: #1F5F8B;
  --pri-hover: #18496B;
  --pri-soft: #E9F1F7;
  --pri-border: #BBD3E5;
  --pri-deep: #17334C;
  --pri-2: #2E7FB0;
  --acc: #B4762B;
  --acc-soft: #FBF2E4;
  --acc-2: #D19A4C;

  /* gradients — the brand ramp the hero, sidebar and primary button share */
  --grad-brand: linear-gradient(115deg, var(--pri-deep) 0%, var(--pri) 52%, var(--pri-2) 100%);
  --grad-btn: linear-gradient(180deg, #2A6F9E 0%, var(--pri) 100%);
  --grad-btn-hover: linear-gradient(180deg, #24628C 0%, var(--pri-hover) 100%);
  --grad-danger: linear-gradient(180deg, #C4342B 0%, var(--danger) 100%);
  --grad-well: linear-gradient(145deg, #EEF4F9 0%, #DCE9F3 100%);
  --grad-surface: linear-gradient(180deg, #FFFFFF 0%, var(--surface-2) 100%);

  /* glass */
  --glass-bg: rgba(255, 255, 255, .66);
  --glass-border: rgba(203, 211, 221, .55);
  --glass-blur: saturate(170%) blur(14px);
  --glass-dark-bg: rgba(255, 255, 255, .14);
  --glass-dark-border: rgba(255, 255, 255, .28);

  /* status */
  --ok: #1B7A4B;
  --ok-soft: #E5F4EC;
  --warn: #8A6100;
  --warn-soft: #FBF1DA;
  --danger: #B3261E;
  --danger-soft: #FDEDEC;
  --danger-border: #F1C9C6;

  /* geometry — everything on --radius moves together */
  --radius-sm: 7px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Layered shadows: a tight contact shadow plus a soft ambient one reads as
     depth rather than as a grey outline. */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .05), 0 8px 20px rgba(16, 24, 40, .08);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .06), 0 12px 28px rgba(16, 24, 40, .10);
  --shadow-xl: 0 4px 8px rgba(16, 24, 40, .06), 0 24px 56px rgba(16, 24, 40, .16);
  --shadow-pri: 0 1px 2px rgba(31, 95, 139, .25), 0 6px 16px rgba(31, 95, 139, .28);
  --ring: 0 0 0 4px rgba(31, 95, 139, .14);
  --ring-danger: 0 0 0 4px rgba(179, 38, 30, .14);

  /* motion */
  --transition: 150ms cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 320ms;

  --sidebar-width: 236px;
  --topbar-h: 60px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
}

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

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Inter's contextual alternates tidy up the punctuation used in UI copy. */
  font-feature-settings: 'cv05' 1, 'ss01' 1;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.011em;
  color: var(--txt);
}
h1 { font-size: 22px; letter-spacing: -.02em; }
h2 { font-size: 17px; }
h3 { font-size: 14.5px; }
p { margin: 0 0 1em; }

a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }

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

:focus-visible {
  outline: 2px solid var(--pri);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
/* Mouse users should not see focus rings on click, keyboard users must. */
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--pri-soft); }

/* Numbers that sit in columns must not jitter as they change. */
.tabular, .stat-value, .job-pct, td.num { font-variant-numeric: tabular-nums; }

.hidden { display: none !important; }
/* The hidden attribute must beat an author display rule on the same element. */
[hidden] { display: none !important; }
.muted { color: var(--txt-muted); }
.faint { color: var(--txt-faint); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }

.icon { flex: 0 0 auto; vertical-align: -.14em; }

.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;
}

/* ---------------------------------------------------------------- boot --*/

#loading-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background: var(--bg);
  z-index: 999;
  transition: opacity 260ms ease;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
.boot-mark { width: 56px; height: 56px; object-fit: contain; opacity: .9; }

.spinner {
  width: 26px; height: 26px;
  border: 2.5px solid var(--surface-3);
  border-top-color: var(--pri);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-sm { width: 15px; height: 15px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Registered gradient stops, so the Brand kit hero can cross-fade when the
   default palette changes. Progressive: browsers without @property simply
   snap to the new colours. */
@property --kit-g0 { syntax: '<color>'; inherits: true; initial-value: #17334C; }
@property --kit-g1 { syntax: '<color>'; inherits: true; initial-value: #1F5F8B; }
@property --kit-g2 { syntax: '<color>'; inherits: true; initial-value: #2C7FA8; }
