/*
 * Pneumat design foundation
 *
 * This file is deliberately small and component-neutral.  It gives every
 * page one contract for tokens, focus treatment and motion without replacing
 * page layout rules.  Page styles remain responsible for their own geometry.
 */

:root {
  /* Semantic colours: new components use these instead of literal values. */
  --ds-color-brand: var(--blue, #006fba);
  --ds-color-brand-strong: var(--blue-dark, #0e3342);
  --ds-color-success: var(--green, #35b957);
  --ds-color-surface: var(--surface, #ffffff);
  --ds-color-surface-soft: var(--surface-soft, #edf3f7);
  --ds-color-text: var(--ink, #111827);
  --ds-color-text-muted: var(--muted, #697586);
  --ds-color-border: var(--line, rgba(17, 24, 39, .1));

  /* Spacing, radius and elevation form the component contract. */
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-8: 32px;
  --ds-radius-sm: 10px;
  --ds-radius-md: 14px;
  --ds-radius-lg: 18px;
  --ds-shadow-sm: 0 6px 18px rgba(15, 23, 42, .06);
  --ds-shadow-md: 0 12px 28px rgba(15, 23, 42, .10);
  --ds-focus-ring: 0 0 0 3px rgba(0, 111, 186, .24);
  --ds-ease-standard: cubic-bezier(.2, .7, .2, 1);
  --ds-duration-fast: 160ms;
}

/* Opt-in base for new controls. Existing controls can migrate one by one. */
.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  min-height: 40px;
  padding: 9px var(--ds-space-4);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-color-surface);
  color: var(--ds-color-brand-strong);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--ds-shadow-sm);
  transition: transform var(--ds-duration-fast) var(--ds-ease-standard),
    border-color var(--ds-duration-fast) var(--ds-ease-standard),
    box-shadow var(--ds-duration-fast) var(--ds-ease-standard),
    background-color var(--ds-duration-fast) var(--ds-ease-standard);
}

.ui-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ds-color-brand) 32%, var(--ds-color-border));
  box-shadow: var(--ds-shadow-md);
}

.ui-button--primary {
  border-color: var(--ds-color-brand);
  background: var(--ds-color-brand);
  color: #fff;
}

.ui-button--primary:hover {
  background: var(--ds-color-brand-strong);
}

/* One consistent keyboard focus indication across both migrated and legacy controls. */
:where(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--ds-color-brand);
  outline-offset: 3px;
  box-shadow: var(--ds-focus-ring);
}

/* Respect an OS-level request to reduce movement, including the contact rail. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
