:root {
  --portfolio-bg: #f6f8ff;
  --portfolio-surface: rgba(255, 255, 255, 0.7);
  --portfolio-surface-strong: #ffffff;
  --portfolio-border: rgba(148, 163, 184, 0.2);
  --portfolio-border-strong: rgba(99, 102, 241, 0.18);
  --portfolio-text: #111827;
  --portfolio-muted: #475569;
  --portfolio-soft: #f8fafc;
  --portfolio-primary: #5046e5;
  --portfolio-primary-2: #6c63ff;
  --portfolio-primary-soft: rgba(80, 70, 229, 0.08);
  --portfolio-accent: #22c55e;
  --portfolio-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --portfolio-radius-xl: 28px;
  --portfolio-radius-lg: 22px;
  --portfolio-radius-md: 16px;
  --portfolio-radius-sm: 12px;
}

.portfolio-detail {
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(108, 99, 255, 0.12), transparent 18%),
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.10), transparent 16%),
    linear-gradient(180deg, var(--portfolio-bg) 0%, #f3f6ff 100%);
}

.portfolio-shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3.2rem, 6vw, 6rem) clamp(1rem, 2vw, 2rem) 4rem;
  direction: rtl;
}

.portfolio-breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--portfolio-muted);
  font-size: 0.82rem;
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.breadcrumb-list li:not(:last-child)::after {
  content: "/";
  color: rgba(100, 116, 139, 0.7);
}

.breadcrumb-list a {
  color: var(--portfolio-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-list a:hover {
  color: var(--portfolio-primary);
}

.portfolio-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 3vw, 2.2rem);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--portfolio-border);
  border-radius: var(--portfolio-radius-xl);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 248, 255, 0.84));
  box-shadow: var(--portfolio-shadow);
  padding: clamp(1.2rem, 2.5vw, 2.2rem);
}

.portfolio-hero__inner {
  display: contents;
}

.portfolio-hero__content {
  position: relative;
  z-index: 1;
}

.portfolio-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: var(--portfolio-primary-soft);
  color: var(--portfolio-primary);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portfolio-hero__eyebrow::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #8b5cf6);
  box-shadow: 0 0 0 0.16rem rgba(79, 70, 229, 0.12);
}

.portfolio-hero__title {
  margin: 0;
  color: var(--portfolio-text);
  font-family: "Morabba", "Dana", sans-serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.portfolio-hero__description {
  margin: 1rem 0 0;
  max-width: 680px;
  color: var(--portfolio-muted);
  font-size: 1.02rem;
  line-height: 2;
}

.portfolio-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.portfolio-hero__tags span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--portfolio-text);
  font-size: 0.76rem;
  font-weight: 600;
}

.portfolio-hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.portfolio-hero__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.portfolio-hero__actions a:hover {
  transform: translateY(-2px);
  filter: brightness(1.02);
}

.portfolio-hero__primary {
  background: linear-gradient(135deg, var(--portfolio-primary), var(--portfolio-primary-2));
  color: #fff;
  box-shadow: 0 18px 32px rgba(80, 70, 229, 0.25);
}

.portfolio-hero__secondary {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.9);
  color: var(--portfolio-text);
}

.portfolio-hero__media {
  position: relative;
}

.portfolio-hero__frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 360px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(96, 165, 250, 0.04));
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
}

.portfolio-hero__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 22%, rgba(15, 23, 42, 0.05));
  pointer-events: none;
}

.portfolio-hero__frame img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.portfolio-hero__badge {
  position: absolute;
  left: 1.2rem;
  bottom: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 46px;
  padding: 0.65rem 0.95rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--portfolio-primary), var(--portfolio-primary-2));
  box-shadow: 0 16px 26px rgba(79, 70, 229, 0.28);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.summary-card {
  padding: 1.1rem 1.1rem 1rem;
  border: 1px solid var(--portfolio-border);
  border-radius: var(--portfolio-radius-lg);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.04);
}

.summary-card span {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--portfolio-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.summary-card strong {
  color: var(--portfolio-text);
  font-size: 1.05rem;
  font-weight: 800;
}

.portfolio-main {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.92fr);
  gap: 1.7rem;
  margin-top: 2rem;
}

.portfolio-story {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.project-panel {
  border: 1px solid var(--portfolio-border);
  border-radius: var(--portfolio-radius-xl);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.04);
  padding: clamp(1.1rem, 2vw, 1.6rem);
}

.project-panel--soft {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.7));
}

.project-panel--sidebar {
  padding: 1.15rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--portfolio-primary);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-kicker::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #8b5cf6);
}

.panel-header h2 {
  margin: 0;
  color: var(--portfolio-text);
  font-family: "Morabba", "Dana", sans-serif;
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.35;
}

.story-copy {
  color: #334155;
  font-size: 1rem;
  line-height: 2.05;
}

.story-copy p {
  margin: 0 0 1rem;
}

.story-copy p:last-child {
  margin-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(80, 70, 229, 0.12), rgba(96, 165, 250, 0.12));
  border: 1px solid rgba(80, 70, 229, 0.15);
  color: var(--portfolio-primary);
  font-size: 1rem;
  font-weight: 800;
}

.section-kicker {
  margin: 0;
  color: var(--portfolio-primary);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0.2rem 0 0;
  color: var(--portfolio-text);
  font-family: "Morabba", "Dana", sans-serif;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.3;
}

.challenge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.7fr);
  gap: 1rem;
}

.challenge-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem;
}

