/* ============================================================
   CSS Reset + Theme Custom Properties
   ============================================================ */

:root, [data-theme="b"] {
  --bg-primary: #f7f4ef;
  --bg-secondary: #faf8f5;
  --bg-card: #ffffff;
  --text-primary: #2d5016;
  --text-secondary: #6b6b5e;
  --accent: #4a8c2a;
  --accent-text: #ffffff;
  --accent-hover: #3d7523;
  --border-color: #e0d9cc;
  --nav-bg: #ffffff;
  --nav-text: #2d5016;
  --nav-link: #5a7a45;
  --nav-link-active: #2d5016;
  --top-bar-bg: #2d5016;
  --top-bar-text: #ffffff;
  --hero-text: #2d5016;
  --hero-subtext: #6b6b5e;
  --footer-bg: #2d5016;
  --footer-text: #ffffff;
  --divider-hill-back: #8ab06e;
  --divider-hill-mid: #5a8a3c;
  --divider-hill-front: #2d5016;
  --divider-tree-dark: #2d5016;
  --divider-tree-mid: #3a6b22;
  --divider-tree-light: #5a8a3c;
  --divider-trunk: #4a3520;
  --gallery-shadow: rgba(0,0,0,0.15);
}

[data-theme="a"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #111111;
  --bg-card: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #b8d4a8;
  --accent: #4a8c2a;
  --accent-text: #ffffff;
  --accent-hover: #5a9c3a;
  --border-color: #333333;
  --nav-bg: #1a1a1a;
  --nav-text: #ffffff;
  --nav-link: #9fcc8a;
  --nav-link-active: #ffffff;
  --top-bar-bg: #111111;
  --top-bar-text: #9fcc8a;
  --hero-text: #ffffff;
  --hero-subtext: #b8d4a8;
  --footer-bg: #111111;
  --footer-text: #9fcc8a;
  --divider-hill-back: #5a8a3c;
  --divider-hill-mid: #3a6b22;
  --divider-hill-front: #1a3a0a;
  --divider-tree-dark: #1a3a0a;
  --divider-tree-mid: #2d5016;
  --divider-tree-light: #3a6b22;
  --divider-trunk: #3d2b15;
  --gallery-shadow: rgba(0,0,0,0.5);
}

[data-theme="c"] {
  --bg-primary: #0d0d0d;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --accent: #6ec04a;
  --accent-text: #0d0d0d;
  --accent-hover: #5aad36;
  --border-color: #2a2a2a;
  --nav-bg: #0d0d0d;
  --nav-text: #e0e0e0;
  --nav-link: #6ec04a;
  --nav-link-active: #ffffff;
  --top-bar-bg: #000000;
  --top-bar-text: #6ec04a;
  --hero-text: #ffffff;
  --hero-subtext: #888888;
  --footer-bg: #000000;
  --footer-text: #6ec04a;
  --divider-hill-back: #3a6b22;
  --divider-hill-mid: #2d5016;
  --divider-hill-front: #1a3a0a;
  --divider-tree-dark: #1a3a0a;
  --divider-tree-mid: #2d5016;
  --divider-tree-light: #3a6b22;
  --divider-trunk: #3d2b15;
  --gallery-shadow: rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg-primary) url('/img/bg-forest.jpg') no-repeat center top; background-size: cover; background-attachment: fixed; color: var(--text-primary); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Content overlay for readability over background image */
.top-bar, .nav, .section, .footer { background-color: var(--bg-primary); }
.hero-section { background: transparent; }
.hero-text { background: rgba(255,255,255,0.85); padding: 2rem; border-radius: 8px; max-width: 55%; }
[data-theme="a"] .hero-text { background: rgba(26,26,26,0.9); }
[data-theme="c"] .hero-text { background: rgba(13,13,13,0.9); }

/* ============================================================
   Top Bar — URL left, phone/email right (matches sketch top)
   ============================================================ */

.top-bar {
  background: var(--top-bar-bg);
  color: var(--top-bar-text);
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.top-bar a { color: var(--top-bar-text); }

/* ============================================================
   Nav Bar — Company name + logo left, links right, line below
   (matches sketch: "Duffy's Tree Service [logo] | About | Services | Gallery | Contact")
   ============================================================ */

.nav {
  background: var(--nav-bg);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--nav-text);
  margin-right: 32px;
}
.nav-icon { height: 40px; width: auto; }
.nav-title { font-weight: bold; font-size: 18px; }
.nav-links {
  display: flex;
  gap: 0;
  margin-left: auto;
  margin-right: 16px;
}
.nav-links a {
  color: var(--nav-link);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-right: none;
  white-space: nowrap;
}
.nav-links a:last-child { border-right: 1px solid var(--border-color); }
.nav-links a:hover, .nav-links a.active { color: var(--nav-link-active); background: var(--bg-secondary); }
.nav-hamburger { display: none; background: none; border: none; color: var(--nav-text); font-size: 24px; cursor: pointer; }

