/* ============================================================
   PTG Home Command — Base Design Tokens & Reset
   PTG brand green + warm neutral surfaces, light-first + dark
   ============================================================ */

:root {
  /* Fluid Type Scale (12px absolute floor; web app caps at --text-xl) */
  --text-xs:   clamp(0.75rem,  0.72rem + 0.15vw, 0.8125rem); /* 12px–13px */
  --text-sm:   clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem); /* 14px–15px */
  --text-base: clamp(1rem,     0.98rem + 0.12vw, 1.0625rem); /* 16px–17px */
  --text-lg:   clamp(1.125rem, 1.06rem + 0.35vw, 1.375rem);  /* 18px–22px */
  --text-xl:   clamp(1.375rem, 1.22rem + 0.75vw, 1.875rem);  /* 22px–30px */

  /* 4px Spacing System */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radii */
  --radius-sm:   0.375rem;
  --radius-md:   0.625rem;
  --radius-lg:   0.875rem;
  --radius-xl:   1.125rem;
  --radius-full: 9999px;

  /* Motion */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography — Official PTG Fontshare Pairing */
  --font-display: 'Cabinet Grotesk', 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --sidebar-width: 248px;
  --header-height: 62px;
  --mobile-nav-height: 68px;
}

/* ---------- PTG Friendly Light Theme (Default) ---------- */
:root,
[data-theme="light"] {
  --color-bg:              #F5F7F4;
  --color-surface:         #FFFFFF;
  --color-surface-2:       #F0F3EE;
  --color-surface-hover:   #E9EFE6;
  --color-border:          #DDE3DA;
  --color-divider:         #E7ECE5;

  --color-text:            #181D16;
  --color-text-muted:      #586155;
  --color-text-faint:      #8C9588;
  --color-text-inverse:    #FFFFFF;

  /* PTG Brand Green */
  --color-brand:           #5CB32B;
  --color-primary:         #2F6B12; /* High-contrast PTG green for buttons & labels */
  --color-primary-hover:   #24540D;
  --color-primary-active:  #1B4009;
  --color-primary-soft:    #EBF6E4;
  --color-primary-border:  #C4E3B0;

  /* Member & Semantic Accents */
  --color-carlos:          #2F6B12;
  --color-carlos-soft:     #EBF6E4;
  --color-paula:           #0E6B78;
  --color-paula-soft:      #E4F4F6;
  --color-shared:          #9A5B13;
  --color-shared-soft:     #FDF3E3;

  --color-success:         #2F6B12;
  --color-success-soft:    #EBF6E4;
  --color-warning:         #B45309;
  --color-warning-soft:    #FEF3C7;
  --color-danger:          #B42318;
  --color-danger-soft:     #FEECEB;

  --shadow-sm: 0 1px 2px rgba(24, 29, 22, 0.05);
  --shadow-md: 0 4px 14px rgba(24, 29, 22, 0.07);
  --shadow-lg: 0 12px 32px rgba(24, 29, 22, 0.12);
}

/* ---------- PTG Dark Theme ---------- */
[data-theme="dark"] {
  --color-bg:              #101310;
  --color-surface:         #181C17;
  --color-surface-2:       #212620;
  --color-surface-hover:   #293027;
  --color-border:          #2E362C;
  --color-divider:         #252C23;

  --color-text:            #EDF1EB;
  --color-text-muted:      #A0AA9C;
  --color-text-faint:      #6B7468;
  --color-text-inverse:    #101310;

  --color-brand:           #6BC93A;
  --color-primary:         #6BC93A;
  --color-primary-hover:   #5CB32B;
  --color-primary-active:  #4A9022;
  --color-primary-soft:    rgba(107, 201, 58, 0.14);
  --color-primary-border:  rgba(107, 201, 58, 0.32);

  --color-carlos:          #7AD44B;
  --color-carlos-soft:     rgba(107, 201, 58, 0.16);
  --color-paula:           #4AC1D1;
  --color-paula-soft:      rgba(74, 193, 209, 0.16);
  --color-shared:          #F0A84B;
  --color-shared-soft:     rgba(240, 168, 75, 0.16);

  --color-success:         #7AD44B;
  --color-success-soft:    rgba(107, 201, 58, 0.16);
  --color-warning:         #F59E0B;
  --color-warning-soft:    rgba(245, 158, 11, 0.16);
  --color-danger:          #F87171;
  --color-danger-soft:     rgba(248, 113, 113, 0.16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.45);
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.18;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.tabular {
  font-variant-numeric: tabular-nums lining-nums;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

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