.challenge-pills span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.8);
  color: var(--portfolio-text);
  font-size: 0.76rem;
  font-weight: 700;
}

.solution-stack {
  display: grid;
  gap: 1rem;
}

.solution-card {
  padding: 1.2rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.82));
}

.solution-card h3 {
  margin: 0 0 0.9rem;
  color: var(--portfolio-text);
  font-size: 1.05rem;
  font-weight: 800;
}

.gallery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(180px, 0.8fr);
  gap: 1rem;
}

.gallery-feature,
.gallery-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(248, 250, 252, 0.9);
  cursor: pointer;
  box-shadow: 0 20px 32px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-feature:hover,
.gallery-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 38px rgba(15, 23, 42, 0.1);
}

.gallery-feature img,
.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-feature {
  min-height: 420px;
}

.gallery-rail {
  display: grid;
  grid-template-rows: repeat(2, minmax(120px, 1fr));
  gap: 0.9rem;
}

.gallery-thumb {
  min-height: 120px;
}

.gallery-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.7);
}

.gallery-empty p {
  margin: 0;
  color: var(--portfolio-muted);
  font-weight: 600;
}

.portfolio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
}

.portfolio-lightbox.hidden {
  display: none;
}

.lightbox-back,
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.7rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-back:hover,
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.lightbox-back {
  left: 5.5rem;
}

.lightbox-close {
  left: 1.25rem;
}

.lightbox-content {
  width: min(100%, 960px);
}

.lightbox-content img {
  display: block;
  width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.2);
}

body.lightbox-open {
  overflow: hidden;
}

.portfolio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.portfolio-meta-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.portfolio-meta-card > .flex {
  margin-bottom: 1rem;
}

.portfolio-meta-card h3,
.portfolio-meta-card h4,
.portfolio-meta-card h5 {
  margin: 0;
  color: var(--portfolio-text);
}

.portfolio-meta-card h4 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--portfolio-muted);
  text-transform: uppercase;
}

.portfolio-meta-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.portfolio-meta-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 0.75rem;
  margin: 0;
  padding-top: 0.5rem;
}

.portfolio-meta-card dl div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.portfolio-meta-card dl div.col-span-2 {
  grid-column: 1 / -1;
}

.portfolio-meta-card dt {
  color: var(--portfolio-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.portfolio-meta-card dd {
  margin: 0;
  color: var(--portfolio-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.portfolio-meta-card dd a {
  color: var(--portfolio-primary);
  text-decoration: none;
}

.portfolio-meta-card .mt-5 {
  margin-top: 1.15rem;
}

.portfolio-meta-card .mt-3 {
  margin-top: 0.8rem;
}

.portfolio-meta-card .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.portfolio-meta-card .grid > div {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.7);
}

.portfolio-meta-card .w-7 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(96, 165, 250, 0.12));
  color: var(--portfolio-primary);
  font-size: 0.72rem;
  font-weight: 800;
}

.related-projects {
  width: 100%;
}

.related-projects h3 {
  margin: 0 0 1rem;
  color: var(--portfolio-text);
  font-size: 1.05rem;
  font-weight: 800;
}

.related-projects .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.related-projects article {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-projects article:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(15, 23, 42, 0.08);
}

.related-projects a {
  display: block;
  text-decoration: none;
}

.related-projects img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.related-projects .p-4 {
  padding: 0.95rem 1rem 1rem;
}

.related-projects h4 {
  margin: 0;
  color: var(--portfolio-text);
  font-size: 1rem;
  font-weight: 800;
}

.related-projects p {
  margin: 0.5rem 0 0;
  color: var(--portfolio-muted);
  font-size: 0.8rem;
  line-height: 1.8;
}

.project-nav {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.76rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--portfolio-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-link:hover {
  transform: translateY(-2px);
  border-color: rgba(80, 70, 229, 0.3);
  box-shadow: 0 14px 26px rgba(80, 70, 229, 0.08);
}

.btn-link--next {
  margin-right: auto;
}

.portfolio-cta {
  margin-top: 2rem;
}

.cta-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.2rem, 2vw, 1.8rem);
  border: 1px solid rgba(80, 70, 229, 0.18);
  border-radius: var(--portfolio-radius-xl);
  background: linear-gradient(135deg, rgba(80, 70, 229, 0.08), rgba(108, 99, 255, 0.03), rgba(255, 255, 255, 0.9));
  box-shadow: 0 20px 38px rgba(80, 70, 229, 0.06);
}

.cta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--portfolio-primary);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cta-card h3 {
  margin: 0;
  color: var(--portfolio-text);
  font-family: "Morabba", "Dana", sans-serif;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.5;
}

.cta-card p {
  margin: 0;
  max-width: 500px;
  color: var(--portfolio-muted);
  line-height: 1.9;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.82rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--portfolio-primary), var(--portfolio-primary-2));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 18px 32px rgba(80, 70, 229, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 38px rgba(80, 70, 229, 0.28);
}

@media (max-width: 980px) {
  .portfolio-hero {
    grid-template-columns: 1fr;
  }

  .portfolio-main {
    grid-template-columns: 1fr;
  }

  .portfolio-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .portfolio-shell {
    padding-inline: 0.8rem;
  }

  .portfolio-summary {
    grid-template-columns: 1fr;
  }

  .cta-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .portfolio-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .portfolio-hero__actions a,
  .btn-link,
  .cta-button {
    width: 100%;
  }

  .project-nav {
    flex-direction: column;
  }

  .btn-link--next {
    margin-right: 0;
  }
}