/* ============================================================
   Main Content — Headline left, photos cascading right
   ============================================================ */

.hero-section {
  position: relative;
  min-height: 55rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  overflow: visible;
}

/* Left column: headline + divider */
.hero-text {
  position: relative;
  z-index: 2;
  max-width: 480px;
  padding-top: 4rem;
}
.hero-text h1 {
  font-size: 3.8rem;
  color: var(--hero-text);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}
.hero-text .subtitle {
  color: var(--hero-subtext);
  font-size: 15px;
  margin: 0.5rem 0 1.5rem;
}
.hero-text .cta-button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  padding: 12px 32px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s;
}
.hero-text .cta-button:hover { background: var(--accent-hover); color: var(--accent-text); }

/* Divider — sits below headline on the left side */
.divider-wrap {
  max-width: 800px;
  margin-top: 2rem;
  position: relative;
  z-index: 2;
}
.divider-wrap svg { width: 100%; height: auto; display: block; }

/* Photos cascading down the right side — diagonal stagger */
.cascade-photos {
  position: absolute;
  top: 0;
  right: 0;
  width: 42%;
  height: 100%;
  z-index: 1;
}
.cascade-photos .photo {
  position: absolute;
  width: 220px;
  border: 5px solid white;
  box-shadow: 0 6px 20px var(--gallery-shadow);
  border-radius: 3px;
}
.cascade-photos .photo:nth-child(1) {
  top: 3rem;
  right: 8%;
  transform: rotate(-5deg);
}
.cascade-photos .photo:nth-child(2) {
  top: 15rem;
  right: 25%;
  transform: rotate(4deg);
}
.cascade-photos .photo:nth-child(3) {
  top: 28rem;
  right: 10%;
  transform: rotate(-3deg);
}
.cascade-photos .photo:nth-child(4) {
  top: 40rem;
  right: 30%;
  transform: rotate(6deg);
}

/* ============================================================
   Content Sections (for scrolling single-page)
   ============================================================ */

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.section h2 {
  font-size: 1.8rem;
  margin: 0 0 1rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  display: inline-block;
}

/* About */
.about-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.about-text { flex: 1; font-size: 1.05rem; line-height: 1.8; }
.about-image { flex: 1; }
.about-image img { border-radius: 8px; }

/* Services */
.services-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.service-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 4px;
}
.service-item h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.service-item p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }

/* Gallery (standalone section) */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}
.gallery-grid .gallery-photo {
  width: 45%;
  border: 4px solid white;
  box-shadow: 0 4px 15px var(--gallery-shadow);
  border-radius: 4px;
  transition: transform 0.3s;
}
.gallery-grid .gallery-photo:hover { scale: 1.03; }

/* Contact */
.contact-content { text-align: center; }
.contact-content h2 { display: block; text-align: center; }
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 400px;
  margin: 2rem auto 0;
}
.contact-item { display: flex; flex-direction: column; gap: 0.25rem; }
.contact-item strong { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); }
.contact-item a { font-size: 1.1rem; }

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

.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 2rem 1.5rem;
  text-align: center;
}
.footer-content { max-width: 1100px; margin: 0 auto; }
.footer-logo { height: 60px; margin: 0 auto 1rem; }
.footer-contact { display: flex; justify-content: center; gap: 24px; margin-bottom: 1rem; }
.footer-contact a { color: var(--footer-text); }
.footer-copy { font-size: 13px; opacity: 0.7; }

/* ============================================================
   Theme Toggle
   ============================================================ */

.theme-toggle { display: flex; gap: 8px; align-items: center; }
.theme-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; outline: none; }
.theme-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch-a { background: #2d5016; }
.swatch-b { background: #f7f4ef; border-color: #ccc; }
.swatch-c { background: #0d0d0d; }
.theme-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .nav-hamburger { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    padding: 0;
    border-bottom: 2px solid var(--border-color);
  }
  .nav-links.open { display: flex; }
  .nav-links a { border: none; border-bottom: 1px solid var(--border-color); padding: 12px 24px; }
  .nav-links a:last-child { border-right: none; }
  .nav-title { font-size: 14px; }
  .top-bar { flex-direction: column; gap: 4px; text-align: center; font-size: 12px; position: sticky; top: 0; z-index: 200; }
  .nav { position: sticky; top: auto; z-index: 99; }

  .hero-section { min-height: auto; padding-bottom: 2rem; }
  .hero-text { max-width: 100%; padding-top: 2rem; }
  .hero-text h1 { font-size: 1.8rem; }
  .cascade-photos {
    position: static;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
  }
  .cascade-photos .photo {
    position: static;
    width: 85%;
  }
  .divider-wrap { max-width: 100%; }
  .about-content { flex-direction: column; }
  .services-list { grid-template-columns: 1fr; }
  .gallery-grid .gallery-photo { width: 85%; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-grid .gallery-photo { transition: none; }
  .gallery-grid .gallery-photo:hover { transform: none !important; scale: 1; }
}
