/* ==========================================================================
   Persian Font: Doran (دوران - As used on Zandigan Architecture Studio)
   ========================================================================== */
@font-face {
  font-family: 'Doran';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/DoranFaNum-Regular.woff') format('woff');
}

@font-face {
  font-family: 'Doran';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/DoranFaNum-Regular.woff') format('woff');
}

@font-face {
  font-family: 'Doran';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/DoranFaNum-Regular.woff') format('woff');
}

@font-face {
  font-family: 'Doran';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/DoranFaNum-Bold.woff') format('woff');
}

@font-face {
  font-family: 'Doran';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/DoranFaNum-Bold.woff') format('woff');
}

@font-face {
  font-family: 'Doran';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/DoranFaNum-Bold.woff') format('woff');
}

@font-face {
  font-family: 'Doran';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/DoranFaNum-Bold.woff') format('woff');
}

:root {
  --font-fa: 'Doran', 'Vazirmatn', -apple-system, sans-serif;
  --font-en: 'Century Gothic', 'CenturyGothic', 'AppleGothic', 'Questrial', sans-serif;
  --font-display: 'Cinzel', serif;

  /* Pargar Studio Dark Palette (Deep Charcoal Espresso & Stone Gray - NO Gold) */
  --bg-main: #121110;
  --bg-surface: #181716;
  --bg-card: #1f1e1c;
  --bg-card-hover: #262422;
  
  --border-muted: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.28);
  --border-accent: #ffffff;
  
  --text-main: #f3f1ed;
  --text-muted: #a19b95;
  --text-dim: #6e6863;
  
  --column-count: 5;
  --transition-speed: 0.65s;
  --transition-cubic: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-fa);
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100%;
  font-size: 15px;
}

html[dir="rtl"] {
  line-height: 1.85;
}

html[dir="rtl"] p,
html[dir="rtl"] .leading-relaxed {
  line-height: 1.85;
}

/* Persian typography legibility enhancements */
html[dir="rtl"] .text-xs {
  font-size: 0.8125rem; /* ~13px */
}

html[dir="rtl"] .text-sm {
  font-size: 0.9375rem; /* ~15px */
}

html[dir="rtl"] .text-base {
  font-size: 1.0625rem; /* ~17px */
}

html[dir="ltr"] {
  font-family: var(--font-en);
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-x: clip; /* clip (unlike hidden) keeps the sticky header working */
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #2e2c29;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #504c47;
}

::selection {
  background: #ffffff;
  color: #121110;
}

/* ==========================================================================
   Custom Cursor (Pargar Studio Magic Mouse)
   ========================================================================== */
@media (min-width: 1024px) {
  body.has-custom-cursor {
    cursor: none;
  }
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor input,
  body.has-custom-cursor select,
  body.has-custom-cursor textarea,
  body.has-custom-cursor .cursor-pointer {
    cursor: none;
  }
}

/* Only shown once main.js enables it (desktop with a real mouse) */
#customCursorDot,
#customCursorRing {
  display: none;
}
body.has-custom-cursor #customCursorDot,
body.has-custom-cursor #customCursorRing {
  display: block;
}

#customCursorDot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  background-color: #ffffff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s, transform 0.05s;
}

#customCursorRing {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999998;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--transition-cubic),
              height 0.3s var(--transition-cubic),
              border-color 0.3s,
              background-color 0.3s;
}

#customCursorRing.cursor-hover {
  width: 28px;
  height: 28px;
  border-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Header & Indicator Navigation
   ========================================================================== */
.pargar-header {
  height: 80px;
  background: rgba(18, 17, 16, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-muted);
}

.indicator-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3e3a36;
  transition: all 0.4s var(--transition-cubic);
}

