/* ============================================
   NEST LEGAL SERVICES - GLOBAL STYLES
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;1,400&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */

:root {
  /* Brand Colors */
  --primary-sage: #7A9A8A;
  --primary-sage-light: #A4C2B4;
  --primary-sage-dark: #5A7A6A;
  --warm-gray: #8A8A8A;
  --warm-gray-light: #B8B8B8;
  --warm-gray-dark: #6A6A6A;
  --cream: #F5F5DC;
  --cream-dark: #E8E5C7;
  --white: #FFFFFF;
  --text-dark: #2C2C2C;
  --text-medium: #5A5A5A;
  --accent-gold: #D4AF37;
  --success-green: #10B981;
  --error-red: #EF4444;

  /* Surface Colors */
  --surface-1: #FFFFFF;
  --surface-2: #F9F9F5;
  --surface-3: var(--cream);
  --border-color: #E5E5E0;

  /* Typography */
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;

  /* Spacing */
  --section-padding: clamp(4rem, 8vw, 8rem);
  --container-max: 1200px;
  --container-padding: clamp(1.25rem, 5vw, 2rem);

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(44, 44, 44, 0.06);
  --shadow-md: 0 8px 24px rgba(44, 44, 44, 0.10);
  --shadow-lg: 0 20px 48px rgba(122, 154, 138, 0.15);
  --shadow-sage: 0 12px 32px rgba(122, 154, 138, 0.20);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--surface-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* ============================================
   TYPOGRAPHY SCALE
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 600; }
h4 { font-size: clamp(1.1rem, 2vw, 1.375rem); font-weight: 600; }
h5 { font-size: 1.125rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p {
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
  line-height: 1.7;
  color: var(--text-medium);
}

.lead {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-medium);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1400px;
}

.section {
  padding-block: var(--section-padding);
}

.section--alt {
  background-color: var(--surface-2);
}

.section--sage {
  background-color: var(--primary-sage);
  color: var(--white);
}

.section--cream {
  background-color: var(--cream);
}

/* Grid System */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.5rem;
}

/* Flex utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-sage), var(--primary-sage-light));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(122, 154, 138, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-sage-dark), var(--primary-sage));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(122, 154, 138, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-sage-dark);
  border-color: var(--primary-sage);
}

.btn-secondary:hover {
  background: var(--primary-sage);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), #E8C55A);
  color: var(--text-dark);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.45);
}

.btn-lg {
  padding: 18px 36px;
  font-size: 1rem;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.875rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card--sage {
  background: linear-gradient(135deg, var(--primary-sage), var(--primary-sage-dark));
  color: var(--white);
  border-color: transparent;
}

.card--cream {
  background: var(--cream);
  border-color: var(--cream-dark);
}

/* ============================================
   SECTION HEADERS
   ============================================ */

.section-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-header .eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-sage);
  background: rgba(122, 154, 138, 0.1);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  max-width: 600px;
  margin-inline: auto;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color var(--transition-fast);
  min-height: 44px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-sage);
  box-shadow: 0 0 0 3px rgba(122, 154, 138, 0.15);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

.badge--sage {
  background: rgba(122, 154, 138, 0.15);
  color: var(--primary-sage-dark);
}

.badge--gold {
  background: rgba(212, 175, 55, 0.15);
  color: #A68A1B;
}

.badge--cream {
  background: var(--cream-dark);
  color: var(--text-medium);
}

/* ============================================
   DIVIDERS
   ============================================ */

.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-sage), var(--primary-sage-light));
  border-radius: 2px;
  margin-block: 1.5rem;
}

.divider--center {
  margin-inline: auto;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--cream-dark);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-sage), var(--primary-sage-light));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-base);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.modal-overlay.is-open .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background var(--transition-fast);
  z-index: 10;
  border: none;
  color: var(--text-medium);
}

.modal-close:hover {
  background: var(--cream-dark);
}

/* ============================================
   DOCUMENT PREVIEW
   ============================================ */

.document-preview {
  font-family: 'Georgia', serif;
  color: #1a1a1a;
  line-height: 1.6;
}

.document-preview .doc-header {
  text-align: center;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.document-preview h1 {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: 'Georgia', serif;
}

.document-preview .doc-section {
  margin-bottom: 1.5rem;
}

.document-preview .article-number {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-fade-up {
  animation: fadeInUp 0.6s ease both;
}

.animate-fade-up--delay-1 { animation-delay: 0.1s; }
.animate-fade-up--delay-2 { animation-delay: 0.2s; }
.animate-fade-up--delay-3 { animation-delay: 0.3s; }
.animate-fade-up--delay-4 { animation-delay: 0.4s; }

/* ============================================
   SERVICE CARDS
   ============================================ */

.service-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(122, 154, 138, 0.15);
}

/* ============================================
   SKIP LINK (ACCESSIBILITY)
   ============================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary-sage-dark);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-2);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-sage-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-sage);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .no-print { display: none !important; }
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* ============================================
   SNIPCART OVERRIDES
   ============================================ */

.snipcart-modal__container {
  font-family: var(--font-body) !important;
}

.snipcart-item-line__header {
  font-family: var(--font-heading) !important;
}

/* ============================================
   FOCUS VISIBLE
   ============================================ */

:focus-visible {
  outline: 2px solid var(--primary-sage);
  outline-offset: 3px;
  border-radius: 3px;
}
