:root {
  --navy: #002b4d;
  --cream: #f5f2eb;
  --gold: #c9a24d;
  --black: #000000;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

/* Preloader Styles */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--black);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

body.loading {
  overflow: hidden;
}

.hourglass {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.hourglass:after {
  content: " ";
  display: block;
  border-radius: 50%;
  width: 0;
  height: 0;
  margin: 6px;
  box-sizing: border-box;
  border: 32px solid var(--gold);
  border-color: var(--gold) transparent var(--gold) transparent;
  animation: hourglass 1.2s infinite;
}

@keyframes hourglass {
  0% {
    transform: rotate(0);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  50% {
    transform: rotate(900deg);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  100% {
    transform: rotate(1800deg);
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: var(--black);
  color: var(--white);
  line-height: 1.6;
}

a {
  color: var(--gold);
  text-decoration: none;
}

header {
  background-color: var(--black);
  padding: 0.5rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-logo {
  height: 120px;
  /* Doubled from 60px */
  object-fit: contain;
}

.branding-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--white);
  letter-spacing: 2px;
}

.brand-title {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 1px;
}

#menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 10001;
}

#menu-toggle span {
  display: block;
  width: 30px;
  height: 3px;
  background-color: var(--white);
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

#menu-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

#menu-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

nav a {
  margin-left: 2rem;
  font-weight: 500;
  color: var(--white);
  transition: color 0.3s;
}

nav a:hover,
nav a.active {
  color: var(--gold);
}

.main-hero {
  height: 80vh;
  background-image: url('hero.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  background-color: rgba(0, 0, 0, 0.4);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-title {
  font-size: 5rem;
  color: var(--gold);
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
  letter-spacing: 4px;
}


.section {
  padding: 4rem;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--gold);
  border-left: 4px solid var(--gold);
  padding-left: 1rem;
}

.practice-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.card {
  background-color: var(--navy);
  padding: 2rem;
  border-radius: 8px;
  border-top: 3px solid var(--gold);
  color: var(--white);
}

.card h3 {
  color: var(--gold);
}

.team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}

.team-member {
  text-align: center;
  background-color: var(--navy);
  padding: 2rem;
  border-radius: 8px;
  color: var(--white);
}

.portrait-container {
  width: 250px;
  /* Larger width */
  height: 350px;
  /* Rectangular aspect ratio */
  margin: 0 auto 1.5rem;
  border: 2px solid var(--gold);
  overflow: hidden;
  background-color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Contact Form Styles */
.contact-form-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gold);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background-color: var(--white);
  color: var(--gold);
  font-family: inherit;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #aaa;
}

.btn-submit {
  background-color: var(--gold);
  color: var(--black);
  padding: 1rem 2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.btn-submit:hover {
  background-color: #e0b865;
}

/* Validation Styles */
.error-message {
  color: #ff4d4d;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.input-error {
  border-color: #ff4d4d;
}

footer {
  background-color: var(--black);
  /* Bottom bit above footer seems to refer to footer itself or area above it. Keeping footer black/dark */
  padding: 3rem 4rem;
  border-top: 1px solid var(--navy);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

footer h4 {
  color: var(--gold);
}

.copyright {
  text-align: center;
  margin-top: 3rem;
  color: #aaa;
}

@media (max-width: 768px) {
  header {
    padding: 1rem 2rem;
    flex-direction: row;
    /* Keep logo and hamburger on same row */
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 0;
  }

  #menu-toggle {
    display: block;
  }

  #main-navbar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background-color: var(--black);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
    z-index: 10000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
  }

  #main-navbar.open {
    right: 0;
  }

  .nav-logo {
    height: 70px;
    /* Adjust for mobile */
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .brand-title {
    font-size: 0.7rem;
  }

  nav a {
    margin: 1.5rem 0;
    font-size: 1.2rem;
  }

  .hero-title {
    font-size: 2.2rem;
    text-align: center;
  }

  .section {
    padding: 2rem 1.5rem;
  }

  .team {
    gap: 2rem;
  }

  .team-member {
    padding: 1.5rem 1rem;
  }

  .portrait-container {
    width: 200px;
    /* Reduced to fit within small screen containers */
    height: 280px;
    max-width: 100%;
  }
}