/**
 * Design System – Premium Real Estate
 * Tokens: typography, colors, spacing, shadows, motion
 */

:root {
  /* Typography */
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-hero: clamp(2.5rem, 5vw + 1rem, 4rem);

  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.05em;

  /* Neutral luxury palette */
  --color-white: #ffffff;
  --color-off-white: #fafaf9;
  --color-cream: #f5f3f0;
  --color-stone-100: #f0eeeb;
  --color-stone-200: #e5e2dd;
  --color-stone-300: #d4cfc8;
  --color-stone-400: #a8a29e;
  --color-stone-500: #78716c;
  --color-stone-600: #57534e;
  --color-charcoal: #292524;
  --color-charcoal-dark: #1c1917;
  --color-black: #0c0a09;

  /* Accent – muted gold / green */
  --color-gold: #b8860b;
  --color-gold-muted: #a67c52;
  --color-gold-light: #d4a853;
  --color-green: #4a7c59;
  --color-green-muted: #5a8f6a;
  --color-green-light: #6b9f7a;

  /* Semantic */
  --color-primary: var(--color-gold-muted);
  --color-primary-hover: var(--color-gold);
  --color-secondary: var(--color-green-muted);
  --color-text: var(--color-charcoal);
  --color-text-muted: var(--color-stone-600);
  --color-bg: var(--color-off-white);
  --color-bg-card: var(--color-white);
  --color-border: var(--color-stone-200);
  --color-focus: var(--color-gold);

  /* Spacing */
  --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;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1400px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(12, 10, 9, 0.04);
  --shadow-md: 0 4px 12px rgba(12, 10, 9, 0.06), 0 2px 4px rgba(12, 10, 9, 0.04);
  --shadow-lg: 0 10px 30px rgba(12, 10, 9, 0.08), 0 4px 10px rgba(12, 10, 9, 0.04);
  --shadow-xl: 0 20px 50px rgba(12, 10, 9, 0.1), 0 8px 20px rgba(12, 10, 9, 0.06);
  --shadow-card: 0 4px 20px rgba(12, 10, 9, 0.06);
  --shadow-card-hover: 0 12px 40px rgba(12, 10, 9, 0.1), 0 4px 12px rgba(12, 10, 9, 0.05);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 12px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-lightbox: 400;
  --z-toast: 500;

  /* Floating action buttons */
  --fab-size: 52px;
  --fab-gap: 8px;
  --fab-column-height: calc(var(--fab-size) * 3 + var(--fab-gap) * 2);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  min-width: 0;
}

/* Reserve space at bottom so FAB / scroll-to-top don't overlap content */
@media (max-width: 639px) {
  .main-content {
    padding-bottom: calc(var(--fab-column-height) + var(--space-6) + 20px);
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* Focus visible – WCAG */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--color-charcoal);
  color: var(--color-white);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: top var(--duration-normal) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-4);
}
