/* Fonts & Base */
:root {
  --green-900: #0f3d2e;
  --green-800: #144837;
  --green-700: #1f5c45;
  --green-500: #2e7b5e;
  --silver: #c0c0c0;
  --grey-100: #f7f8fa;
  --grey-200: #f1f2f4;
  --grey-300: #e5e7eb;
  --grey-600: #6b7280;
  --text: #202225;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  /* Accent gradient for subtle text effects */
  --accent-gradient: linear-gradient(90deg, #2e7b5e 0%, #1f5c45 50%, #2e7b5e 100%);
  /* Default underline gradient for section headings */
  --underline-gradient: linear-gradient(90deg, var(--green-500), var(--green-900));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--grey-100);
  overflow-x: hidden; /* prevent accidental horizontal scroll on mobile */
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--green-900);
  margin: 0 0 12px 0;
}
p { line-height: 1.7; color: #2a2d31; }

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.section {
  padding: 80px 0;
  position: relative;
  scroll-margin-top: 88px; /* account for sticky header */
}

.section-header { text-align: center; max-width: 820px; margin: 0 auto 32px; }
.section-header p { color: #3b3f45; }
.section-header .sub { color: var(--green-700); font-weight: 600; }
/* Decorative gradient underline for section headings */
.section-header h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px; /* slightly thicker for visibility */
  margin: 8px auto 0;
  background: var(--underline-gradient);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

/* Header / Topbar */
.site-header { position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4%;
  background: linear-gradient(180deg, #ffffff, #f6f7f9);
  border-bottom: 1px solid var(--grey-300);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { height: 75px; width: auto; object-fit: contain; }
.topbar-text { color: #444c52; font-size: 14px; }

.nav { display: flex; align-items: center; gap: 18px; }
.nav-link { color: var(--green-800); text-decoration: none; font-weight: 600; padding: 10px 14px; border-radius: 8px; transition: transform .2s, background .2s, color .2s; }
.nav-link:hover { background: var(--grey-200); transform: translateY(-1px); }
.cta-link { background: var(--green-700); color: white; }
.cta-link:hover { background: var(--green-500); }

.menu-toggle { display: none; font-size: 22px; background: transparent; border: none; color: var(--green-900); padding: 8px; border-radius: 8px; }
.menu-toggle:focus { outline: 2px solid var(--green-500); }
/* Smooth transform + micro-pop for hamburger → X */
.menu-toggle { transition: transform .22s ease, color .2s ease; }
.menu-toggle.open { transform: rotate(90deg) scale(1.05); animation: menuPop .24s ease; }
.menu-toggle:not(.open) { animation: menuPopOut .24s ease; }
/* Brand name link styles */
.brand-name { color: var(--green-900); font-weight: 700; text-decoration: none; font-size: 17px; }
.brand-name:hover { text-decoration: underline; }

/* Hero */
.hero { min-height: 91vh; min-height: 91svh; min-height: 92dvh; width: 100%; padding: 0; overflow: hidden; display: grid; align-items: center; justify-items: center; }
.hero-bg { position: absolute; inset: 0; z-index: -2; filter: saturate(1.05) contrast(1.05) brightness(1.02); }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.hero-overlay { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(800px 800px at var(--mx, 50%) var(--my, 40%), rgba(46,123,94,0.10), transparent 60%),
  linear-gradient(180deg, rgba(255,255,255,0.25), rgba(247,248,250,0.45));
}

.hero-content { text-align: center; width: 100%; }
.hero-title {
  font-size: clamp(32px, 6vw, 56px);
  letter-spacing: 0.2px;
  /* Fallback color */
  color: var(--green-900);
  /* Subtle animated gradient accent */
  background-image: var(--accent-gradient);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 14s ease-in-out infinite alternate;
  text-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.hero-subtitle { max-width: 780px; margin: 0 auto 28px; color: #33383e; }

.btn { display: inline-block; padding: 12px 18px; border-radius: 10px; text-decoration: none; font-weight: 600; transition: transform .2s, box-shadow .2s, background .2s; }
.btn-primary { background: var(--green-700); color: white; box-shadow: 0 6px 18px rgba(31,92,69,0.25); }
.btn-primary:hover { transform: translateY(-2px); background: var(--green-500); box-shadow: 0 10px 24px rgba(31,92,69,0.28); }
.btn-secondary { background: #e9ecef; color: #1c2025; }
.btn-secondary:hover { background: #dfe3e7; transform: translateY(-1px); }

/* Profile Feature */
.profile-feature { background: #ffffff; }
.profile-feature .container { display: flex; justify-content: center; }
.profile-feature .profile-photo { width: min(820px, 92%); height: auto; border-radius: 16px; border: 1px solid var(--grey-300); box-shadow: var(--shadow); }
/* Practice Areas */
.practice { background-image: url('images/background.jpg'); background-size: cover; background-position: center; }
.practice.parallax { background-attachment: fixed; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.practice .section-header h2 { color: #ffffff; font-size: clamp(32px, 5vw, 48px); }
.practice .section-header p { color: #eef2f7; font-size: clamp(16px, 2.2vw, 20px); }
/* Use a light underline on dark sections for contrast */
.practice .section-header,
.contact .section-header { --underline-gradient: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(238,242,247,0.95)); }
/* Subtle dark overlay for readability over background */
.practice::before { content: ""; position: absolute; inset: 0; background: rgba(16, 24, 40, 0.50); z-index: 0; pointer-events: none; }
.practice .section-header h2, .practice .section-header p { text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.practice .container, .practice .section-header, .practice .cards { position: relative; z-index: 1; }
.card { background: white; border: 1px solid var(--grey-300); border-radius: 6px; padding: 24px; box-shadow: 0 6px 18px rgba(0,0,0,0.05); transition: transform .2s, box-shadow .2s; height: 100%; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,0.08); }
.card h3 { text-align: center; margin-bottom: 8px; font-size: clamp(22px, 2.4vw, 28px); min-height: 60px; display: flex; align-items: center; justify-content: center; }
.card .sub { color: var(--green-700); font-weight: 600; text-align: center; margin: 4px 0 16px; min-height: 72px; display: flex; align-items: center; justify-content: center; }
.card p { margin: 12px 0; }
.card .list { margin: 12px 0; padding-left: 18px; }
.card .list li { margin: 8px 0; }
.list { margin: 12px 0; padding-left: 24px; list-style-type: disc; list-style-position: outside; }
.list li { margin: 8px 0; line-height: 1.7; }

/* About & Meet */
.about { background: linear-gradient(180deg, #ffffff, #f8f9fb); }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; align-items: start; gap: 28px; }
.meet-photo img { width: 100%; border-radius: 18px; border: 1px solid var(--grey-300); box-shadow: var(--shadow); }
/* Banded styling for About Southwind intro only (full-width) */
.about { padding: 0; }
.about-intro, .about-meet { padding: 80px 0; }
.about-intro { background: linear-gradient(180deg, var(--green-800), var(--green-700)); }
.about-intro .section-header h2 { color: #f3faf7; }
.about-intro .section-header p { color: #e6f5ee; }
/* Ensure underline is visible on dark About intro background */
.about-intro .section-header { --underline-gradient: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(238,242,247,0.95)); }
/* Larger headings for About and Meet */
.about-intro .section-header h2, .about-meet .meet-text h3 { font-size: clamp(36px, 5.6vw, 56px); }
/* Video styling in About section */
.about .meet-photo video { width: 100%; display: block; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.carousel { position: relative; width: 72%; margin: 0 auto; overflow: hidden; }
.carousel-track { display: flex; height: auto; transition: transform .4s ease; }
.carousel-slide { width: 100%; flex: 0 0 100%; position: relative; border: 1px solid var(--grey-300); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.carousel-slide img, .carousel-slide video { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; }
.carousel-controls { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.carousel-btn { background: #ffffff; border: 1px solid var(--grey-300); border-radius: 12px; padding: 8px 14px; font-size: 18px; cursor: pointer; color: var(--green-900); box-shadow: var(--shadow); }
.carousel-btn:hover { background: #f7f8fa; }
.about .ig-caption { text-align: center; margin: 8px 0 12px; font-weight: 600; color: var(--green-900); }
.about .ig-caption a { color: var(--green-800); font-weight: 700; text-decoration: none; }
.about .ig-caption a:hover { text-decoration: underline; }

/* Social */
.social { text-align: center; }
.reel { display: inline-flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--grey-300); box-shadow: var(--shadow); text-decoration: none; color: var(--green-900); transition: transform .2s, box-shadow .2s; }
.reel:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,0.08); }
.reel video { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; }
.handle { font-weight: 700; }

/* Contact */
.contact { background-image: url('images/background.jpg'); background-size: cover; background-position: center; }
.contact.parallax { background-attachment: fixed; }
.contact::before { content: ""; position: absolute; inset: 0; background: rgba(16, 24, 40, 0.50); z-index: 0; pointer-events: none; }
.contact .container, .contact .section-header, .contact .contact-grid { position: relative; z-index: 1; }
.contact-grid { grid-template-columns: 1.2fr 0.8fr; grid-template-areas: "map details"; }
.contact-grid .map-embed { grid-area: map; }
.contact-grid .contact-details { grid-area: details; }
.contact-form { background: white; border: 1px solid var(--grey-300); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.contact-form label { display: grid; gap: 8px; margin-bottom: 12px; font-weight: 600; color: var(--green-900); }
.contact-form input, .contact-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--grey-300);
  background: #fbfbfc;
  transition: border-color .2s, box-shadow .2s, transform .08s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(46,123,94,0.18); }
.contact-form input:active, .contact-form textarea:active { transform: scale(0.995); }
.form-note { font-size: 14px; color: #4b5056; }
.contact-details { align-self: start; }
.contact-details ul { list-style: none; padding: 0; margin: 0 0 16px; }
.contact-details li { margin: 8px 0; }
.contact-details a { color: var(--green-800); text-decoration: none; font-weight: 600; }
.contact-details a:hover { text-decoration: underline; }
/* Contact heading sizing */
.contact .section-header h2 { font-size: clamp(36px, 5vw, 54px); color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.contact .section-header .sub { font-size: clamp(18px, 2.6vw, 24px); font-weight: 700; color: #eef2f7; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
/* Reduce gap between About and Contact */
.about-meet { padding-bottom: 48px; }
.section.contact { padding-top: 48px; }
/* Embedded map styling */
.map-embed { border: 1px solid var(--green-500); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); height: 260px; }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
/* Make contact details match map container height and styling */
.contact-details {
  align-self: start;
  background: #ffffff;
  border: 1px solid var(--green-500);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  height: 260px;
  display: block; /* top-align content, no vertical centering */
}
/* Bullet-style icons with hanging indent alignment */
.contact-details ul.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-details ul.contact-list li { display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; align-items: start; margin: 10px 0; }
.contact-details .icon { color: var(--green-700); font-size: clamp(20px, 2.8vw, 26px); line-height: 1.2; }
.contact-details .text { line-height: 1.7; font-size: clamp(18px, 2.4vw, 22px); }
.contact-details a { font-size: clamp(18px, 2.4vw, 22px); }

/* Footer */
.footer { padding: 28px 0; background: #f1f3f6; border-top: 1px solid var(--grey-300); }
.footer .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; max-width: none; padding: 0 4%; margin: 0; }
.footer p { margin: 0; }
.footer .credit { color: #4b5056; }
.footer a { color: var(--green-800); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Subtle heading hover effect for engagement without clutter */
h1, h2, h3 { transition: text-shadow .2s ease, color .2s ease; }
.section-header h2:hover { text-shadow: 0 2px 8px rgba(31,92,69,0.08); }

/* Body/link hover enhancements (avoid nav/button conflicts) */
.section-header a:hover,
.contact-details a:hover,
.modal-content a:hover,
.footer a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Animated gradient helper */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Responsive */
@media (max-width: 992px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* Desktop alignment tweaks */
@media (min-width: 993px) {
  .profile-feature { padding: 64px 0; }
  .profile-feature .profile-photo { width: 100%; max-width: 500px; height: auto; max-height: 78vh; }
  /* Add a bit more top margin so caption aligns visually with the Meet heading */
  .about .ig-caption { margin-top: 16px; }
}

@media (max-width: 768px) {
  /* Increase side spacing and tighten vertical spacing on mobile */
  .container { width: 88%; }
  .section { padding: 64px 0; }
  /* Remove white band above About on mobile by canceling generic section padding */
  .section.about { padding: 0; }

  .menu-toggle { display: inline-block; }
  /* Animated mobile dropdown: fade + slide + staggered items */
  .nav {
    position: absolute;
    right: 4%;
    top: 64px;
    background: #fff;
    border: 1px solid var(--grey-300);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
    flex-direction: column;
    display: flex; /* keep in DOM so transitions can run */
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, transform .24s ease, visibility 0s linear .24s;
  }
  .nav.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .nav-link { padding: 10px 12px; opacity: 0; transform: translateY(-4px); transition: opacity .22s ease, transform .22s ease; }
  .nav.open .nav-link { opacity: 1; transform: translateY(0); }
  .nav.open .nav-link:nth-child(1) { transition-delay: 60ms; }
  .nav.open .nav-link:nth-child(2) { transition-delay: 100ms; }
  .nav.open .nav-link:nth-child(3) { transition-delay: 140ms; }
  .nav.open .nav-link:nth-child(4) { transition-delay: 180ms; }
  .topbar-text { display: none; }
  /* Ensure practice area cards occupy a full row on mobile */
  .cards { grid-template-columns: 1fr; }
  /* Slightly stronger overlay on smaller screens for readability */
  .practice::before { background: rgba(16, 24, 40, 0.60); }
  /* On mobile, remove fixed heights so content flows naturally */
  .card h3, .card .sub { min-height: auto; display: block; }
  /* Ensure hero text does not touch edges on mobile */
  .hero-content { padding: 0 22px; }
  /* Footer centered on mobile */
  .footer .container { justify-content: center; flex-direction: column; gap: 6px; text-align: center; }
  /* Keep the left footer text on one line and slightly smaller */
  .footer p:first-child { font-size: 12px; white-space: nowrap; }
  /* Brand sizing on mobile */
  .brand-name { font-size: 16px; }
  .logo { height: 60px; }
  /* Modal adjustments on mobile */
  .modal-dialog { width: 94%; max-height: 84vh; padding: 18px; }
  /* Buttons and carousel tuned for mobile */
  .btn { padding: 14px 20px; font-size: 16px; }
  .carousel { width: 92%; }
  .section-header { margin: 0 auto 24px; }
  /* Center Meet the Attorney text on mobile */
  .about-meet .meet-text { text-align: center; }
  .about-meet .meet-text h3 { text-align: center; }
  /* Contact section: remove fixed heights and avoid overflow */
  .contact-grid { grid-template-columns: 1fr; grid-template-areas: "details" "map"; gap: 16px; }
  /* Enable parallax for Contact on mobile to match Practice */
  .contact.parallax { background-attachment: fixed; }
  .map-embed, .contact-details { height: auto; width: 100%; }
  .map-embed iframe { height: 220px; }
  .contact-details { padding: 12px; }
  .contact-details ul.contact-list li { grid-template-columns: 28px 1fr; }
  /* Long lines (email/address) should wrap cleanly */
  .contact-details .text, .contact-details a { overflow-wrap: anywhere; word-break: break-word; }
}

/* Small-phone breakpoint for fine-grained tweaks */
@media (max-width: 576px) {
  .hero-title { font-size: clamp(26px, 8vw, 42px); }
  .contact .section-header h2 { font-size: clamp(28px, 7vw, 42px); }
  .contact-details .text, .contact-details a { font-size: 18px; }
  .cards { gap: 18px; }
}

/* Very small phones — further tighten and shrink map/card to avoid overflow */
@media (max-width: 480px) {
  .container { width: 90%; }
  .section { padding: 56px 0; }
  .map-embed iframe { height: 180px; }
  .contact-details { padding: 10px; }
  .contact-details ul.contact-list li { grid-template-columns: 24px 1fr; margin: 8px 0; }
  .contact-details .icon { font-size: 18px; }
  .contact-details .text, .contact-details a { font-size: 16px; }
}

@media (max-width: 360px) {
  .container { width: 94%; }
  .map-embed iframe { height: 160px; }
  .contact-details { padding: 8px; }
}
/* Modal */
.modal { position: fixed; inset: 0; z-index: 2000; display: none; }
.modal.open { display: grid; align-items: center; justify-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, 0.55); backdrop-filter: blur(2px); }
.modal-dialog { position: relative; background: #ffffff; border: 1px solid var(--grey-300); border-radius: 8px; box-shadow: var(--shadow); width: min(900px, 92%); max-height: min(78vh, 78dvh); overflow: auto; padding: 24px; }
.modal-content { color: #1f2328; }
.modal-content h2 { margin: 0 0 12px; font-size: clamp(22px, 3vw, 28px); }
.modal-content h3, .modal-content h4 { margin: 18px 0 8px; }
.modal-content p, .modal-content li { line-height: 1.7; }
.modal-content ul { padding-left: 20px; }
.modal-close { position: absolute; top: 10px; right: 10px; background: #eef2f7; border: 1px solid var(--grey-300); border-radius: 8px; width: 32px; height: 32px; font-size: 20px; cursor: pointer; color: var(--green-900); }
.modal-close:hover { background: #e5edf0; }
/* Prevent video cropping in fullscreen */
.about .meet-photo video:fullscreen,
.carousel-slide video:fullscreen,
video:fullscreen {
  object-fit: contain !important;
  width: 100vw !important;
  height: 100vh !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000;
}
/* Safari/iOS fullscreen selector */
.about .meet-photo video:-webkit-full-screen,
.carousel-slide video:-webkit-full-screen,
video:-webkit-full-screen {
  object-fit: contain !important;
  width: 100vw !important;
  height: 100vh !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000;
}