@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --primary: #C26E4B;
  --accent: #6B7A4F;
  --bg: #F4EFE6;
  --surface: #EAE1D1;
  --text: #2C231D;
  --muted: #857668;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  --font-heading: 'Crimson Pro', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;

  --header-height: 72px;
  --container-max: 1200px;
  --container-padding: 1.25rem;

  --transition: 0.25s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

ul, ol {
  list-style: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text);
}

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

.text-center {
  text-align: center;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: 4rem;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 3rem;
}

.section-header p {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0.75rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  box-shadow: var(--shadow);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background var(--transition), box-shadow var(--transition);
}

.header.scrolled {
  background: rgba(244, 239, 230, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

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

.nav-menu {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-menu a {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.25rem 0;
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition);
}

.nav-menu a:hover::after {
  width: 100%;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.mobile-menu-toggle svg,
.mobile-menu-toggle .hamburger-icon {
  width: 24px;
  height: 24px;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger-icon span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================
   HAMBURGER MENU — MOBILE RULES (CRITICAL)
   ============================================ */
@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: inline-block;
  }

  .nav-menu {
    display: none;
  }

  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    padding: 1rem;
    border-top: 1px solid var(--muted);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.open a {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(133, 118, 104, 0.15);
  }

  .nav-menu.open a:last-child {
    border-bottom: none;
  }
}

/* ============================================
   TEXT-OVER-PHOTO CONTRAST OVERLAY (CRITICAL)
   ============================================ */
.has-photo-bg {
  position: relative;
  isolation: isolate;
}

.has-photo-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.85));
  z-index: 0;
}