.indicator-dot.active {
  background: #ffffff;
  transform: scale(1.6);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Pargar Split Columns Accordion Layout (Desktop)
   ========================================================================== */
.pargar-desktop-container {
  /* One gap on all four sides so the slides sit centred under the header */
  --stage-gap: clamp(28px, 4.5vh, 52px);
  height: calc(100vh - 80px - 2 * var(--stage-gap));
  min-height: 540px;
  display: flex;
  width: 100%;
  padding: 0 var(--stage-gap);
  margin-top: var(--stage-gap);
  margin-bottom: var(--stage-gap);
  gap: 8px;
}

.pargar-column {
  flex: 1;
  position: relative;
  height: 100%;
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  overflow: hidden;
  transition: flex var(--transition-speed) var(--transition-cubic),
              background-color 0.4s,
              border-color 0.4s;
  background-color: var(--bg-surface);
  cursor: pointer;
}

.pargar-column:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Hover: a thin minimal light travels around the tile's edge */
@property --tile-glow-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.pargar-column::after {
  content: '';
  position: absolute;
  inset: 0; /* inside the tile: overflow:hidden clips anything over the border */
  z-index: 10;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--tile-glow-angle),
    transparent 0deg,
    transparent 290deg,
    rgba(255, 255, 255, 0.15) 320deg,
    rgba(255, 255, 255, 0.95) 352deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.pargar-column:not(.is-expanded):hover::after {
  opacity: 1;
  animation: tile-glow-travel 5s linear infinite;
}

@keyframes tile-glow-travel {
  to { --tile-glow-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .pargar-column:not(.is-expanded):hover::after {
    animation: none;
    background: rgba(255, 255, 255, 0.35);
  }
}

/* Active / Expanded Column */
.pargar-column.is-expanded {
  flex: 4.8;
  cursor: default;
  background-color: var(--bg-main);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Other columns shrink gracefully when one is active */
.pargar-desktop-container.has-active .pargar-column:not(.is-expanded) {
  flex: 0.65;
  opacity: 0.65;
}
.pargar-desktop-container.has-active .pargar-column:not(.is-expanded):hover {
  /* no width change here: it would resize the open column and reflow its text */
  opacity: 0.95;
}

/* Column Background Image (B&W Base, Color Bloom on Hover) */
.column-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) contrast(108%) brightness(0.35);
  transition: transform 0.8s var(--transition-cubic), filter 0.5s ease;
  z-index: 1;
}

.pargar-column:hover .column-bg-image {
  filter: grayscale(0%) contrast(110%) brightness(0.95);
  transform: scale(1.08);
}

.pargar-column.is-expanded .column-bg-image {
  filter: grayscale(15%) brightness(0.18);
  transform: scale(1.02);
}

/* Column Vertical Title & Collapsed State */
.column-collapsed-view {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0.5rem;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.pargar-column.is-expanded .column-collapsed-view {
  opacity: 0;
  pointer-events: none;
}

.vertical-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  letter-spacing: 0.25em;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s;
}

html[dir="rtl"] .vertical-title {
  letter-spacing: 0.05em;
  font-family: var(--font-fa);
}

.column-index {
  font-family: var(--font-en);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* Column Expanded Content View */
.column-expanded-view {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 2.2rem 2.8rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease 0.15s, visibility 0.45s;
}

.pargar-column.is-expanded .column-expanded-view {
  opacity: 1;
  visibility: visible;
}

/* Close Column Button */
.btn-close-column {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.btn-close-column:hover {
  background: #ffffff;
  color: #121110;
  border-color: #ffffff;
  transform: rotate(90deg);
}

/* ==========================================================================
   Noir Architectural Project Cards (B&W Base with Color Bloom on Hover)
   ========================================================================== */
.pargar-project-card {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: #181716;
  border: 1px solid var(--border-muted);
  transition: all 0.45s var(--transition-cubic);
}

.pargar-project-card:hover {
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.85);
}

.pargar-project-card .card-thumb {
  filter: grayscale(100%) contrast(105%) brightness(92%);
  transition: opacity 0.8s ease, filter 0.65s var(--transition-cubic), transform 0.85s var(--transition-cubic);
}

.pargar-project-card:hover .card-thumb {
  filter: grayscale(0%) contrast(100%) brightness(100%);
  transform: scale(1.06);
}

/* ==========================================================================
   Chenan Studio Cinematic Morphing Preloader
   ========================================================================== */
#chenanPreloader {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background-color: #121110;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 1.3s cubic-bezier(0.25, 1, 0.4, 1),
              visibility 1.3s cubic-bezier(0.25, 1, 0.4, 1);
}

#chenanPreloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#preloaderCenterWrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 1.2s cubic-bezier(0.25, 1, 0.4, 1);
}

