@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800;900&family=Changa:wght@600;700;800&display=swap");

:root {
  --primary: #102233;
  --secondary: #1d3d56;
  --teal: #1f7a7a;
  --accent: #c99742;
  --accent-soft: #e7d7b5;
  --sunset: #da6f49;
  --light: #f4f1ea;
  --paper: #fffdf7;
  --white: #ffffff;
  --text: #203040;
  --muted: #5b6b78;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-soft: 0 20px 48px rgba(16, 34, 51, 0.14);
  --shadow-strong: 0 26px 64px rgba(16, 34, 51, 0.2);
}

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

body {
  font-family: "Cairo", sans-serif;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(
      circle at 10% 8%,
      rgba(201, 151, 66, 0.12),
      transparent 32%
    ),
    radial-gradient(
      circle at 92% 0%,
      rgba(31, 122, 122, 0.16),
      transparent 30%
    ),
    var(--paper);
  overflow-x: hidden;
}

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

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

/* Shared Header */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1300;
  background: rgba(12, 24, 36, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transition: all 0.28s ease;
}

header.header-scrolled {
  background: rgba(12, 24, 36, 0.95);
  box-shadow: 0 12px 24px rgba(7, 14, 21, 0.24);
}

.navbar {
  width: min(1300px, 92%);
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Changa", sans-serif;
  color: var(--accent-soft);
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  white-space: nowrap;
}

.logo i {
  color: var(--accent);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  position: relative;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -7px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #f0cf91);
  transition: width 0.28s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Projects Listing Page */
.projects-hero {
  margin-top: 78px;
  min-height: 46vh;
  display: grid;
  place-items: center;
  padding: 4rem 5% 3.4rem;
  text-align: center;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(13, 27, 40, 0.94), rgba(22, 55, 74, 0.8)),
    url("https://images.unsplash.com/photo-1503387762-592deb58ef4e?auto=format&fit=crop&w=2200&q=80")
      center/cover;
  position: relative;
  overflow: hidden;
}

.projects-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 20% 78%,
    rgba(218, 111, 73, 0.28),
    transparent 34%
  );
}

.projects-hero-content {
  width: min(900px, 100%);
  position: relative;
  z-index: 1;
}

.hero-chip {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.9rem;
  font-size: 0.86rem;
  margin-bottom: 0.9rem;
}

.projects-hero h1 {
  font-family: "Changa", sans-serif;
  font-size: clamp(2rem, 5.5vw, 3.7rem);
  margin-bottom: 0.7rem;
  line-height: 1.2;
}

.projects-hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
}

.projects-listing {
  padding: 3rem 5% 5rem;
}

.projects-toolbar {
  width: min(1260px, 100%);
  margin: 0 auto 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.projects-toolbar h2 {
  font-family: "Changa", sans-serif;
  color: var(--primary);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.projects-toolbar p {
  color: var(--muted);
  font-weight: 600;
}

.projects-grid {
  width: min(1260px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.project-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(16, 34, 51, 0.1);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.34s ease,
    box-shadow 0.34s ease,
    border-color 0.34s ease;
  opacity: 0;
  transform: translateY(26px);
}

.project-card.show {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(201, 151, 66, 0.45);
}

.project-image {
  height: 220px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 22, 33, 0.84), transparent 55%);
  display: flex;
  align-items: flex-end;
  padding: 0.95rem;
}

.project-overlay h4 {
  color: #f6dba7;
  margin-bottom: 0.18rem;
}

.project-overlay p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
}

.project-info {
  padding: 1rem;
}

