:root {
  --brand: #00387f;
  --accent: #00a6a6;
  --text: #545454;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 24px rgba(0, 0, 0, .08);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, .06);
}

.projects-page {
  padding: 28px 16px 48px;
}

/* Header */
.p-header {
  text-align: center;
  margin-bottom: 18px;
}

.p-header h1 {
  margin: 0 0 .5rem;
  color: #1f2937;
  font-size: clamp(28px, 3vw, 36px);
}

.p-sub {
  color: var(--muted);
  max-width: 800px;
  margin: 0 auto 14px;
}

/* Filters (pills) */
.p-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.pill {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: .45rem .9rem;
  border-radius: 999px;
  font-weight: 600;
  background: #eef2f7;
  color: #334155;
  border: 1px solid #dbe3ee;
}

.pill:hover {
  background: #e6edf7;
}

.pill.is-active {
  background: #e7f9f8;
  border-color: #b1efe9;
  color: #0f766e;
}

/* Grid */
.projects-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

/* Card */

.p-card {
  border: 2px solid var(--brand);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.p-card .thumb {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 16/9;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
}

.p-card .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  transform: scale(1.07);
  transition: opacity .5s ease, transform 1.2s ease;
  will-change: opacity, transform;

}

.p-card .thumb img.active {
  opacity: 1;
  transform: scale(1);
}

.p-card .thumb .nav {
  display: none !important;
}

.p-body {
  padding: 10px;
  flex: 1;
}

.p-card .thumb .nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid #e6edf7;
  color: #0f315a;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.p-card .thumb .nav.prev {
  left: 8px
}

.p-card .thumb .nav.next {
  right: 8px
}

.p-card .thumb:hover .nav {
  display: flex
}

.p-card:hover .thumb {
  box-shadow: 0 12px 22px rgba(28, 123, 219, .12);
  border-color: color-mix(in oklab, var(--brand) 85%, white);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tag {
  background: rgba(52, 152, 219, 0.12);
  color: var(--profile-theme);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(52, 152, 219, 0.2);
  align-self: self-end;
}

.tag:hover {
  background: rgba(52, 152, 219, 0.2);
  transform: translateY(-2px);
}

/* Meta */
.p-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: #6b7280;
  border-top: 1px solid #eef2f7;
  font-size: 13px;
}

/* Footer info (reuse from home) */
.footer-info {
  margin-top: 26px;
  padding: 22px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 18px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.footer-info h4 {
  margin: .25rem 0 .35rem;
  color: #1f2937;
}

.footer-info p,
.footer-info li {
  color: #5b6472;
}

.footer-info .links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-info .links li {
  margin: .25rem 0;
}

.tiny {
  font-size: 12px;
}

.muted {
  color: #8b95a5;
}

.center {
  text-align: center;
}

/* Hover lift */
.p-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width:1024px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-info {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width:640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .footer-info {
    grid-template-columns: 1fr;
  }
}

/* === Projects: Header === */
.p-header {
  margin: 0 0 18px;
  padding: 18px 18px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e6edf7;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.p-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #4aa3ff, #00a6a6);
}

.p-header h1 {
  margin: 2px 0 8px;
  font-weight: 800;
  color: #0f315a;
  letter-spacing: .2px;
  line-height: 1.15;
  display: inline-block;
  position: relative;
}

.p-header h1::after {

  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 3px;
  width: 42%;
  border-radius: 2px;
  background: linear-gradient(90deg, #4aa3ff, #00a6a6);
  transition: width .35s ease;
}

.p-header:hover h1::after {
  width: 64%;
}


.p-sub {
  margin-top: 14px;
  color: #6b7280;
  max-width: 70ch;
}


.p-header .p-filters {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed #e6edf7;
}

/* segmented pills */
.p-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.p-filters .pill {
  appearance: none;
  border: 1px solid #e6edf7;
  background: #fff;
  color: #475569;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}

.p-filters .pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(28, 123, 219, .10);
  border-color: #d7e7ff;
  background: #f6fbff;
}

.p-filters .pill.is-active,
.p-filters .pill[aria-pressed="true"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #4aa3ff, #1c7bdb);
  box-shadow: 0 10px 18px rgba(28, 123, 219, .20);
}

/* Sticky filters */
.p-filters.sticky {
  position: sticky;
  top: 64px;
  z-index: 10;
  background: #fff;
  padding: 12px 10px;
  border-radius: 12px;
  margin-top: 14px;
  border: 1px solid #e6edf7;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .05);
}

.p-header {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .32s ease, transform .32s ease;
}

.p-header.revealed {
  opacity: 1;
  transform: none;
}

@media (max-width: 680px) {
  .p-header {
    padding: 14px 14px 10px;
  }

  .p-header h1::after {
    width: 52%;
  }
}


/* arabic-content (RTL) */
.arabic-content {
    direction: rtl;
    text-align: right;
}

.arabic-content .p-header h1 {
    text-align: right;
}

.arabic-content .p-sub {
    text-align: right;
}

.arabic-content .p-filters {
    justify-content: center;
}

.arabic-content .project-tags {
    justify-content: flex-end;
}

.arabic-content .footer-info {
    text-align: right;
}

.arabic-content .footer-info .links {
    text-align: right;
}

.arabic-content .p-header h1::after {
    right: 0;
    left: auto;
}

.arabic-content .p-meta {
    flex-direction: row-reverse;
}

.arabic-content .tag {
    align-self: self-start;
}