#preloaderLogoImg {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

#chenanPreloader.is-revealed #preloaderLogoImg {
  opacity: 1;
  transform: scale(1);
}

.preloader-track {
  width: 130px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
}

.preloader-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #ffffff;
  transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}

#preloaderSub {
  font-family: var(--font-en);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: #a19b95;
  margin-top: 0.9rem;
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
}

#chenanPreloader.is-revealed #preloaderSub {
  opacity: 0.9;
}

/* ==========================================================================
   Project Detail Popup Modal
   ========================================================================== */
.modal-overlay {
  background: rgba(10, 9, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-modal-pargar {
  animation: modalZoomIn 0.35s var(--transition-cubic) forwards;
}

/* ==========================================================================
   Mobile Horizontal Slides (Accordion) for screens < 1024px
   ========================================================================== */
@media (max-width: 1023px) {
  .pargar-desktop-container {
    display: none;
  }
  .pargar-mobile-container {
    display: flex;
    flex-direction: column;
    padding: 0.85rem; /* same gap on every side */
    gap: 0.65rem;
    min-height: calc(100dvh - 80px - 1rem);
    margin-bottom: 2rem;
    transition: min-height 0.4s var(--transition-cubic);
  }

  /* Symmetrical 5 Horizontal Bands when no slide is opened */
  .pargar-mobile-container:not(.has-open-item) {
    height: calc(100dvh - 80px);
    min-height: 520px;
    margin-bottom: 0;
    justify-content: space-between;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .pargar-mobile-container:not(.has-open-item) .mobile-accordion-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .pargar-mobile-container:not(.has-open-item) .mobile-slide-bar {
    flex: 1;
    height: 100%;
    min-height: 0;
  }

  /* When an item is opened */
  .pargar-mobile-container.has-open-item {
    height: auto;
    min-height: auto;
    margin-bottom: 5rem;
    justify-content: flex-start;
    touch-action: pan-y;
  }
  .pargar-mobile-container.has-open-item .mobile-accordion-item:not(.is-open) {
    flex: 0 0 auto;
  }
  .pargar-mobile-container.has-open-item .mobile-accordion-item:not(.is-open) .mobile-slide-bar {
    min-height: 76px;
  }
  .pargar-mobile-container.has-open-item .mobile-accordion-item.is-open {
    flex: 0 0 auto;
  }
  .pargar-mobile-container.has-open-item .mobile-accordion-item.is-open .mobile-slide-bar {
    min-height: 80px;
  }

  .mobile-accordion-item {
    position: relative;
    border: 1px solid var(--border-muted);
    border-radius: 16px;
    background: var(--bg-surface);
    overflow: hidden;
    transition: border-color 0.35s var(--transition-cubic), 
                box-shadow 0.35s var(--transition-cubic), 
                flex 0.4s var(--transition-cubic);
    scroll-margin-top: 76px;
  }
  .mobile-accordion-item:hover,
  .mobile-accordion-item.is-touch-hover {
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.2), inset 0 0 12px rgba(255, 255, 255, 0.08);
  }
  .mobile-accordion-item.is-open {
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.85), 0 0 16px rgba(255, 255, 255, 0.08);
  }

  /* Traveling architectural white light line around mobile slides (ONLY active when finger touches or passes over this slide) */
  .mobile-accordion-item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(
      from var(--tile-glow-angle),
      transparent 0deg,
      transparent 280deg,
      rgba(255, 255, 255, 0.25) 310deg,
      rgba(255, 255, 255, 1) 350deg,
      transparent 360deg
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  /* White light appears ONLY on the specific slide the finger is on */
  .mobile-accordion-item.is-touch-hover::after,
  .mobile-accordion-item:not(.is-open):hover::after {
    opacity: 1;
    animation: tile-glow-travel 3.5s linear infinite;
  }

  .mobile-accordion-item.is-open:not(.is-touch-hover)::after {
    opacity: 0;
    animation: none;
  }

  /* Horizontal Slide Bar (Header) */
  .mobile-slide-bar {
    position: relative;
    width: 100%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    overflow: hidden;
    cursor: pointer;
    text-align: right;
    background: transparent;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: padding 0.35s ease, min-height 0.35s ease;
  }
  html[dir="ltr"] .mobile-slide-bar {
    text-align: left;
  }

  .mobile-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%) contrast(110%) brightness(0.35);
    transition: transform 0.65s var(--transition-cubic), filter 0.45s ease;
    z-index: 1;
  }
  .mobile-slide-bar:hover .mobile-slide-bg,
  .mobile-accordion-item:hover .mobile-slide-bg,
  .mobile-accordion-item.is-touch-hover .mobile-slide-bg {
    filter: grayscale(0%) contrast(110%) brightness(0.95);
    transform: scale(1.08);
  }
  .mobile-accordion-item.is-open .mobile-slide-bg {
    filter: grayscale(15%) brightness(0.25);
    transform: scale(1.02);
  }

  .mobile-slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(270deg, rgba(18, 17, 16, 0.94) 0%, rgba(18, 17, 16, 0.68) 55%, rgba(18, 17, 16, 0.88) 100%);
    transition: background 0.4s ease;
  }
  html[dir="ltr"] .mobile-slide-overlay {
    background: linear-gradient(90deg, rgba(18, 17, 16, 0.94) 0%, rgba(18, 17, 16, 0.68) 55%, rgba(18, 17, 16, 0.88) 100%);
  }
  .mobile-slide-bar:hover .mobile-slide-overlay,
  .mobile-accordion-item:hover .mobile-slide-overlay,
  .mobile-accordion-item.is-touch-hover .mobile-slide-overlay {
    background: linear-gradient(270deg, rgba(18, 17, 16, 0.45) 0%, rgba(18, 17, 16, 0.15) 50%, rgba(18, 17, 16, 0.45) 100%);
  }
  html[dir="ltr"] .mobile-slide-bar:hover .mobile-slide-overlay,
  html[dir="ltr"] .mobile-accordion-item:hover .mobile-slide-overlay,
  html[dir="ltr"] .mobile-accordion-item.is-touch-hover .mobile-slide-overlay {
    background: linear-gradient(90deg, rgba(18, 17, 16, 0.45) 0%, rgba(18, 17, 16, 0.15) 50%, rgba(18, 17, 16, 0.45) 100%);
  }

  .mobile-slide-content {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.85rem;
  }

  .mobile-slide-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
  }

  .mobile-slide-titles {
    min-width: 0;
    /* titles sit in the middle of the slide; icon and chevron stay at the edges */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 7rem);
    text-align: center;
    pointer-events: none;
  }

  .mobile-slide-sub {
    display: none !important;
  }

  /* No icons on mobile: slide bars and their opened panels show text only */
  .mobile-slide-icon-wrap,
  .mobile-slide-chevron-wrap,
  .mobile-accordion-item:not(.ig-tile) i[data-lucide],
  .mobile-accordion-item:not(.ig-tile) svg.lucide {
    display: none !important;
  }

  .mobile-slide-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-slide-sub {
    font-size: 0.72rem;
    color: #a19b95;
    display: block;
    margin-top: 3px;
    line-height: 1.25;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-slide-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1cdc7;
    flex-shrink: 0;
    transition: all 0.35s var(--transition-cubic);
  }
  .mobile-accordion-item.is-open .mobile-slide-icon-wrap,
  .mobile-accordion-item.is-touch-hover .mobile-slide-icon-wrap {
    background: #ffffff;
    color: #121110;
    border-color: #ffffff;
    transform: scale(1.05);
  }

  .mobile-slide-chevron-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.35s var(--transition-cubic);
  }
  .mobile-accordion-item.is-open .mobile-slide-chevron-wrap {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
  }

  .mobile-slide-chevron {
    width: 16px;
    height: 16px;
    color: #a19b95;
    transition: transform 0.4s var(--transition-cubic), color 0.3s;
  }
  .mobile-accordion-item.is-open .mobile-slide-chevron {
    transform: rotate(180deg);
    color: #ffffff;
  }

  /* Body Content View */
  .mobile-accordion-item:not(.is-open) .mobile-accordion-body {
    display: none;
  }
  .mobile-accordion-item.is-open .mobile-accordion-body {
    display: block;
    padding: 1.25rem 1.15rem 1.75rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    animation: mobileSlideExpand 0.4s var(--transition-cubic) forwards;
  }
  @keyframes mobileSlideExpand {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Filter chips: one swipeable row instead of wrapping lines */
  .mobile-accordion-item .mobile-filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: -1.15rem;
    padding-inline: 1.15rem;
  }
  .mobile-accordion-item .mobile-filter-row::-webkit-scrollbar { display: none; }
  .mobile-accordion-item .mobile-filter-row > * { flex-shrink: 0; }

  /* Tablets: two project cards per row */
  #pargarProjectsGridMobile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  header.pargar-header {
    height: 64px;
    padding-inline: 1rem;
  }
}

