/* ==========================================================================
   Urban Salvager — Main Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  /* Brand */
  --primary:        #16A34A;
  --primary-dark:   #15803D;
  --primary-darker: #14532D;
  --primary-light:  #86EFAC;
  --primary-soft:   #DCFCE7;
  --primary-tint:   rgba(22, 163, 74, 0.08);
  --primary-ring:   rgba(22, 163, 74, 0.18);

  /* Accents */
  --accent:         #0F766E; /* deep teal — secondary accent */
  --accent-soft:    #CCFBF1;

  /* Surfaces & text */
  --bg-white:       #FFFFFF;
  --bg-cream:       #FAFAF7; /* warm off-white background */
  --bg-gray-50:     #F7F8F7;
  --bg-gray-100:    #F1F3F2;
  --bg-ink:         #0B1A12; /* deep green-black for footer */

  --text-primary:   #0F1B14;
  --text-secondary: #475467;
  --text-muted:     #6B7280;
  --text-on-dark:   #E6F3EC;

  --border-gray:    #E4E7E5;
  --border-strong:  #CDD3CF;

  /* Feedback */
  --success: #16A34A;
  --error:   #DC2626;
  --warning: #D97706;

  /* Spacing scale */
  --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;

  /* Legacy aliases (kept for inline styles in older pages) */
  --spacing-xs:  var(--space-2);
  --spacing-sm:  var(--space-4);
  --spacing-md:  var(--space-6);
  --spacing-lg:  var(--space-8);
  --spacing-xl:  var(--space-12);
  --spacing-2xl: var(--space-16);

  /* Radius */
  --radius-sm:   0.375rem;
  --radius-md:   0.625rem;
  --radius-lg:   1rem;
  --radius-xl:   1.5rem;
  --radius-pill: 999px;

  /* Layered shadows (Material-ish, but warmer) */
  --shadow-xs: 0 1px 2px rgba(15, 27, 20, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 27, 20, 0.05),
               0 1px 3px rgba(15, 27, 20, 0.06);
  --shadow-md: 0 4px 6px -2px rgba(15, 27, 20, 0.05),
               0 10px 15px -3px rgba(15, 27, 20, 0.08);
  --shadow-lg: 0 10px 15px -5px rgba(15, 27, 20, 0.08),
               0 20px 25px -5px rgba(15, 27, 20, 0.10);
  --shadow-xl: 0 20px 25px -5px rgba(15, 27, 20, 0.12),
               0 30px 50px -12px rgba(15, 27, 20, 0.18);
  --shadow-glow: 0 0 0 4px var(--primary-ring);

  /* Typography */
  --font-heading: 'Bebas Neue', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                  Roboto, Helvetica, Arial, sans-serif;

  /* Motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 400ms;

  /* Layout */
  --max-width: 1180px;
  --max-width-narrow: 820px;
  --header-height: 76px;
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out);
}

a:hover {
  color: var(--primary-dark);
}

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: var(--primary-soft);
  color: var(--primary-darker);
}

/* Visible focus for keyboard users only */
:focus {
  outline: none;
}

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

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.05;
  font-weight: 400; /* Bebas Neue is single-weight */
  letter-spacing: 0.015em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.75rem, 6vw, 4.75rem);
  margin-bottom: var(--space-5);
}

h2 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

strong { font-weight: 700; color: var(--text-primary); }

.text-center { text-align: center; }
.text-primary { color: var(--primary); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

/* ==========================================================================
   4. Layout primitives
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-24) 0;
  position: relative;
}

.section-gray {
  background-color: var(--bg-gray-50);
  border-top: 1px solid var(--border-gray);
  border-bottom: 1px solid var(--border-gray);
}

/* ==========================================================================
   5. Header
   ========================================================================== */
.header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  box-shadow: var(--shadow-xs);
  border-bottom: 1px solid var(--border-gray);
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  color: var(--primary-darker);
  text-decoration: none;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--t-fast) var(--ease-out);
}

.logo::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-tint);
  flex-shrink: 0;
}

.logo:hover {
  color: var(--primary);
}

.nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-8);
  align-items: center;
}

.nav a {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9375rem;
  position: relative;
  padding: var(--space-2) 0;
  transition: color var(--t-fast) var(--ease-out);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--t-base) var(--ease-out);
}

.nav a:hover,
.nav a.active {
  color: var(--primary);
}

