/*
 * Styles - 120 Captains Court
 * Mobile-First Responsive Design
 */

/* ========================================
 * RESET & BASE
 * ======================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul {
  list-style: none;
}

/* ========================================
 * LAYOUT
 * ======================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding: var(--section-padding) 0;
}

.section__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-light);
  letter-spacing: var(--tracking-wide);
  text-align: center;
  margin-bottom: var(--space-4);
  color: var(--color-text-primary);
}

.section__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-10);
  line-height: var(--leading-relaxed);
}

@media (min-width: 768px) {
  .section__title {
    font-size: var(--text-3xl);
  }
}

/* ========================================
 * NAVIGATION
 * ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4);
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.nav--scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
}

.nav__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-max);
  margin: 0 auto;
}

.nav__logo img {
  height: 45px;
  width: auto;
}

.nav__links {
  display: none;
  gap: var(--space-8);
}

.nav__links a {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-white);
  transition: color var(--transition-fast);
}

.nav__links a:hover {
  color: var(--color-accent-light);
}

.nav--scrolled .nav__links a {
  color: var(--color-text-primary);
}

.nav--scrolled .nav__links a:hover {
  color: var(--color-accent);
}

@media (min-width: 768px) {
  .nav__links {
    display: flex;
  }

  .nav__logo img {
    height: 55px;
  }
}

/* ========================================
 * HERO
 * ======================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--color-white);
  background-image: url('../images/water-rendering.jpg');
  background-size: cover;
  background-position: center;
  background-color: #2a3f4d;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.2) 40%,
    rgba(0, 0, 0, 0.3) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: var(--space-4);
  max-width: 800px;
}

.hero__tagline {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-4);
  opacity: 0.9;
}

.hero__title {
  font-size: var(--text-4xl);
  font-weight: var(--font-light);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
}

.hero__subtitle {
  font-size: var(--text-xl);
  font-weight: var(--font-light);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
  opacity: 0.95;
}

.hero__location {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  opacity: 0.8;
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-white);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
  z-index: 1;
}

.hero__scroll:hover {
  opacity: 1;
}

.hero__scroll svg {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(6px);
  }
  60% {
    transform: translateY(3px);
  }
}

@media (min-width: 768px) {
  .hero__title {
    font-size: var(--text-5xl);
  }

  .hero__subtitle {
    font-size: var(--text-2xl);
  }
}

@media (min-width: 1024px) {
  .hero__title {
    font-size: var(--text-6xl);
  }
}

/* ========================================
 * STATS BAR
 * ======================================== */

.stats {
  background-color: var(--color-off-white);
  padding: var(--space-6) 0;
  overflow-x: auto;
}

.stats__container {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  min-width: max-content;
  padding: 0 var(--space-4);
}

.stat {
  text-align: center;
  white-space: nowrap;
  padding: 0 var(--space-4);
}

.stat__value {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}

.stat__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

@media (min-width: 768px) {
  .stats__container {
    gap: var(--space-16);
  }

  .stat__value {
    font-size: var(--text-3xl);
  }

  .stat__label {
    font-size: var(--text-sm);
  }
}

/* ========================================
 * GALLERY
 * ======================================== */

.gallery {
  background-color: var(--color-white);
}

.gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4/3;
  background-color: var(--color-light-gray);
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery__item:hover img {
  transform: scale(1.05);
}

.gallery__item-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: var(--color-white);
}

.gallery__item-content h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-1);
}

.gallery__item-content p {
  font-size: var(--text-sm);
  opacity: 0.9;
}

@media (min-width: 640px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
 * DETAILS / FEATURES
 * ======================================== */

.details {
  background-color: var(--color-off-white);
}

/* Download Card */
.download-card {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .download-card {
    flex-direction: row;
    text-align: left;
    padding: var(--space-6) var(--space-8);
  }
}

.download-card__icon {
  width: 56px;
  height: 56px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.download-card__icon svg {
  width: 28px;
  height: 28px;
  color: var(--color-white);
}

.download-card__content {
  flex: 1;
}

.download-card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-white);
  margin-bottom: var(--space-1);
}

.download-card__description {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  line-height: var(--leading-relaxed);
}

.download-card__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--color-white);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.download-card__btn:hover {
  background-color: var(--color-off-white);
  transform: translateY(-2px);
}

.download-card__btn svg {
  width: 18px;
  height: 18px;
}

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.feature-list {
  background-color: var(--color-white);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.feature-list h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
  color: var(--color-text-primary);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-accent);
}