/* Swipe hint: phones only */
.mobile-swipe-hint { display: none; }

/* Phones: projects become a horizontal swipe carousel (next card peeks in) */
@media (max-width: 639px) {
  #pargarProjectsGridMobile {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 84%;
    gap: 0.85rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
    scroll-padding-inline: 1.25rem;
    padding-bottom: 0.25rem;
  }
  #pargarProjectsGridMobile::-webkit-scrollbar { display: none; }
  #pargarProjectsGridMobile > * {
    scroll-snap-align: start;
  }
  .mobile-accordion-item .mobile-swipe-hint { display: flex; }
}

@media (min-width: 1024px) {
  .pargar-mobile-container {
    display: none;
  }
}

/* ==========================================================================
   Social Media Iconic Showcase (No text links, pure architectural icons)
   ========================================================================== */
.social-icon-btn {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #d1cdc7;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-decoration: none;
  cursor: pointer;
}

.social-icon-btn:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.7);
}

.social-icon-btn .social-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #181716;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 11px;
  font-family: var(--font-fa);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
  z-index: 50;
}

.social-icon-btn:hover .social-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Pargar Studio Dedicated Full-Screen Project Presentation Page
   ========================================================================== */
#projectModal {
  transition: opacity 0.4s var(--transition-cubic), transform 0.4s var(--transition-cubic);
}

