/* ============================================
   GLOBAL STYLES & DESIGN SYSTEM
   Montreal Real Estate Intelligence Platform
   ============================================ */

/* CSS Variables - Design System */
:root {
  /* Colors - Core Palette */
  --ink: #0B0F17;
  --slate: #4B5563;
  --surface: #FFFFFF;
  --surfaceMuted: #F7F8F6;
  --border: #E6E8EF;

  /* Colors - Accent */
  --accent: #0F766E;
  --accentHover: #0D9488;

  /* Colors - Utility */
  --positive: #16A34A;
  --warning: #D97706;
  --negative: #DC2626;

  /* Spacing & Layout */
  --radius: 12px;
  --container: 1280px;
  --sectionSpacing: 72px;

  /* Shadows */
  --shadow: 0 10px 30px rgba(11, 15, 23, 0.06);
  --shadowSoft: 0 6px 18px rgba(11, 15, 23, 0.06);

  /* Navigation */
  --navH: 72px;
  --navHScrolled: 60px;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
}

h4 {
  font-size: 20px;
  font-weight: 700;
}

p {
  margin: 0 0 16px 0;
  line-height: 1.7;
}

a {
  color: var(--accent);
  transition: color 150ms ease;
}

a:hover:not(.btn) {
  color: var(--accentHover);
}

ul, ol {
  margin: 0;
  padding: 0;
}

/* Layout Utilities */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: var(--sectionSpacing) 0;
}

.section--muted {
  background: var(--surfaceMuted);
}

/* Accessibility */
.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;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 2000;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: var(--radius);
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.btn--primary:hover {
  background: var(--accentHover);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.24);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.04);
  color: var(--ink);
  transform: translateY(-1px);
}

.btn--text {
  background: transparent;
  color: var(--accent);
  padding: 0;
  height: auto;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.btn--text:hover {
  color: var(--accentHover);
}

.btn--full {
  width: 100%;
}

.btn--lg {
  height: 52px;
  padding: 0 28px;
  font-size: 16px;
  letter-spacing: 0.015em;
}

/* Focus States for Accessibility */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.45);
  outline-offset: 3px;
}

/* Card Component */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.card:hover {
  box-shadow: var(--shadowSoft);
  transform: translateY(-2px);
}

.card__label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 8px;
}

.card__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--ink);
}

.card__description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--slate);
  margin: 0 0 16px 0;
}

.card__link {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  height: auto;
  padding: 12px 14px;
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

/* Grid Utilities */
.grid {
  display: grid;
  gap: 24px;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive Grid */
@media (max-width: 1000px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  :root {
    --sectionSpacing: 48px;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 16px;
  }
}

/* Text Utilities */
.text-center {
  text-align: center;
}

.text-slate {
  color: var(--slate);
}

.text-accent {
  color: var(--accent);
}

.text-lg {
  font-size: 18px;
  line-height: 1.7;
}

.text-sm {
  font-size: 14px;
}

.text-xs {
  font-size: 13px;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

/* Main Content Area */
#main {
  min-height: calc(100vh - var(--navH) - 400px);
}
