/* Portfolio page (generated by _tools/build-portfolio.js). */
:root {
  --pf-bg: #f6f7f8;
  --pf-surface: #ffffff;
  --pf-ink: #0f0f10;
  --pf-muted: #5b5f66;
  --pf-soft: #8a8f97;
  --pf-line: rgba(17, 17, 17, 0.09);
  --pf-accent: #e30613;
  --pf-accent-deep: #a8000b;
  --pf-radius: 22px;
  --pf-shadow: 0 18px 44px rgba(20, 20, 20, 0.06);
  --pf-shadow-hover: 0 26px 60px rgba(20, 20, 20, 0.12);
  --pf-container: min(1180px, 100% - 48px);
  --pf-font: "Inter", "Segoe UI", Arial, sans-serif;
  --pf-font-display: "Space Grotesk", "Inter", "Segoe UI", sans-serif;
}

html[lang="ar"] {
  --pf-font: "Tajawal", "Inter", "Segoe UI", sans-serif;
  --pf-font-display: "Tajawal", "Inter", "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--pf-bg);
  color: var(--pf-ink);
  font-family: var(--pf-font);
  -webkit-font-smoothing: antialiased;
}

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

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

h1,
h2,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 3px;
}

.pf-shell {
  width: var(--pf-container);
  margin-inline: auto;
}

.pf-main {
  padding-top: clamp(140px, 16vw, 190px);
}

/* Buttons */
.pf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.pf-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

[dir="rtl"] .pf-arrow {
  transform: scaleX(-1);
}

.pf-btn--primary {
  background: linear-gradient(135deg, #ff2b2b, var(--pf-accent-deep));
  color: #fff;
  box-shadow: 0 14px 30px rgba(227, 6, 19, 0.22);
}

.pf-btn--primary:hover,
.pf-btn--primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(227, 6, 19, 0.3);
}

.pf-btn--ghost {
  background: var(--pf-surface);
  border-color: var(--pf-line);
}

.pf-btn--ghost:hover,
.pf-btn--ghost:focus-visible {
  border-color: rgba(17, 17, 17, 0.25);
  transform: translateY(-2px);
}

/* Hero */
.pf-hero {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
}

.pf-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pf-accent);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pf-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pf-accent);
}