#photoStage {
  user-select: none;
  -webkit-user-select: none;
}

#photoCursorBadge {
  position: fixed;
  pointer-events: none;
  z-index: 99999999;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#photoCursorBadge.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Hide standard cursor dot/ring when hovering on photo stage */
body.is-on-photo-stage #customCursorDot,
body.is-on-photo-stage #customCursorRing {
  opacity: 0 !important;
  visibility: hidden;
}

/* Mini thumbnail items in single view */
.mini-photo-thumb {
  width: 46px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  opacity: 0.45;
  transition: all 0.25s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.mini-photo-thumb:hover {
  opacity: 0.85;
  border-color: rgba(255, 255, 255, 0.5);
}
.mini-photo-thumb.active {
  opacity: 1;
  border-color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Compact album grid item */
.compact-album-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 0;
  overflow: hidden;
  background: #181716;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.35s var(--transition-cubic);
}
.compact-album-item:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}
.compact-album-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(80%) contrast(105%);
  transition: filter 0.45s var(--transition-cubic), transform 0.55s var(--transition-cubic);
}
.compact-album-item:hover img {
  filter: grayscale(0%) contrast(100%);
  transform: scale(1.05);
}

/* No Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}



/* ==========================================================================
   Soft Image Entrance (blur-to-sharp) & Loading Skeleton
   ========================================================================== */