.project-info h3 {
  font-family: "Changa", sans-serif;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.project-info > p {
  color: #4c5d6a;
  font-size: 0.93rem;
  margin-bottom: 0.7rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.project-meta span {
  border-radius: 999px;
  background: rgba(16, 34, 51, 0.08);
  color: #374b5a;
  padding: 0.22rem 0.58rem;
  font-size: 0.83rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
}

.project-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(130deg, #f2cd88, var(--accent));
  color: #1f2e3d;
  padding: 0.56rem 1rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition:
    transform 0.24s ease,
    filter 0.24s ease;
}

.project-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.projects-pagination {
  width: min(1260px, 100%);
  margin: 1.6rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.page-btn {
  border: 1px solid rgba(16, 34, 51, 0.2);
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: all 0.22s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: rgba(201, 151, 66, 0.5);
  transform: translateY(-2px);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#page-numbers {
  font-weight: 700;
  color: var(--muted);
}

/* Project Detail Page */
.project-view-hero {
  margin-top: 78px;
  padding: 3.2rem 5% 2.3rem;
  background:
    linear-gradient(145deg, rgba(15, 34, 51, 0.94), rgba(23, 66, 92, 0.82)),
    url("https://images.unsplash.com/photo-1431576901776-e539bd916ba2?auto=format&fit=crop&w=2200&q=80")
      center/cover;
  color: var(--white);
}

.project-view-hero-content {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.9rem;
  margin-bottom: 0.85rem;
}

.project-view-hero h1 {
  font-family: "Changa", sans-serif;
  font-size: clamp(1.8rem, 4.6vw, 3rem);
  margin-bottom: 0.4rem;
}

.project-view-hero p {
  color: rgba(255, 255, 255, 0.9);
}

.project-shell {
  padding: 1.4rem 5% 4rem;
}

.project-detail-layout {
  width: min(1260px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.1rem;
  align-items: start;
}

.project-gallery,
.project-details-card {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(16, 34, 51, 0.09);
  box-shadow: var(--shadow-soft);
}

.project-gallery {
  padding: 0.9rem;
}

.main-image-wrap {
  position: relative;
}

.main-image {
  width: 100%;
  height: clamp(300px, 50vw, 460px);
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 8px);
  transition: opacity 0.3s ease;
}

.image-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(10, 20, 30, 0.45);
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.24s ease;
}

.image-arrow:hover {
  background: rgba(10, 20, 30, 0.72);
}

.image-arrow.prev {
  right: 12px;
}

.image-arrow.next {
  left: 12px;
}

.thumbs-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.thumb-btn {
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.72;
  transition: all 0.24s ease;
  background: transparent;
}

.thumb-btn img {
  width: 100%;
  height: 74px;
  object-fit: cover;
}

.thumb-btn.active {
  border-color: var(--accent);
  opacity: 1;
}

.project-details-card {
  padding: 1.3rem;
}

.project-title {
  font-family: "Changa", sans-serif;
  color: var(--primary);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 0.3rem;
}

.project-subtitle {
  color: var(--sunset);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.project-description {
  color: #4b5b68;
  margin-bottom: 0.9rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.project-tag {
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: rgba(16, 34, 51, 0.08);
  color: #2f4252;
  font-size: 0.83rem;
  font-weight: 700;
}

.project-specs {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.project-specs li {
  color: #415263;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed rgba(16, 34, 51, 0.15);
  padding-bottom: 0.35rem;
}

.project-specs span {
  color: var(--sunset);
  font-weight: 700;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  border-radius: 999px;
  background: linear-gradient(130deg, var(--teal), #2f8f95);
  color: var(--white);
  padding: 0.62rem 1.2rem;
  font-weight: 700;
}

.related-section {
  padding: 0 5% 4rem;
}

.related-header {
  width: min(1260px, 100%);
  margin: 0 auto 1rem;
}

.related-header h2 {
  font-family: "Changa", sans-serif;
  color: var(--primary);
}

.related-grid {
  width: min(1260px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* Shared Footer */
footer {
  background: linear-gradient(155deg, #0f2233 0%, #132b40 45%, #1c4a5c 100%);
  color: var(--white);
  padding: 4.3rem 5% 2rem;
}

.footer-content {
  width: min(1260px, 100%);
  margin: 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1rem;
}

.footer-logo {
  font-family: "Changa", sans-serif;
  color: #f6dba8;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  margin-bottom: 0.45rem;
}

.footer-text {
  color: rgba(255, 255, 255, 0.86);
}

.footer-title {
  font-family: "Changa", sans-serif;
  margin-bottom: 0.45rem;
  color: #f6dba8;
}

.footer-links,
.footer-contact {
  list-style: none;
  display: grid;
  gap: 0.42rem;
}

.footer-links a,
.footer-contact li {
  color: rgba(255, 255, 255, 0.85);
}

.social-links {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.5rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.24s ease;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-3px);
}

.copyright {
  margin-top: 1.8rem;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.73);
}

/* Responsive */
@media (max-width: 1100px) {
  .projects-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-detail-layout {
    grid-template-columns: 1fr;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 78px;
    right: -100%;
    width: min(340px, 100%);
    height: calc(100vh - 78px);
    padding: 1.4rem;
    background: rgba(12, 24, 36, 0.97);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    transition: right 0.3s ease;
  }

  .nav-menu.active {
    right: 0;
  }

  .projects-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .thumbs-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .projects-grid,
  .related-grid,
  .footer-main,
  .thumbs-row {
    grid-template-columns: 1fr;
  }

  .project-overlay p,
  .projects-hero p,
  .project-view-hero p {
    font-size: 0.95rem;
  }

  .projects-pagination {
    flex-wrap: wrap;
  }
}
