/* ================================
   CSS Reset & Base Styles
   ================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

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

ul,
ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

/* ================================
   CSS Custom Properties
   ================================ */

:root {
  /* Colors - Earthy Palette */
  --color-primary: #4A5D4F;
  --color-primary-light: #6B7F6E;
  --color-primary-dark: #3A4D3F;
  
  --color-accent: #C86F4B;
  --color-accent-hover: #B45E3A;
  --color-accent-light: #E09876;
  
  --color-bg: #FAF9F6;
  --color-bg-alt: #F4F2ED;
  --color-card: #FFFFFF;
  
  --color-text: #2D2D2D;
  --color-text-light: #5A5A5A;
  --color-text-muted: #8A8A8A;
  
  /* Spacing Scale */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 1rem;      /* 16px */
  --space-md: 1.5rem;    /* 24px */
  --space-lg: 2rem;      /* 32px */
  --space-xl: 3rem;      /* 48px */
  --space-2xl: 4rem;     /* 64px */
  --space-3xl: 6rem;     /* 96px */
  --space-4xl: 8rem;     /* 128px */
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 2rem;      /* 32px */
  --font-size-4xl: 2.5rem;    /* 40px */
  --font-size-5xl: 3.5rem;    /* 56px */
  
  --line-height-tight: 1.1;
  --line-height-snug: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Border Radius */
  --radius-sm: 0.5rem;     /* 8px */
  --radius-md: 0.75rem;    /* 12px */
  --radius-lg: 1rem;       /* 16px */
  --radius-xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --container-max-width: 1200px;
  --header-height: 80px;
}

/* ================================
   Base Typography & Layout
   ================================ */

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: var(--font-size-5xl);
  line-height: var(--line-height-tight);
}

h2 {
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-snug);
}

h3 {
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-snug);
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-light);
}

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

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

/* Section Spacing */
section {
  padding: var(--space-3xl) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-2xl);
  color: var(--color-text);
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-accent);
  color: white;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 9999;
}

.skip-link:focus {
  top: var(--space-sm);
  left: var(--space-sm);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

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

.btn-primary:active {
  transform: translateY(0);
}

/* ================================
   Header & Navigation
   ================================ */

.header {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(250, 249, 246, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(74, 93, 79, 0.1);
  z-index: 1000;
  transition: all var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
  background-color: rgba(250, 249, 246, 0.98);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  transition: opacity var(--transition-base);
}

.logo:hover {
  opacity: 0.8;
}

.logo-image {
  height: 64px;
  width: auto;
  display: block;
}

.logo-text {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.social-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-text-light);
  transition: all var(--transition-base);
  border-radius: var(--radius-sm);
}

.social-link:hover {
  color: var(--color-accent);
  background-color: rgba(200, 111, 75, 0.1);
  transform: translateY(-2px);
}

.social-link svg {
  width: 24px;
  height: 24px;
}

/* ================================
   Hero Section
   ================================ */

.hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  background-image: linear-gradient(135deg, rgba(74, 93, 79, 0.85) 0%, rgba(74, 93, 79, 0.9) 100%), url('../images/hero.avif');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: white;
  position: relative;
  overflow: hidden;
  padding: var(--space-lg) 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: var(--space-md) 0;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-md);
  color: white;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-xl);
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.rotating-text {
  color: white;
  display: inline-block;
  text-align: center;
  position: relative;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  border-bottom: 4px solid var(--color-accent);
  padding-bottom: 4px;
}

.hero .btn-primary {
  font-size: var(--font-size-lg);
  padding: var(--space-md) var(--space-xl);
}

/* ================================
   Services Section
   ================================ */