img.img-reveal {
  transition: opacity 0.8s ease, filter 0.9s var(--transition-cubic), transform 0.85s var(--transition-cubic);
}
img.img-reveal:not(.is-loaded) {
  opacity: 0;
  filter: blur(14px);
}

.img-skeleton {
  background: linear-gradient(110deg, #161514 30%, #1f1e1c 50%, #161514 70%);
  background-size: 250% 100%;
  animation: imgSkeletonShimmer 1.8s ease-in-out infinite;
}
@keyframes imgSkeletonShimmer {
  from { background-position: 100% 0; }
  to   { background-position: -150% 0; }
}

#stageImage {
  transition: opacity 0.5s ease, filter 0.6s var(--transition-cubic);
}
#stageImage.opacity-0 {
  filter: blur(12px);
}

/* ==========================================================================
   Scroll Reveal & Column Content Stagger
   ========================================================================== */
html .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 1s var(--transition-cubic);
}
html .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Desktop: content of a column rises in sequence when the column opens */
.pargar-column .column-expanded-view > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.7s var(--transition-cubic);
}
.pargar-column.is-expanded .column-expanded-view > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s ease, transform 1s var(--transition-cubic);
}
.pargar-column.is-expanded .column-expanded-view > *:nth-child(1) { transition-delay: 0.2s; }
.pargar-column.is-expanded .column-expanded-view > *:nth-child(2) { transition-delay: 0.3s; }
.pargar-column.is-expanded .column-expanded-view > *:nth-child(3) { transition-delay: 0.4s; }
.pargar-column.is-expanded .column-expanded-view > *:nth-child(4) { transition-delay: 0.5s; }
.pargar-column.is-expanded .column-expanded-view > *:nth-child(n+5) { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  img.img-reveal:not(.is-loaded) { filter: none; }
  .img-skeleton { animation: none; }
  .pargar-column .column-expanded-view > *,
  html .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Instagram Story Ring & Viewer
   ========================================================================== */
.story-ring {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 2px;
  border-radius: 50%;
  border: 0;
  background: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.story-ring:hover { transform: scale(1.06); }
.story-ring.is-seen { background: rgba(255, 255, 255, 0.28); }
.story-ring:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.story-ring-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--bg-main);
  background: var(--bg-card);
}
.story-ring-inner img { width: 100%; height: 100%; object-fit: cover; }


.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 8, 7, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-viewer.hidden { display: none; }