.has-photo-bg > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 0 4rem;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(194, 110, 75, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(107, 122, 79, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(194, 110, 75, 0.08) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23857668' opacity='0.15'/%3E%3C/svg%3E");
  background-size: cover, cover, cover, 20px 20px;
  background-color: var(--bg);
}

.hero-section.has-photo-bg {
  background-size: cover;
  background-position: center;
}

.hero-content {
  max-width: 720px;
}

.hero-section h1 {
  color: var(--text);
  margin-bottom: 1.25rem;
}

.has-photo-bg .hero-section h1,
.hero-section.has-photo-bg h1 {
  color: #F4EFE6;
}

.has-photo-bg .hero-section p,
.hero-section.has-photo-bg p {
  color: rgba(244, 239, 230, 0.9);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 560px;
  margin-inline: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary,
.btn-secondary,
.cta-button,
.form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: #F4EFE6;
}

.btn-primary:hover {
  background: #a85a3a;
  color: #F4EFE6;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(194, 110, 75, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: #F4EFE6;
  transform: translateY(-1px);
}

.cta-button {
  background: var(--accent);
  color: #F4EFE6;
  padding: 1rem 2.25rem;
  font-size: 1.05rem;
}

.cta-button:hover {
  background: #566340;
  color: #F4EFE6;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(107, 122, 79, 0.3);
}

.form-submit {
  background: var(--primary);
  color: #F4EFE6;
  width: 100%;
  padding: 0.9rem 1.75rem;
  margin-top: 0.5rem;
}

.form-submit:hover {
  background: #a85a3a;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(194, 110, 75, 0.3);
}

/* ============================================
   GLASS CARDS
   ============================================ */
.card {
  background: rgba(234, 225, 209, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(133, 118, 104, 0.12);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: #F4EFE6;
  font-size: 1.4rem;
}

.card h3 {
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
  background: var(--bg);
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.services-section {
  background: var(--surface);
}

.service-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.service-card h3 {
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.service-card p {
  color: var(--muted);
}

.service-card .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1rem;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-section {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-content h2 {
  margin-bottom: 1rem;
}

.about-content p {
  color: var(--muted);
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #F4EFE6;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item h3 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #F4EFE6;
  margin-bottom: 0.25rem;
}

.stat-item p {
  color: rgba(244, 239, 230, 0.8);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ============================================
   TESTIMONIALS SECTION
   ============================================ */
.testimonial-section {
  background-image: url('/images/testimonial-bg.jpg');
  background-size: cover;
  background-position: center;
  padding-block: 5rem;
}

.testimonial-section.has-photo-bg h2,
.testimonial-section.has-photo-bg .section-header p {
  color: #F4EFE6;
}

.testimonial-section.has-photo-bg .section-header p {
  color: rgba(244, 239, 230, 0.8);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.testimonial-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.testimonial-card blockquote {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.25rem;
  font-style: italic;
}

.testimonial-card blockquote::before {
  content: '\201C';
  font-size: 3rem;
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 0;
  display: block;
  margin-bottom: 0.5rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-author img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-author-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}

.testimonial-author-info span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  background: linear-gradient(135deg, rgba(194, 110, 75, 0.08), rgba(107, 122, 79, 0.08));
  text-align: center;
  padding-block: 5rem;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 540px;
  margin-inline: auto;
  margin-bottom: 2rem;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
  background: var(--bg);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.contact-info h3 {
  margin-bottom: 1.5rem;
}

.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.contact-row .icon {
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 0.15rem;
}

.contact-row .icon svg {
  width: 100%;
  height: 100%;
}

.contact-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.contact-row strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.15rem;
}

/* ============================================
   FORMS
   ============================================ */
.contact-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  width: 100%;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 110, 75, 0.15);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ============================================
   POLICY PAGES (Privacy, Terms, etc.)
   ============================================ */
.policy-page {
  padding-block: 4rem;
}

.policy-content {
  max-width: 760px;
  margin-inline: auto;
}

.policy-content h1 {
  margin-bottom: 0.5rem;
}

.policy-content .last-updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.policy-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.policy-content h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.policy-content p,
.policy-content li {
  color: var(--muted);
  line-height: 1.75;
}

.policy-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.policy-content ul li {
  list-style: disc;
  margin-bottom: 0.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: #2C231D;
  color: rgba(244, 239, 230, 0.8);
  padding-block: 4rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-family: var(--font-heading);
  color: #F4EFE6;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

.footer-col p {
  color: rgba(244, 239, 230, 0.65);
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col ul li a {
  color: rgba(244, 239, 230, 0.7);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: var(--primary);
}

.footer-brand .logo {
  color: #F4EFE6;
  display: inline-block;
  margin-bottom: 1rem;
}

.footer-bottom {
  border-top: 1px solid rgba(244, 239, 230, 0.1);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.footer-bottom p {
  color: rgba(244, 239, 230, 0.5);
  font-size: 0.85rem;
  margin-bottom: 0;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  color: rgba(244, 239, 230, 0.5);
  font-size: 0.85rem;
}

.footer-bottom-links a:hover {
  color: var(--primary);
}

/* ============================================
   COOKIE POPUP
   ============================================ */
.cookie-popup {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  border: 1px solid rgba(133, 118, 104, 0.15);
  transition: transform var(--transition), opacity var(--transition);
}

.cookie-popup.hidden {
  display: none;
}

.cookie-popup p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.cookie-popup-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-popup-actions .btn-primary {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
}

.cookie-popup-actions .btn-secondary {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
}

/* ============================================
   ACCESSIBILITY & FOCUS
   ============================================ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.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 */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary);
  color: #F4EFE6;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  z-index: 10000;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* ============================================
   RESPONSIVE — TABLET (768px+)
   ============================================ */
@media (min-width: 768px) {
  :root {
    --container-padding: 2rem;
  }

  .section {
    padding-block: 5rem;
  }

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

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

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

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

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

  .about-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr 1.2fr;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  .cookie-popup {
    left: auto;
  }
}

/* ============================================
   RESPONSIVE — DESKTOP (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  :root {
    --container-padding: 2.5rem;
  }

  .section {
    padding-block: 6rem;
  }

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

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

  .hero-section {
    min-height: 90vh;
    padding: 8rem 0 5rem;
  }

  .hero-subtitle {
    font-size: 1.3rem;
  }

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

  .about-grid {
    gap: 4rem;
  }
}

/* ============================================
   PREFERS 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;
  }

  html {
    scroll-behavior: auto;
  }

  .card:hover,
  .service-card:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .cta-button:hover,
  .form-submit:hover {
    transform: none;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .header,
  .footer,
  .cookie-popup,
  .mobile-menu-toggle,
  .cta-section {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  .section {
    padding-block: 2rem;
  }
}