.nav a:hover::after,
.nav a.active::after {
  transform: scaleX(1);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-md);
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
}

.mobile-menu-btn:hover {
  background: var(--bg-gray-50);
  border-color: var(--border-strong);
}

/* ==========================================================================
   6. Hero
   ========================================================================== */
.hero {
  background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 60%, var(--primary) 100%);
  color: white;
  padding: var(--space-24) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative dot grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.6;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: white;
  margin-bottom: var(--space-5);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.hero p {
  font-size: 1.1875rem;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto var(--space-8);
  color: rgba(255, 255, 255, 0.95);
}

/* ==========================================================================
   7. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.625rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-body);
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: transform var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm), inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm), inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: white;
  color: var(--primary-darker);
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  background: white;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-large {
  padding: 1.0625rem 2.25rem;
  font-size: 1.0625rem;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
}

/* ==========================================================================
   8. Cards
   ========================================================================== */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

/* Soften the bottom margin on the last paragraph in cards */
.card p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   9. Grid
   ========================================================================== */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ==========================================================================
   10. Forms
   ========================================================================== */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.form-label.required::after {
  content: " *";
  color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border-gray);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-strong);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
  background: #FEF2F2;
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18);
}

/* Custom select chevron */
.form-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 16px;
  padding-right: 2.75rem;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: var(--space-2);
  display: block;
  font-weight: 600;
}

.form-helper {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: var(--space-2);
  display: block;
}

/* ==========================================================================
   11. Alerts
   ========================================================================== */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--primary-soft);
  color: #065F46;
  border-color: #A7F3D0;
}

.alert-error {
  background: #FEE2E2;
  color: #991B1B;
  border-color: #FECACA;
}

.alert-warning {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FDE68A;
}

/* ==========================================================================
   12. Loading spinner
   ========================================================================== */
.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn .loading {
  margin-left: var(--space-2);
}

/* ==========================================================================
   13. FAQ accordion
   ========================================================================== */
.faq-item {
  background: var(--bg-white);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}

.faq-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.faq-item.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.faq-question {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: none;
  border: none;
  text-align: left;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  transition: color var(--t-fast) var(--ease-out);
  font-family: var(--font-body);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  background: var(--primary);
  color: white;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-slow) var(--ease-in-out);
}

.faq-item.active .faq-answer {
  max-height: 800px;
}

.faq-answer-content {
  padding: 0 var(--space-6) var(--space-5);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ==========================================================================
   14. Footer
   ========================================================================== */
.footer {
  background: var(--bg-ink);
  color: var(--text-on-dark);
  padding: var(--space-16) 0 var(--space-6);
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer h3 {
  color: white;
  margin-bottom: var(--space-4);
  font-size: 1.375rem;
  letter-spacing: 0.04em;
}

.footer p {
  color: rgba(230, 243, 236, 0.7);
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: var(--space-2);
}

.footer a {
  color: rgba(230, 243, 236, 0.75);
  font-weight: 400;
  transition: color var(--t-fast) var(--ease-out),
              padding-left var(--t-fast) var(--ease-out);
  display: inline-block;
}

.footer a:hover {
  color: var(--primary-light);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-6);
  text-align: center;
  color: rgba(230, 243, 236, 0.5);
  font-size: 0.875rem;
}

.footer-bottom p { color: inherit; margin-bottom: 0; }

/* ==========================================================================
   15. Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border-gray);
    padding: var(--space-4) var(--space-6) var(--space-6);
    animation: slideDown var(--t-base) var(--ease-out);
  }

  .nav.active {
    display: block;
  }

  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav ul li {
    border-bottom: 1px solid var(--border-gray);
  }

  .nav ul li:last-child {
    border-bottom: none;
  }

  .nav a {
    display: block;
    padding: var(--space-4) 0;
    font-size: 1rem;
  }

  .nav a::after {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero {
    padding: var(--space-16) 0;
  }

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

  h1 { font-size: clamp(2.25rem, 8vw, 3.25rem); }
  h2 { font-size: clamp(1.875rem, 6vw, 2.5rem); }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ==========================================================================
   17. Utilities
   ========================================================================== */
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-4); }
.mb-3 { margin-bottom: var(--space-6); }
.mb-4 { margin-bottom: var(--space-8); }

.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-4); }
.mt-3 { margin-top: var(--space-6); }
.mt-4 { margin-top: var(--space-8); }