.feature-list ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feature-list li {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  padding-left: var(--space-4);
  position: relative;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

@media (min-width: 768px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
 * PRICING
 * ======================================== */

.pricing {
  background-color: var(--color-white);
  text-align: center;
}

.pricing__content {
  max-width: 600px;
  margin: 0 auto;
}

.pricing__headline {
  font-size: var(--text-3xl);
  font-weight: var(--font-light);
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.pricing__subheadline {
  font-size: var(--text-xl);
  color: var(--color-accent);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-2);
}

.pricing__note {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

@media (min-width: 768px) {
  .pricing__headline {
    font-size: var(--text-4xl);
  }
}

/* ========================================
 * BUTTONS
 * ======================================== */

.btn {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
}

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

.btn--primary:hover {
  background-color: var(--color-accent-dark);
}

/* ========================================
 * CONTACT
 * ======================================== */

.contact {
  background-color: var(--color-off-white);
}

.contact__content {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.contact__card {
  background-color: var(--color-white);
  padding: var(--space-8);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.contact__agent {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.contact__company {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.contact__email,
.contact__phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-off-white);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.contact__email:hover,
.contact__phone:hover {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.contact__email svg,
.contact__phone svg {
  flex-shrink: 0;
}

.contact__builder {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

@media (min-width: 640px) {
  .contact__links {
    flex-direction: row;
    justify-content: center;
  }

  .contact__email,
  .contact__phone {
    flex: 1;
    max-width: 200px;
  }
}

/* ========================================
 * FOOTER
 * ======================================== */

.footer {
  background-color: var(--color-text-primary);
  color: var(--color-white);
  padding: var(--space-12) 0 var(--space-8);
  text-align: center;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.footer__logo {
  height: 75px;
  width: auto;
}

.footer__owner {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer__owner-name {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

.footer__owner-company {
  font-size: var(--text-sm);
  opacity: 0.8;
}

.footer__owner-email,
.footer__owner-phone {
  font-size: var(--text-sm);
  color: var(--color-white);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.footer__owner-email:hover,
.footer__owner-phone:hover {
  opacity: 1;
}

.footer__copyright {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  opacity: 0.9;
}

.footer__disclaimer {
  font-size: var(--text-xs);
  opacity: 0.6;
  max-width: 500px;
  margin: 0 auto;
}

/* ========================================
 * PAST PROJECTS SECTION
 * ======================================== */

.past-projects {
  background-color: var(--color-white);
}

.past-projects__projects {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.past-projects__project {
  background-color: var(--color-off-white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

@media (min-width: 768px) {
  .past-projects__project {
    padding: var(--space-8);
  }
}

.past-projects__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  cursor: pointer;
  user-select: none;
}

@media (min-width: 640px) {
  .past-projects__header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
  }
}

.past-projects__header:hover .past-projects__toggle {
  background-color: var(--color-light-gray);
}

.past-projects__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: transparent;
  transition: background-color var(--transition-fast), transform var(--transition-base);
  flex-shrink: 0;
}

.past-projects__toggle svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  transition: transform var(--transition-base);
}

.past-projects__project--collapsed .past-projects__toggle svg {
  transform: rotate(-90deg);
}

.past-projects__project--collapsed .past-projects__header {
  margin-bottom: 0;
}

.past-projects__header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.past-projects__header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.past-projects__title-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

@media (min-width: 640px) {
  .past-projects__title-group {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
  }
}

.past-projects__name {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

@media (min-width: 768px) {
  .past-projects__name {
    font-size: var(--text-2xl);
  }
}

.past-projects__location {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.past-projects__year {
  display: inline-block;
  background-color: var(--color-accent);
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  letter-spacing: var(--tracking-wide);
}

.past-projects__body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--transition-base);
  overflow: hidden;
}

.past-projects__project--collapsed .past-projects__body {
  grid-template-rows: 0fr;
}

.past-projects__body-inner {
  overflow: hidden;
}

.past-projects__description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  max-width: 800px;
}

.past-projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .past-projects__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .past-projects__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.past-projects__grid-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  background-color: var(--color-light-gray);
}

.past-projects__grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.past-projects__grid-item:hover img {
  transform: scale(1.08);
}

/* ========================================
 * LIGHTBOX
 * ======================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox__content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox__image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  color: var(--color-white);
  font-size: var(--text-4xl);
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
  padding: var(--space-2);
}

.lightbox__close:hover {
  opacity: 1;
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--color-white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.lightbox__prev {
  left: var(--space-4);
}

.lightbox__next {
  right: var(--space-4);
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox__counter {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-white);
  font-size: var(--text-sm);
  opacity: 0.8;
  letter-spacing: var(--tracking-wide);
}

/* Hide nav arrows on mobile (use swipe) */
@media (max-width: 639px) {
  .lightbox__prev,
  .lightbox__next {
    display: none;
  }
}