.pf-hero h1 {
  font-family: var(--pf-font-display);
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pf-hero p {
  max-width: 660px;
  color: var(--pf-muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.9;
}

.pf-hero .pf-actions {
  justify-content: center;
  margin-top: 6px;
}

.pf-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 860px;
  margin: clamp(40px, 6vw, 64px) auto 0;
  padding: 0;
  list-style: none;
}

.pf-metrics li {
  padding: 22px 18px;
  border: 1px solid var(--pf-line);
  border-radius: 18px;
  background: var(--pf-surface);
  text-align: center;
  box-shadow: var(--pf-shadow);
}

.pf-metrics strong {
  display: block;
  color: var(--pf-accent);
  font-family: var(--pf-font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
}

.pf-metrics span {
  display: block;
  margin-top: 8px;
  color: var(--pf-muted);
  font-weight: 700;
}

/* Project cards: logo + name + short description, linking to the client's site */
.pf-work {
  margin-top: clamp(56px, 8vw, 96px);
}

.pf-work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.pf-work-head h2 {
  font-family: var(--pf-font-display);
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 900;
  line-height: 1.1;
}

.pf-work-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(227, 6, 19, 0.16);
  border-radius: 999px;
  background: rgba(227, 6, 19, 0.07);
  color: var(--pf-accent);
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.pf-work-badge svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pf-grid > li {
  display: flex;
  position: relative;
}

.pf-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--pf-line);
  border-radius: var(--pf-radius);
  background: var(--pf-surface);
  box-shadow: var(--pf-shadow);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.pf-card-share {
  position: absolute;
  inset-inline-end: 12px;
  top: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(20, 24, 32, 0.12);
  border-radius: 50%;
  color: #1b1b1d;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 16px rgba(17, 17, 19, 0.12);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.pf-card-share:hover,
.pf-card-share:focus-visible {
  color: #fff;
  background: var(--pf-accent);
  transform: translateY(-2px);
}

.pf-card-share:focus-visible {
  outline: 3px solid rgba(227, 6, 19, 0.3);
  outline-offset: 3px;
}

.pf-card-share svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.pf-share-status {
  position: fixed;
  inset-inline-start: 50%;
  bottom: 24px;
  z-index: 1000;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 6px;
  color: #fff;
  background: #161719;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.pf-share-status.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

a.pf-card:hover,
a.pf-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(227, 6, 19, 0.35);
  box-shadow: var(--pf-shadow-hover);
}

.pf-card-logo {
  display: grid;
  place-items: center;
  height: 150px;
  padding: 24px;
  border-bottom: 1px solid var(--pf-line);
  background:
    radial-gradient(circle at 50% 0%, rgba(227, 6, 19, 0.05), transparent 60%),
    #fbfbfc;
}

.pf-card-logo--dark {
  background:
    radial-gradient(circle at 50% 0%, rgba(227, 6, 19, 0.18), transparent 60%),
    #111113;
}

.pf-card-logo img {
  max-width: min(180px, 80%);
  max-height: 84px;
  object-fit: contain;
  transition: transform 300ms ease;
}

a.pf-card:hover .pf-card-logo img {
  transform: scale(1.05);
}

.pf-card-body {
  display: grid;
  align-content: start;
  gap: 6px;
  flex: 1;
  padding: 18px 20px 6px;
}

.pf-card-name {
  font-family: var(--pf-font-display);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
}

.pf-card-desc {
  color: var(--pf-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.pf-card-visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  width: 36px;
  height: 36px;
  margin: 10px 20px 18px;
  border: 1px solid var(--pf-line);
  border-radius: 50%;
  color: var(--pf-soft);
  background: #fff;
}

.pf-card-visit svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 180ms ease;
}

a.pf-card:hover .pf-card-visit {
  color: var(--pf-accent);
}

a.pf-card:hover .pf-card-visit svg {
  transform: translate(2px, -2px);
}

[dir="rtl"] .pf-card-visit svg {
  transform: scaleX(-1);
}

[dir="rtl"] a.pf-card:hover .pf-card-visit svg {
  transform: scaleX(-1) translate(2px, -2px);
}

/* Call to action */
.pf-cta {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: clamp(64px, 9vw, 110px) 0 clamp(56px, 8vw, 96px);
  padding: clamp(36px, 6vw, 64px) 24px;
  border: 1px solid var(--pf-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 15% 0%, rgba(227, 6, 19, 0.1), transparent 45%),
    radial-gradient(circle at 90% 100%, rgba(227, 6, 19, 0.08), transparent 40%),
    var(--pf-surface);
  text-align: center;
  box-shadow: var(--pf-shadow);
}

.pf-cta h2 {
  font-family: var(--pf-font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 900;
}

.pf-cta p {
  max-width: 540px;
  color: var(--pf-muted);
  line-height: 1.8;
}

.pf-cta .pf-actions {
  justify-content: center;
  margin-top: 6px;
}

@media (max-width: 640px) {
  :root {
    --pf-container: min(100% - 32px, 560px);
  }

  .pf-metrics {
    grid-template-columns: 1fr;
  }

  .pf-metrics li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 16px 18px;
  }

  .pf-metrics span {
    margin-top: 0;
  }

  .pf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .pf-work-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .pf-card-logo {
    height: 110px;
    padding: 16px;
  }

  .pf-card-body {
    padding: 14px 14px 4px;
  }

  .pf-card-name {
    font-size: 1rem;
  }

  .pf-card-desc {
    font-size: 0.86rem;
  }

  .pf-card-visit {
    width: 32px;
    height: 32px;
    margin: 8px 14px 14px;
  }

  .pf-actions .pf-btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 380px) {
  .pf-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Service relations (chip on each card + links to the matching service pages) */
.pf-card-service { display: inline-block; margin-top: 4px; font-size: .78rem; font-weight: 700; color: var(--pf-accent-deep); }
.pf-services { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 22px; font-size: .95rem; color: var(--pf-muted); }
.pf-services a { color: var(--pf-ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--pf-accent); text-underline-offset: 4px; }
.pf-services a:hover { color: var(--pf-accent); }

/* Share dialog */
html.pf-share-open { overflow: hidden; }
.pf-share-dialog { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 16px; }
.pf-share-dialog[hidden] { display: none; }
.pf-share-backdrop { position: absolute; inset: 0; background: rgba(12, 13, 15, 0.6); backdrop-filter: blur(3px); }
.pf-share-panel {
  position: relative;
  width: min(100%, 420px);
  padding: 28px 24px 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.pf-share-panel h3 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 900; }
.pf-share-name { margin: 0; color: var(--pf-accent, #e30613); font-weight: 800; }
.pf-share-hint { margin: 8px 0 16px; color: #666a70; font-size: 0.9rem; line-height: 1.7; }
.pf-share-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dcdee2;
  border-radius: 10px;
  color: #1b1b1d;
  background: #f6f7f8;
  font: 600 0.88rem/1.4 "Inter", sans-serif;
  text-align: left;
}
.pf-share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pf-share-actions > * {
  flex: 1 1 100px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  font: 800 0.92rem/1.3 inherit;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.pf-share-actions [hidden] { display: none; }
.pf-share-copy { color: #fff; background: #151619; }
.pf-share-copy.is-done { background: #13834a; }
.pf-share-wa { color: #fff; background: #1faa59; }
.pf-share-native { color: #1b1b1d; background: #eceef1; }
.pf-share-x { position: absolute; top: 10px; inset-inline-end: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f2f4; cursor: pointer; }
.pf-share-x::before { content: "\00d7"; font-size: 22px; line-height: 34px; color: #333; }
