/* ==========================================================================
   Terra Vista Landscaping – Refined Stylesheet
   Palette: #ff5d00 (primary orange), #e65400 (button hover), #333 (headings), #000 (text)
   Neutrals: #fff (white), #f5f5f5 (light gray), #e0e0e0 (border gray)
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;            /* 16px base */
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #111;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ---------- Utility container ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- Site Header ---------- */
.site-header {
  background: #f5f5f5;
}

/* ---------- Navigation (above hero) ---------- */
.nav {
  position: relative;
  top: 0;
  left: 0;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 10;
  background: #fff;
  padding: 1rem 1.5rem;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.top-logo {
  height: 56px;
  width: auto;
  margin-right: 0.75rem;
  border-radius: 6px;
}

.nav-brand {
  font-weight: 700;
  color: #000;
  text-decoration: none;
  font-size: 1.1rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #000;
  cursor: pointer;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

.nav-links a {
  color: #000;
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus {
  background: rgba(255,93,0,0.1);
  color: #ff5d00;
}

/* ---------- HERO SECTION ---------- */
.hero {
  position: relative;
  width: 100%;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.hero-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  opacity: 0.85;
}

.hero-text {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 960px;
  text-align: center;
  color: #000;
  z-index: 3;
  padding: 0 1.5rem;
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-shadow: none;
}

.hero-text h2 {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: #333;
  margin-bottom: 1.5rem;
  text-shadow: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

.btn.primary {
  background: #e65400;
  color: #fff;
  border: none;
}

.btn.primary:hover,
.btn.primary:focus {
  background: #cc4a00;
  transform: translateY(-2px);
}

/* ---------- Section Defaults ---------- */
.about,
.services,
.projects,
.contact {
  padding: 5rem 2rem;
  max-width: 80%;
  margin: 0 auto;
}

.about h3,
.services h3,
.projects h3,
.contact h3 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  color: #ff5d00;
  margin-bottom: 2rem;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.services p,
.contact p,
.about p {
  color: #000;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  line-height: 1.8;
  max-width: none;
  margin: 0 auto 1.5rem;
}

/* Match About paragraph sizing for key blurbs */
.section-blurb,
.card-desc {
  color: #000;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  line-height: 1.8;
}

/* ---------- Service Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 1.5rem 1.75rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(255,93,0,0.15);
  transform: translateY(-4px);
}

.card h4 {
  color: #ff5d00;
  font-size: 1.35rem;
}

/* ---------- Carousel / Gallery ---------- */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
}

.carousel-track {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-item {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
}

.carousel-item img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(0,0,0,0.7);
}

.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

/* ---------- Loading Spinner Overlay ---------- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #e0e0e0;
  border-top-color: #ff5d00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-overlay p {
  margin-top: 1rem;
  color: #ff5d00;
  font-weight: 600;
  font-size: 1.1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Contact Form ---------- */
.contact form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 800px;
  margin: 0 auto;
}

.contact label {
  font-weight: 600;
  color: #ff5d00;
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.contact input,
.contact textarea {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 6px solid #ccc;
  font-size: 1.15rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact input:focus,
.contact textarea:focus {
  outline: none;
  border-color: #ff5d00;
  box-shadow: 0 0 0 3px rgba(255,93,0,0.15);
}

.contact .btn.primary {
  align-self: flex-start;
  margin-top: 0.5rem;
}

/* Phone error message: larger for visibility */
#phoneError {
  color: #ff5d00;
  font-weight: 600;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  line-height: 1.6;
  margin: 0.5rem 0 1rem 0;
  display: none;
}
#phoneError:not(:empty) {
  display: block;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem 1rem;
  text-align: center;
  background: #fafaf9;
  margin-top: 3rem;
  border-top: 1px solid #eee;
}

.footer-nav {
  margin-top: 0.75rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: #ff5d00;
}

/* ---------- Toast Notifications ---------- */
.toast {
  position: fixed;
  right: 1.5rem;
  top: 1.5rem;
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  color: #fff;
  z-index: 2000;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.success { background: #ff5d00; }
.toast.error   { background: #d32f2f; }

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

/* Large desktops (1200px+) */
@media (min-width: 1200px) {

  
  /* Hero: stack logo above text (like mobile), smaller logo */
  .hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
  }

  .hero-inner {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 2rem 0;
  }

  .hero-logo {
    position: relative;
    inset: unset;
    width: auto;
    height: auto;
    max-width: 312px;
    max-height: 250px;
    object-fit: contain;
    margin: .5rem auto 0;
  }

  .hero-text {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: none;
    background: #f5f5f5;
    padding: 1rem 1rem 1rem;
  }

  .hero-text h1 {
    font-size: 1.5rem;
    text-shadow: none;
  }

  .hero-text h2 {
    font-size: 1rem;
    text-shadow: none;
    margin-bottom: 0.75rem;
  }

  /* Hero button - larger */
    .hero-text .btn,
    .hero .btn {
      font-size: 1rem;
      padding: .45rem 1rem;
    }

  /* Sections - 65% width for better readability */
  .about,
  .services,
  .projects,
  .contact {
    padding: 1rem 4rem;
    max-width: 75%;
  }

  .contact {
    padding-top: 0.5rem;
  }

  /* Section headings - much larger */
  .about h3,
  .services h3,
  .projects h3,
  .contact h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }

  /* About text - larger */
  .services p,
  .contact p,
  .about p {
    font-size: 1rem;
    line-height: 1.8;
  }

  /* Ensure blurbs and card descriptions match About paragraph size on desktop */
  .section-blurb,
  .card-desc {
    font-size: 1.125rem;
    line-height: 1.8;
  }

  /* Services cards - larger */
  .cards {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.625rem;
  }

  .card {
    padding: 1.25rem 1.5rem;
    height: 220px;
    border: 5px solid #e0e0e0;
    display: flex;
    flex-direction: column;
  }

  .card h4 {
    font-size: 1.1rem;
  }

  /* Gallery - 75% viewport width to match other sections */
  .projects {
    max-width: 75%;
  }

  .carousel-item img {
    height: auto;
    max-height: 500px;
    object-fit: contain;
  }

  /* Desktop carousel buttons - bigger and closer to images */
  .carousel-btn {
    width: 60px;
    height: 60px;
    font-size: .5rem;
    z-index: 10;
  }

  .carousel-btn.prev { left: 0.25rem; }
  .carousel-btn.next { right: 0.25rem; }

  /* Contact form - larger */
  .contact form {
    max-width: 100%;
    gap: 0.3rem;
  }

  .contact label {
    font-size: 0.7rem;
    margin-bottom: 0.05rem;
  }

  .contact input,
  .contact textarea {
    font-size: 0.625rem;
    padding: .35rem .4375rem;
    border-width: 3px;
  }

  .contact .btn.primary {
     font-size: 1.25rem;
     padding: 0.625rem 1.25rem;
  }

  /* Navigation - 200% bigger */
  .nav-brand {
    font-size: 1.1rem;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 0.2rem 0.3rem;
  }

  .top-logo {
    height: 168px;
  }

  /* Footer - 200% bigger */
  .site-footer {
    padding: 2rem .5rem;
  }

  .site-footer small {
    font-size: 0.625rem;
  }

  .footer-nav a {
    font-size: 0.625rem;
    padding: 0.5rem 1rem;
  }

  /* Toast notifications - centered and 300% bigger */
  .toast {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    padding: 0.675rem 0.9375rem;
    border-radius: 24px;
  }
}

/* Tablets / smaller laptops */
@media (max-width: 1024px) {
  .hero { min-height: 60vh; }
  .hero-inner { min-height: 60vh; }
  .hero-text { bottom: 3rem; }
}

/* Mobile */
@media (max-width: 768px) {
  /* Nav: position for mobile with hamburger */
  .nav {
    position: relative;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .nav-links { 
    display: none; 
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255,255,255,0.98);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    width: 75vw;
    max-width: 300px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }

  .nav.open .nav-links {
    display: flex;
  }

  .nav-links a {
    color: #000;
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
  .nav-toggle { display: block; }

  /* Hero: stack logo above text */
  .hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
  }

  .hero-inner {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem;
  }

  .hero-logo {
    position: relative;
    inset: unset;
    left: auto;
    top: auto;
    transform: none;
    width: 85%;
    max-width: 320px;
    height: auto;
    max-height: none;
    object-fit: contain;
    margin: 0 auto;
  }

  /* Hero text: below logo, gray background, not overlaid */
  .hero-text {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: none;
    background: #f5f5f5;
    padding: 1.5rem 1.25rem 2rem;
    margin-top: 0;
  }

  .hero-text h1 {
    font-size: 1.25rem;
    text-shadow: none;
  }

  .hero-text h2 {
    font-size: 0.95rem;
    text-shadow: none;
    margin-bottom: 1rem;
  }

  /* Sections */
  .about,
  .services,
  .projects,
  .contact {
    padding: 1.5rem 1.25rem;
    max-width: 100%;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.25rem;
    border-width: 2px;
  }

  .card h4 {
    font-size: 1.1rem;
  }

  /* Carousel */
  .carousel {
    position: relative;
    display: flex;
    align-items: center;
  }

  .carousel-item img {
    height: auto;
    max-height: 300px;
    object-fit: contain;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    z-index: 10;
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
  }

  .carousel-btn.prev { left: 0.5rem; }
  .carousel-btn.next { right: 0.5rem; }

  /* Contact form - mobile adjustments */
  .contact form {
    gap: 0.5rem;
  }

  .contact label {
    margin-top: 0.5rem;
    margin-bottom: 0rem;
  }

  .contact input,
  .contact textarea {
    border-width: 1.5px;
  }
}