.services {
  background-color: var(--color-bg);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.service-card {
  background-color: var(--color-card);
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

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

.service-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(74, 93, 79, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.service-icon svg {
  width: 48px;
  height: 48px;
}

.service-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.service-description {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}

.service-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.topic-tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-bg-alt);
  color: var(--color-primary-dark);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.topic-tag:hover {
  background-color: var(--color-primary-light);
  color: white;
}

/* ================================
   About Section
   ================================ */

.about {
  background-color: var(--color-card);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.about-image {
  display: flex;
  justify-content: center;
}

.profile-photo {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.image-placeholder {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.image-placeholder::after {
  content: 'Photo';
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-medium);
}

.about-content {
  max-width: 600px;
}

.about-content .section-title {
  text-align: left;
  margin-bottom: var(--space-lg);
}

.about-text p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}

.credentials {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-bg-alt);
}

.credentials-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.credentials-list {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  margin-bottom: 0;
}

.credentials-list a {
  color: var(--color-accent);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-base);
}

.credentials-list a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* ================================
   Testimonials Section
   ================================ */

.testimonials {
  background-color: var(--color-bg-alt);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.testimonial-card {
  background-color: var(--color-card);
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

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

.testimonial-quote {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  font-style: italic;
  margin-bottom: var(--space-lg);
  position: relative;
}

.testimonial-quote::before {
  content: '"';
  position: absolute;
  left: -0.5em;
  top: -0.1em;
  font-size: 3em;
  color: var(--color-accent-light);
  font-family: Georgia, serif;
  line-height: 1;
  opacity: 0.3;
}

.testimonial-author {
  border-top: 1px solid var(--color-bg-alt);
  padding-top: var(--space-md);
}

.author-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.author-role {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ================================
   Contact Section
   ================================ */

.contact {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.contact-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.contact .section-title {
  color: white;
}

.contact-description {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-2xl);
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 280px));
  gap: var(--space-lg);
  justify-content: center;
  align-items: stretch;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  color: white;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  border: 1px solid rgba(255, 255, 255, 0.2);
  height: 56px;
  box-sizing: border-box;
}

.contact-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.contact-link svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ================================
   Footer
   ================================ */

.footer {
  background-color: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-xl) 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer-brand {
  order: 2;
}

.footer-text {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.footer-social {
  display: flex;
  gap: var(--space-md);
  order: 1;
}

.footer .social-link {
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.7);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
}

.footer .social-link:hover {
  color: white;
  background-color: var(--color-accent);
  transform: translateY(-2px);
}

.footer .social-link svg {
  width: 20px;
  height: 20px;
}

/* ================================
   Responsive Design - Media Queries
   ================================ */

/* Tablet and up (768px+) */
@media (min-width: 768px) {
  /* Typography adjustments */
  h1 {
    font-size: var(--font-size-5xl);
  }
  
  h2 {
    font-size: var(--font-size-4xl);
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  /* Services Grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* About Grid */
  .about-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-3xl);
  }
  
  .about-image {
    justify-content: flex-start;
  }
  
  /* Testimonials Grid */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Footer */
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  
  .footer-brand {
    order: 1;
  }
  
  .footer-social {
    order: 2;
  }
}

/* Desktop and up (1024px+) */
@media (min-width: 1024px) {
  /* Section spacing */
  section {
    padding: var(--space-4xl) 0;
  }
  
  /* Hero */
  .hero {
    min-height: 40vh;
  }
  
  .hero-title {
    font-size: var(--font-size-5xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-xl);
  }
  
  /* Services - keep 2 columns for better readability */
  .service-card {
    padding: var(--space-2xl);
  }
  
  /* Testimonials - 3 columns on large screens */
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Contact - Grid already handles layout */
  .contact-methods {
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
    margin: 0 auto;
  }
}

/* Large desktop (1440px+) - slight refinements */
@media (min-width: 1440px) {
  :root {
    --font-size-5xl: 4rem;
  }
  
  .container {
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }
}

/* Mobile-specific adjustments (under 768px) */
@media (max-width: 767px) {
  /* Reduce spacing on mobile */
  section {
    padding: var(--space-2xl) 0;
  }
  
  .section-title {
    margin-bottom: var(--space-xl);
  }
  
  .hero-title {
    font-size: 1.875rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: var(--font-size-base);
  }
  
  /* Container padding */
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  
  /* Service cards */
  .service-card {
    padding: var(--space-lg);
  }
  
  /* About section */
  .about-content .section-title {
    text-align: center;
  }
  
  /* Contact - Stack vertically on mobile */
  .contact-methods {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  
  .contact-link {
    height: 56px;
  }
  
  /* Header adjustments */
  .logo-image {
    height: 48px;
  }
  
  .social-links {
    gap: var(--space-sm);
  }
  
  .social-link {
    width: 40px;
    height: 40px;
  }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
}

/* ================================
   Focus Styles for Accessibility
   ================================ */

/* Remove default outline and add custom focus styles */
*:focus {
  outline: none;
}

/* Visible focus indicator for keyboard navigation */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.social-link:focus-visible,
.contact-link:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Special focus style for skip link */
.skip-link:focus {
  outline: 3px solid white;
  outline-offset: 2px;
}

/* ================================
   Print Styles
   ================================ */

@media print {
  .header,
  .footer,
  .skip-link {
    display: none;
  }
  
  body {
    background-color: white;
    color: black;
  }
  
  a {
    text-decoration: underline;
  }
  
  .hero {
    background: none;
    color: black;
  }
  
  .contact {
    background: none;
    color: black;
  }
}

/* ================================
   Utility Classes
   ================================ */

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

/* Prevent text selection on interactive elements */
.btn,
.social-link {
  user-select: none;
  -webkit-user-select: none;
}

/* Smooth transitions for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