.story-frame {
  position: relative;
  height: min(92vh, 860px);
  aspect-ratio: 9 / 16;
  max-width: 100vw;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
}
.story-media, .story-media img, .story-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.story-progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  gap: 4px;
  direction: ltr;
}
.story-progress span {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.story-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}
.story-head {
  position: absolute;
  top: 22px;
  left: 12px;
  right: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.story-head::before {
  content: '';
  position: absolute;
  inset: -40px -20px -30px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
  z-index: -1;
}
.story-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: contain; background: #121110; padding: 3px; }
.story-user { font-family: var(--font-en); font-weight: 600; font-size: 13px; }
.story-time { font-family: var(--font-en); font-size: 12px; opacity: 0.7; margin-right: auto; }
.story-icon-btn { background: none; border: 0; color: #fff; padding: 6px; display: inline-flex; }
.story-icon-btn.hidden { display: none; }
.story-nav {
  position: absolute;
  top: 70px;
  bottom: 70px;
  z-index: 2;
  width: 35%;
  background: none;
  border: 0;
}
.story-nav-prev { left: 0; }
.story-nav-next { right: 0; width: 65%; }
.story-permalink {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.story-permalink.hidden { display: none; }

@media (max-width: 640px) {
  .story-frame { height: 100%; width: 100%; aspect-ratio: auto; border-radius: 0; }
  .story-media img, .story-media video { object-fit: cover; }
}

/* Small laptops: free header space for the larger menu (social links stay in the Contact column) */
@media (min-width: 1280px) and (max-width: 1399px) {
  #headerSocialIcons,
  .pargar-header [data-i18n="brandSub"] { display: none; }
}

/* Project card: info slides up over the photo on hover */
.pargar-project-card .card-info {
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}
.pargar-project-card:hover .card-info,
.pargar-project-card:focus-visible .card-info {
  transform: translateY(0);
  opacity: 1;
}
/* Touch screens have no hover: keep only the title visible, details stay hidden */
@media (hover: none) {
  .pargar-project-card .card-info {
    transform: none;
    opacity: 1;
    padding-top: 3rem;
  }
  .pargar-project-card .card-info-more { display: none; }
}

/* Article reader: narrow text column, images may break out wider */
.article-flow > * { max-width: 680px; margin-left: auto; margin-right: auto; margin-top: 2rem; }
.article-flow > header { margin-top: 0; }
.article-flow > .article-bleed-wide { max-width: 880px; }
.article-flow > .article-bleed-full { max-width: none; margin-left: -2.5rem; margin-right: -2.5rem; }
@media (max-width: 639px) {
  .article-flow > .article-bleed-full { margin-left: -1.25rem; margin-right: -1.25rem; }
}

/* ==========================================================================
   Instagram Feed Tile & Post Viewer
   ========================================================================== */
body:not(.has-ig) .ig-tile { display: none !important; }

/* Profile header, laid out like the Instagram app */
.ig-profile { max-width: 935px; margin: 0 auto 0.5rem; }
.ig-profile-top { display: flex; align-items: center; gap: 1.5rem; }
.ig-avatar {
  flex-shrink: 0;
  width: 92px;
  height: 92px;
  padding: 3px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: default;
}
.ig-avatar.has-story {
  background: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
  cursor: pointer;
}
.ig-avatar.is-seen { background: rgba(255, 255, 255, 0.3); cursor: pointer; }
.ig-avatar-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--bg-main, #121110);
  background: #1c1b19;
}
.ig-avatar-inner img { width: 100%; height: 100%; object-fit: cover; }
.ig-profile-meta { flex: 1; min-width: 0; }
.ig-profile-user { font-family: var(--font-en); font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 0.6rem; text-align: start; }
html[dir="rtl"] .ig-profile-user { text-align: right; }
.ig-profile-stats { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.ig-profile-stats li { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.ig-profile-stats b { font-size: 16px; font-weight: 700; color: #fff; }
.ig-profile-stats span { font-size: 12px; color: #a8a29e; }
.ig-profile-bio { margin-top: 0.9rem; font-size: 13px; line-height: 1.7; color: #e7e5e4; }
.ig-profile-bio b { display: block; font-weight: 700; color: #fff; }
.ig-profile-bio p { white-space: pre-line; margin: 0; }
.ig-profile-bio a { color: #e0f1ff; font-weight: 600; font-family: var(--font-en); }
.ig-follow-btn {
  display: block;
  margin-top: 1rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: #0095f6;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s ease;
}
.ig-follow-btn:hover { background: #1877f2; }

.ig-tabs {
  display: flex;
  justify-content: center;
  max-width: 935px;
  margin: 1.25rem auto 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.ig-tabs button {
  flex: 1;
  max-width: 160px;
  display: flex;
  justify-content: center;
  padding: 0.75rem 0;
  margin-top: -1px;
  border: 0;
  border-top: 1px solid transparent;
  background: none;
  color: #78716c;
  cursor: pointer;
}
.ig-tabs button svg { width: 22px; height: 22px; }
.ig-tabs button.is-active { color: #fff; border-top-color: #fff; }

.ig-feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  max-width: 935px;
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .ig-feed-grid { gap: 4px; }
  .ig-avatar { width: 150px; height: 150px; }
  .ig-profile-top { gap: 3rem; }
  .ig-profile-user { font-size: 20px; }
  .ig-follow-btn { display: inline-block; min-width: 180px; }
}
.ig-feed-item {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-card, #1c1b19);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.ig-feed-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, opacity 0.3s ease;
}
.ig-feed-item:hover img { transform: scale(1.04); opacity: 0.85; }
.ig-feed-item.is-reel { aspect-ratio: 9 / 16; }
.ig-feed-blank { display: block; width: 100%; height: 100%; }
.ig-viewer-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; margin-inline-end: 0.6rem; background: #1c1b19; }
.ig-viewer-head .ig-viewer-user { margin-inline-end: auto; }
.ig-feed-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.ig-feed-more {
  display: block;
  margin: 1.5rem auto 0;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ig-feed-more:hover { background: rgba(255, 255, 255, 0.08); }

.ig-viewer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}
.ig-viewer.hidden { display: none; }
.ig-viewer-card {
  display: flex;
  width: min(1100px, 100%);
  height: min(86vh, 760px);
  background: #121110;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  direction: ltr;
}
.ig-viewer-media {
  position: relative;
  flex: 1 1 62%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.ig-viewer-slide { max-width: 100%; max-height: 100%; object-fit: contain; }
.ig-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.85);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.ig-viewer-nav svg { width: 18px; height: 18px; }
.ig-viewer-nav.hidden { display: none; }
.ig-viewer-prev { left: 12px; }
.ig-viewer-next { right: 12px; }
.ig-viewer-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 2;
}
.ig-viewer-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); }
.ig-viewer-dots span.is-active { background: #fff; }
.ig-viewer-side {
  flex: 0 0 38%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.ig-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ig-viewer-user { font-size: 14px; font-weight: 700; color: #fff; font-family: var(--font-en); }
.ig-viewer-close { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; }
.ig-viewer-caption {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  font-size: 14px;
  line-height: 1.9;
  color: #d6d3d1;
  white-space: pre-line;
  text-align: start;
}
.ig-viewer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #a19b95;
}
.ig-viewer-foot a { color: #fff; font-weight: 700; }
.ig-viewer-foot a.hidden { display: none; }

@media (max-width: 1023px) {
  .ig-viewer { padding: 0; }
  .ig-viewer-card {
    flex-direction: column;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
  }
  .ig-viewer-media { flex: 0 0 auto; aspect-ratio: 4 / 5; max-height: 65vh; }
  /* Head above the photo, caption and date below it */
  .ig-viewer-side { display: contents; }
  .ig-viewer-head { order: -1; }
}
html[dir="rtl"] .ig-viewer-foot { direction: rtl; }
/* Bio follows the page's alignment even when written in the other language */
.ig-profile-bio p { unicode-bidi: plaintext; text-align: left; }
html[dir="rtl"] .ig-profile-bio p { text-align: right; }
/* English labels are wider: drop the extra header link before it overlaps the brand */
@media (max-width: 1535px) {
  html[dir="ltr"] .ig-nav { display: none !important; }
}

/* Post viewer: previous/next post arrows (desktop) and a short slide when switching posts */
.ig-viewer-post-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}
.ig-viewer-post-nav svg { width: 22px; height: 22px; }
.ig-viewer-post-nav.hidden { display: none; }
.ig-viewer-post-prev { left: 18px; }
.ig-viewer-post-next { right: 18px; }
@media (max-width: 1023px) {
  .ig-viewer-post-nav { display: none; }
}
@keyframes igFromNext { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes igFromPrev { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
.ig-viewer-card.is-from-next { animation: igFromNext 0.3s ease; }
.ig-viewer-card.is-from-prev { animation: igFromPrev 0.3s ease; }
.ig-viewer { overscroll-behavior: contain; }
.ig-viewer-media { touch-action: none; }
