/* Kinetic Finish — PM App Design System
   Source of truth for all visual tokens.
   Imported by both mobile (Capacitor) and desktop (Netlify) apps. */

/* ── Font Loading ── */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/montserrat-v26-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/montserrat-v26-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/montserrat-v26-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/montserrat-v26-latin-700.woff2') format('woff2');
}

/* ── Custom Properties ── */
:root {
  /* Colors — Core */
  --color-charcoal: #181818;
  --color-gold: #C08E3B;
  --color-white: #FFFFFF;
  --color-gray-50: #FAFAFA;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-700: #374151;

  /* Colors — Status */
  --color-status-open: #9CA3AF;
  --color-status-active: #C08E3B;
  --color-status-waiting: #F59E0B;
  --color-status-review: #3B82F6;
  --color-status-complete: #22C55E;
  --color-status-error: #EF4444;
  --color-status-rework: #EF4444;

  /* Heritage gold alias */
  --color-heritage-gold: var(--color-gold);

  /* Typography — Mobile */
  --type-title-size: 22px;
  --type-title-weight: 600;
  --type-title-lh: 1.27;
  --type-title-tracking: -0.01em;

  --type-heading-size: 18px;
  --type-heading-weight: 600;
  --type-heading-lh: 1.33;

  --type-body-size: 16px;
  --type-body-weight: 400;
  --type-body-lh: 1.5;

  --type-body-medium-weight: 500;

  --type-caption-size: 13px;
  --type-caption-weight: 400;
  --type-caption-lh: 1.38;
  --type-caption-tracking: 0.01em;

  --type-caption-medium-weight: 500;

  --type-label-size: 12px;
  --type-label-weight: 600;
  --type-label-lh: 1.33;
  --type-label-tracking: 0.04em;

  --type-overline-size: 11px;
  --type-overline-weight: 500;
  --type-overline-lh: 1.45;
  --type-overline-tracking: 0.08em;

  /* Spacing (8px grid) */
  --space-2: 2px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 100ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 300ms ease-in-out;

  /* Layout */
  --card-padding-x: 16px;
  --card-padding-top: 20px;
  --card-padding-bottom: 32px;
  --bottom-safe-area: 34px;
  --sticky-footer-height: 72px;
  --touch-target-min: 48px;
  --touch-target-preferred: 56px;

  /* Toast */
  --toast-bg: rgba(24, 24, 24, 0.9);
  --toast-radius: var(--radius-md);
  --toast-padding-x: 12px;
  --toast-padding-y: 8px;

  /* Photo Annotation */
  --annotation-color: rgba(192, 142, 59, 0.45);
  --annotation-stroke-width: 8px;

  /* Swipe Navigation */
  --swipe-threshold: 50%;
  --swipe-activation-distance: 30px;
  --swipe-card-max-rotation: 3deg;
}

/* ── Utility Classes ── */

/* Tabular figures for numeric displays */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Typography helper classes */
.type-title {
  font-size: var(--type-title-size);
  font-weight: var(--type-title-weight);
  line-height: var(--type-title-lh);
  letter-spacing: var(--type-title-tracking);
}
.type-heading {
  font-size: var(--type-heading-size);
  font-weight: var(--type-heading-weight);
  line-height: var(--type-heading-lh);
}
.type-body {
  font-size: var(--type-body-size);
  font-weight: var(--type-body-weight);
  line-height: var(--type-body-lh);
}
.type-body-medium {
  font-size: var(--type-body-size);
  font-weight: var(--type-body-medium-weight);
  line-height: var(--type-body-lh);
}
.type-caption {
  font-size: var(--type-caption-size);
  font-weight: var(--type-caption-weight);
  line-height: var(--type-caption-lh);
  letter-spacing: var(--type-caption-tracking);
}
.type-caption-medium {
  font-size: var(--type-caption-size);
  font-weight: var(--type-caption-medium-weight);
  line-height: var(--type-caption-lh);
  letter-spacing: var(--type-caption-tracking);
}
.type-label {
  font-size: var(--type-label-size);
  font-weight: var(--type-label-weight);
  line-height: var(--type-label-lh);
  letter-spacing: var(--type-label-tracking);
  text-transform: uppercase;
}
.type-overline {
  font-size: var(--type-overline-size);
  font-weight: var(--type-overline-weight);
  line-height: var(--type-overline-lh);
  letter-spacing: var(--type-overline-tracking);
  text-transform: uppercase;
  color: var(--color-gray-400);
}

/* Icon sizing */
.icon     { width: 24px; height: 24px; display: inline-flex; align-items: center; }
.icon-sm  { width: 20px; height: 20px; display: inline-flex; align-items: center; }
.icon-xs  { width: 16px; height: 16px; display: inline-flex; align-items: center; }
.icon-dot { width: 8px;  height: 8px;  display: inline-flex; align-items: center; }
.icon-lg  { width: 48px; height: 48px; display: inline-flex; align-items: center; }
.icon svg { width: 100%; height: 100%; }
.icon-sm svg, .icon-xs svg, .icon-dot svg, .icon-lg svg { width: 100%; height: 100%; }

/* Status badge backgrounds (for inline style fallback) */
.status-bg-open { background: var(--color-gray-100); color: var(--color-gray-500); }
.status-bg-active { background: rgba(192, 142, 59, 0.15); color: var(--color-gold); }
.status-bg-waiting { background: rgba(245, 158, 11, 0.15); color: #B45309; }
.status-bg-review { background: rgba(59, 130, 246, 0.15); color: #1D4ED8; }
.status-bg-complete { background: rgba(34, 197, 94, 0.15); color: #15803D; }
.status-bg-rework { background: rgba(239, 68, 68, 0.15); color: #B91C1C; }

/* ── Base Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: var(--color-charcoal);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
}
input, textarea, select {
  font-family: inherit;
}
img { max-width: 100%; display: block; }

/* Interactive feedback */
.press-feedback:active {
  transform: scale(0.97);
  opacity: 0.8;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Truncation */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Safe area padding for iOS notch */
.safe-area-top { padding-top: env(safe-area-inset-top); }
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }

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