/* ============================================================
   AMEDIA — components & section styles
   ============================================================ */

/* ---------- HERO (home) ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  text-align: center; overflow: visible;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(71,210,126,.14), transparent 55%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.02) 0 14px, transparent 14px 30px),
    radial-gradient(140% 120% at 50% 120%, #16201a 0%, #0c0f0c 70%);
}
.hero::after { /* vignette only — hero joins the intro directly with no divider */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(92% 75% at 50% 42%, transparent 48%, rgba(0,0,0,.42) 100%);
}
.hero__inner { padding-top: var(--header-h); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.hero__title { max-width: 18ch; margin-inline: auto; }

/* ===== scroll indicator — vertical "scroll" word, centered ===== */
.hero__scroll {
  position: absolute; inset-block-end: 36px; inset-inline: 0; margin-inline: auto; z-index: 5;
  width: fit-content; display: flex; justify-content: center;
}
.scroll-b__word {
  writing-mode: vertical-rl; text-orientation: upright;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: .9rem; line-height: 1.05;
  background: linear-gradient(to bottom, var(--text-faint) 0 38%, var(--accent-bright) 50%, var(--text-faint) 62% 100%);
  background-size: 100% 280%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  animation: scrollB 2.2s ease-in-out infinite alternate;
}
@keyframes scrollB { from { background-position: 50% 0%; } to { background-position: 50% 100%; } }
/* the green sweep stays on even with reduced-motion (user request, m0090) —
   it's a small ambient cue, like the journey sparks / card parallax. */

/* ---------- INTRO (full-bleed image background, copy overlaid) ---------- */
.intro {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(400px, 52vh, 580px); /* same frame height as the CTA card */
  display: flex; align-items: center;
  padding-block: clamp(48px, 8vw, 104px);
  /* clean bottom edge, rounded on both corners; top joins the hero directly */
  border-end-start-radius: var(--r-xl);
  border-end-end-radius: var(--r-xl);
  z-index: 1;
}
/* the soft section below tucks up behind the rounded corners, so the notch
   shows the page's soft-gray surface instead of a darker cut-out */
.intro + .section--soft {
  margin-top: calc(var(--r-xl) * -1);
  padding-top: calc(clamp(64px, 9vw, 132px) + var(--r-xl));
}
.intro__bg { position: absolute; inset: 0; z-index: -2; border-radius: inherit; }
/* gray bloom anchored under the copy, fading out toward the image (not bottom-up) */
.intro::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(125% 138% at 100% 50%,
      var(--bg-soft) 0%, rgba(20,26,20,.82) 28%, rgba(20,26,20,.36) 52%, transparent 76%);
}
html[dir="ltr"] .intro::after {
  background: radial-gradient(125% 138% at 0% 50%,
      var(--bg-soft) 0%, rgba(20,26,20,.82) 28%, rgba(20,26,20,.36) 52%, transparent 76%);
}
.intro__inner { position: relative; z-index: 1; margin-block-end: clamp(70px, 13vh, 160px); /* copy sits well above centre, like CTA / school */ }
.intro-copy { max-width: 620px; }
.intro-copy .h2 { margin: 0 0 16px; }
.intro-copy .lead { line-height: 1.9; }
@media (max-width: 760px) {
  .intro { min-height: clamp(420px, 78vh, 560px); }
  .intro-copy { max-width: 100%; }
}

/* ---------- PROJECT / ARTICLE CARDS ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 30px); }
@media (max-width: 880px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .cards-grid { grid-template-columns: 1fr; }
  /* match the home-page project cards on phones: full-width, type dialed down a touch */
  .cards-grid .pcard__title { font-size: 1.5rem; }
  .cards-grid .pcard__excerpt { font-size: 1.02rem; min-height: calc(1.02rem * 1.65 * 4); }
}

/* The card is two layers: a dark BACKGROUND that holds the text + a corner
   circle, and an IMAGE that sits on top of it. On hover the image detaches,
   lifts toward the cursor (clamped) and casts a soft shadow. */
.pcard {
  --r-card: 30px;          /* shared radius */
  --dot: 20px;             /* corner circle — standard size */
  --dot-hover: 27px;       /* corner circle on hover (grows a bit more) */
  --edge: 22px;            /* circle margin — SAME on left & bottom axes */
  --gap: 10px;             /* equal gap: title→excerpt and excerpt→circle */
  position: relative; display: block; overflow: hidden;
  /* frosted translucent glass, lit from the top-left.
     The base tint is opaque enough to read as a card even where
     backdrop-filter is unsupported; blur enhances it where available. */
  background:
    linear-gradient(135deg, rgba(108,124,104,.42) 0%, rgba(46,56,46,.34) 46%, rgba(20,26,20,.30) 100%);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-card);
  padding: 0;
  /* overflow VISIBLE so the photo tile can lift off the panel and cast its
     shadow outside the panel edge (the photo clips itself to its own radius). */
  overflow: visible;
  /* The glass PANEL stays perfectly still — it never follows the cursor and
     never lifts. Only the photo on top moves (see .pcard__media). */
  /* 3D bevel: light edge top-left, dark edge bottom-right + soft drop */
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.20),
    inset -1.5px -1.5px 0 rgba(0,0,0,.32),
    0 20px 44px -20px rgba(0,0,0,.62);
  /* hover affects only the panel's border + glow, and it eases softly. */
  transition: border-color .55s var(--ease-out), box-shadow .6s var(--ease-out);
}
/* Revealed cards carry [data-reveal]; that rule's transition (opacity+transform
   only) is more specific than .pcard and would wipe out our hover transitions.
   Restate them at higher specificity: keep the reveal fade AND ease hover. */
html.reveal-anim .pcard[data-reveal] {
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out),
              border-color .55s var(--ease-out), box-shadow .6s var(--ease-out);
}
.pcard:hover {
  border-color: rgba(255,255,255,.22);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.28),
    inset -1.5px -1.5px 0 rgba(0,0,0,.38),
    0 34px 64px -22px rgba(0,0,0,.72);
}
/* a soft light striking from the top-left corner toward bottom-right */
.pcard::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120% 120% at 0% 0%,
    rgba(255,255,255,.16) 0%, rgba(255,255,255,.05) 26%, transparent 52%);
  transition: opacity .6s var(--ease-out); opacity: .9;
}
.pcard:hover::before { opacity: 1; }

/* ---- the image layer: FULL card width, clipped by the card.
   It sits slightly zoomed so it can pan toward the cursor (more than the
   card itself) without ever exposing an edge. ---- */
.pcard__media {
  --mx: 0px; --my: 0px;
  position: relative; z-index: 2; display: block; overflow: hidden;
  /* FULL-WIDTH tile: spans the entire card width, flush to the top edge. It
     keeps its TRUE size — no zoom. Top corners match the card radius; bottom
     corners stay rounded so it still reads as a tile resting ON the card. */
  width: auto; margin: 0; aspect-ratio: 4/3;
  border-radius: var(--r-card) var(--r-card) 18px 18px;
  transform: translate(var(--mx), var(--my));
  /* a soft resting shadow so the tile already sits a touch above the panel */
  box-shadow: 0 6px 16px -8px rgba(0,0,0,.55);
  transition: transform .55s var(--ease-out), box-shadow .6s var(--ease-out);
  will-change: transform;
}
.pcard__media.ph::after { font-size: .72rem; }
/* On hover the photo LIFTS straight up off the still panel as a whole tile
   (NO scaling), pans gently toward the cursor, and casts a big soft shadow on
   the panel below — mirroring the reference. */
.pcard:hover .pcard__media {
  transform: translate(var(--mx), calc(var(--my) - 16px));
  box-shadow: 0 28px 46px -12px rgba(0,0,0,.78), 0 10px 22px -8px rgba(0,0,0,.55);
}

/* ---- the text layer ---- */
/* Title and excerpt reserve a FIXED height (2 + 3 lines) so the card body is
   the same height whether the copy is short or long — that keeps the corner
   circle in an identical position on every card, regardless of line count. */
/* padding-bottom = circle offset + circle size + one gap → the gap above the
   circle always equals the title→excerpt gap, on every card. */
.pcard__body { position: relative; z-index: 1;
  padding: 20px 20px calc(var(--edge) + var(--dot) + var(--gap));
  display: flex; flex-direction: column; gap: var(--gap); }
/* Title reserves 2 lines (keeps the corner circle aligned across cards), but
   its text is BOTTOM-aligned inside that box so a 1-line title (e.g. «فیلم
   کوتاه بابا») sits right above the excerpt with the SAME gap as a
   2-line title — no floating empty line. The clamp lives on the inner span. */
.pcard__title { font-size: 2rem; font-weight: 700; line-height: 1.45; }
.pcard__title-t {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__excerpt { color: var(--text-muted); font-size: 1.28rem; line-height: 1.65;
  min-height: calc(1.28rem * 1.65 * 4);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- the corner circle (bottom corner, equal margin on BOTH axes) ---- */
.pcard__handle {
  position: absolute; bottom: var(--edge); z-index: 4;
  width: var(--dot); height: var(--dot); border-radius: 50%;
  background: radial-gradient(125% 125% at 35% 28%, #fcfdfa, #d7dccf);
  box-shadow: 0 4px 11px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.85);
  transition: width .5s var(--ease-out), height .5s var(--ease-out),
              box-shadow .55s var(--ease-out);
}
html[dir="rtl"] .pcard__handle { left: var(--edge); right: auto; }   /* Farsi/Arabic → bottom-left  */
html[dir="ltr"] .pcard__handle { right: var(--edge); left: auto; }   /* English      → bottom-right */
.pcard:hover .pcard__handle {
  width: var(--dot-hover); height: var(--dot-hover);
  box-shadow: 0 6px 16px rgba(0,0,0,.48), 0 0 13px rgba(255,255,255,.16), inset 0 1px 0 rgba(255,255,255,.9);
}

.section-cta { display: flex; justify-content: center; margin-top: clamp(36px, 5vw, 56px); }

/* ============================================================
   JOURNEY — top 5 projects scattered along a glowing green route
   ============================================================ */
.journey { overflow: hidden; }
.journey__stage {
  position: relative; margin-inline: auto;
  max-width: 1200px; aspect-ratio: 1200 / 1820;
}

/* --- glowing green route (under the cards) --- */
.journey__path {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; overflow: visible; pointer-events: none;
}
.journey__route, .journey__spark, .journey__strand, .journey__strand-spark {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
/* thinner companion strands beside the main line — same green, softer glow */
.journey__strand {
  stroke: var(--accent);
  filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 9px rgba(71,210,126,.4));
}
/* a bright light travelling along each strand */
.journey__strand-spark {
  stroke: #d6ffe7;
  filter: drop-shadow(0 0 5px var(--accent-bright));
}
.journey__route {
  stroke: var(--accent); stroke-width: 1.5;
  filter: drop-shadow(0 0 5px var(--accent)) drop-shadow(0 0 18px rgba(71,210,126,.5)) drop-shadow(0 0 40px rgba(71,210,126,.32));
  opacity: .9;
}
/* a brighter light that travels along the route */
.journey__spark {
  stroke: #c9ffe0; stroke-width: 1.5;
  stroke-dasharray: .16 .84; stroke-dashoffset: 0;
  filter: drop-shadow(0 0 7px var(--accent-bright));
  animation: routeFlow 6.5s linear infinite;
}
@keyframes routeFlow { to { stroke-dashoffset: -1; } }
/* the traveling light on the route/strands stays ON (restored per user request) */

/* --- glass pills (like the card panel) ---
   MODEL 1 = plain .pill (decorative, no circle).
   MODEL 2 = .pill--link (clickable) carries the white .pill__dot circle. */
.pill {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  padding: 16px 36px; border-radius: var(--r-pill); white-space: nowrap;
  font-weight: 700; font-size: clamp(1rem, 1.15vw, 1.12rem); letter-spacing: .01em;
  color: var(--text); text-decoration: none;
  background:
    radial-gradient(120% 135% at 0% 0%, rgba(255,255,255,.18) 0%, rgba(255,255,255,.05) 28%, transparent 56%),
    linear-gradient(135deg, rgba(108,124,104,.42) 0%, rgba(46,56,46,.34) 46%, rgba(20,26,20,.30) 100%);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.20),
    inset -1.5px -1.5px 0 rgba(0,0,0,.32),
    0 18px 38px -18px rgba(0,0,0,.62);
  transition: border-color .5s var(--ease-out), box-shadow .55s var(--ease-out),
              background .5s var(--ease-out), color .4s var(--ease-out), text-shadow .4s var(--ease-out);
}
/* hover: brighten the top-left white wash + glow the label (no outer glow) */
.pill:hover {
  border-color: rgba(255,255,255,.24);
  color: #ffffff;
  text-shadow: 0 0 13px rgba(255,255,255,.55), 0 0 4px rgba(255,255,255,.42);
  background:
    radial-gradient(120% 135% at 0% 0%, rgba(255,255,255,.36) 0%, rgba(255,255,255,.11) 30%, transparent 60%),
    linear-gradient(135deg, rgba(108,124,104,.42) 0%, rgba(46,56,46,.34) 46%, rgba(20,26,20,.30) 100%);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.30),
    inset -1.5px -1.5px 0 rgba(0,0,0,.38),
    0 22px 46px -16px rgba(0,0,0,.74);
}
/* Reveal rule (html.reveal-anim [data-reveal]) overrides the pill transition
   and makes hover snap. Restate at higher specificity so hover eases smoothly
   while the reveal fade still works (same fix as the cards). */
html.reveal-anim .pill[data-reveal] {
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out),
              border-color .5s var(--ease-out), box-shadow .55s var(--ease-out),
              background .5s var(--ease-out), color .4s var(--ease-out), text-shadow .4s var(--ease-out);
}
/* MODEL-2 corner circle on the pill: white glowing handle.
   Grows via transform:scale so it NEVER changes layout (no sibling shift). */
.pill__dot {
  position: relative; width: 16px; height: 16px; flex: none; background: transparent;
}
.pill__dot::after {
  content: ""; position: absolute; top: 50%; right: 0; height: 16px; width: 16px;
  transform: translateY(-50%); /* stays vertically centered in the pill, hover or not */
  border-radius: 999px;
  background: radial-gradient(125% 125% at 35% 28%, #fcfdfa, #d7dccf);
  box-shadow: 0 3px 9px rgba(0,0,0,.42), 0 0 10px rgba(255,255,255,.18), inset 0 1px 0 rgba(255,255,255,.85);
  transition: width .5s var(--ease-out), box-shadow .55s var(--ease-out);
}
/* the circle always sits on the physical LEFT, in every language/direction */
html[dir="rtl"] .pill__dot { order: 2; }
html[dir="ltr"] .pill__dot { order: -1; }
.pill--link:hover .pill__dot::after {
  width: 28px; /* stretches LEFT into a short, clean capsule (right edge pinned) */
  box-shadow: 0 3px 9px rgba(0,0,0,.48), 0 0 10px rgba(255,255,255,.28), inset 0 .6px 0 rgba(255,255,255,.9);
}

.journey__start { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; }
.journey__end   { position: absolute; bottom: 0; left: 68%; transform: translateX(-50%); z-index: 3; }

/* --- scattered card slots (filled with 5 random projects) --- */
.journey__cards { position: absolute; inset: 0; z-index: 2; }
.journey__cards > .pcard { position: absolute; width: 30%; margin: 0; }
.journey__cards > .pcard:nth-child(1) { left: 1%;  top: 1%;  }
.journey__cards > .pcard:nth-child(2) { left: 62%; top: 13%; }
.journey__cards > .pcard:nth-child(3) { left: 25%; top: 35%; }
.journey__cards > .pcard:nth-child(4) { left: 64%; top: 53%; }
.journey__cards > .pcard:nth-child(5) { left: 4%;  top: 69%; }
.journey__cards > .pcard:hover { z-index: 5; }

/* --- stack to a simple grid on small screens (no scatter / no route) --- */
@media (max-width: 880px) {
  .journey__stage { aspect-ratio: auto; max-width: none; }
  .journey__path { display: none; }
  .journey__start { position: static; margin-bottom: 30px; }
  .journey__end { position: static; left: auto; transform: none; margin-top: 30px; display: flex; justify-content: center; }
  .journey__cards { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 2.4vw, 26px); }
  .journey__cards > .pcard { position: static; width: auto; }
  .journey__cards > .pcard:nth-child(n) { left: auto; top: auto; }
}
@media (max-width: 560px) {
  .journey__cards { grid-template-columns: 1fr; }
  /* card stays full-width; only the type is dialed down a touch */
  .journey__cards .pcard__title { font-size: 1.5rem; }
  .journey__cards .pcard__excerpt { font-size: 1.02rem; min-height: calc(1.02rem * 1.65 * 4); }
}

/* ---------- CUSTOMERS / LOGOS — simple two-row grid of glass cards ---------- */
/* Every client logo once, sat side-by-side in glass cards that match the site's
   card system. On hover the whole card (logo + its glass) lifts up. */
.logos-sec { padding-block: clamp(54px, 8vw, 110px); }
.logos { display: block; }
.logos__grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(10px, 1.1vw, 16px);
}
.logo-card {
  position: relative; isolation: isolate;
  display: grid; place-items: center;
  flex: 0 0 auto; width: clamp(88px, 9vw, 112px);
  aspect-ratio: 1 / 1;
  border-radius: clamp(14px, 1.3vw, 18px);
  /* same frosted glass recipe as the project cards */
  background:
    linear-gradient(135deg, rgba(108,124,104,.42) 0%, rgba(46,56,46,.34) 46%, rgba(20,26,20,.30) 100%);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.10),
    inset -1.5px -1.5px 0 rgba(0,0,0,.30),
    0 18px 38px -22px rgba(0,0,0,.6);
  transition: transform .5s var(--ease-out), border-color .5s var(--ease-out), box-shadow .55s var(--ease-out);
  will-change: transform;
}
/* soft light striking from the top-left corner */
.logo-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120% 120% at 0% 0%,
    rgba(255,255,255,.16) 0%, rgba(255,255,255,.05) 26%, transparent 52%);
  transition: opacity .6s var(--ease-out); opacity: .9;
}
/* hover: the entire card lifts, brighter edge + deeper shadow */
.logo-card:hover {
  transform: translateY(-12px);
  border-color: rgba(255,255,255,.24);
  box-shadow:
    inset 1.5px 1.5px 0 rgba(255,255,255,.13),
    inset -1.5px -1.5px 0 rgba(0,0,0,.30),
    0 36px 56px -22px rgba(0,0,0,.72);
}
.logo-card:hover::before { opacity: 1; }
.logo-card__art {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 72%; height: 72%;
  background-position: center; background-repeat: no-repeat; background-size: contain;
  opacity: .82;
  transition: opacity .5s var(--ease-out);
}
.logo-card:hover .logo-card__art { opacity: 1; }
.logo-card__label {
  font-size: .78rem; font-weight: 600; line-height: 1.3;
  color: rgba(243,245,239,.5); text-align: center; padding: 0 6px;
}
.logo-card__art.has-media .logo-card__label { display: none; }

/* ---------- CTA (full-bleed image background, copy overlaid — same pattern as INTRO) ---------- */
.cta {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(400px, 52vh, 580px);
  display: flex; align-items: center;
  padding-block: clamp(48px, 8vw, 104px);
  border-radius: var(--r-xl);
  z-index: 1;
}
.cta__bg { position: absolute; inset: 0; z-index: -2; border-radius: inherit; }
/* gray bloom anchored under the copy, fading out toward the image */
.cta::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(125% 138% at 100% 50%,
      var(--bg-soft) 0%, rgba(20,26,20,.82) 28%, rgba(20,26,20,.36) 52%, transparent 76%);
}
html[dir="ltr"] .cta::after {
  background: radial-gradient(125% 138% at 0% 50%,
      var(--bg-soft) 0%, rgba(20,26,20,.82) 28%, rgba(20,26,20,.36) 52%, transparent 76%);
}
.cta__inner { position: relative; z-index: 1; margin-block-end: clamp(70px, 13vh, 160px); /* copy sits well above the vertical centre */ }
.cta-copy { max-width: 620px; }
.cta-copy .h2 { max-width: 16ch; }
.cta-copy .accent { color: var(--accent); display: block; margin-top: 6px; }
.cta-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
@media (max-width: 760px) { .cta { min-height: clamp(380px, 64vh, 520px); } }
@media (prefers-reduced-motion: reduce) { .hero__bg { animation: none; } }

/* ---------- COMING SOON (poster cards — image bg, copy overlaid, swipeable row) ---------- */
.soon-head { display: flex; justify-content: center; margin-bottom: 40px; }
.soon-scroller { overflow-x: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-block: 8px 18px; cursor: grab; user-select: none; -webkit-user-select: none; }
/* desktop: overflow hidden so the vertical wheel never gets trapped here (page scrolls freely);
   JS drag still moves it via scrollLeft. touch: native scroll + snap. */
@media (hover: none) { .soon-scroller { overflow-x: auto; scroll-snap-type: x proximity; } }
.soon-scroller.is-dragging { cursor: grabbing; }
.soon-scroller.is-dragging .soon-card { pointer-events: none; } /* no hover churn mid-drag */
.soon-scroller::-webkit-scrollbar { display: none; }
/* --soon-scale grows everything inside the card (type, dot, paddings) in step with the card width */
.soon-track { --soon-w: clamp(250px, 24vw, 310px); --soon-scale: 1; display: flex; gap: calc(22px * var(--soon-scale)); width: max-content; padding-inline: calc(50vw - var(--soon-w) / 2); }
@media (min-width: 881px) { .soon-track { --soon-w: 380px; --soon-scale: 1.25; } }
@media (min-width: 1280px) { .soon-track { --soon-w: 465px; --soon-scale: 1.5; } }
.soon-card {
  position: relative; overflow: hidden;
  width: var(--soon-w); aspect-ratio: 3/4; flex: none;
  border-radius: var(--r-lg); border: 1px solid var(--border);
  background: #0a0d0a; /* dark behind the media so subpixel gaps never flash bright */
  isolation: isolate;  /* own compositing layer → clean rounded-corner clipping of the scaled media */
  scroll-snap-align: center;
}
.soon-card__media {
  position: absolute; inset: -2px;
  /* -2px overscan: at fractional Windows display scaling (125%/150%) an inset of 0
     left bright hairline seams at the edges while the image zooms — keep the bleed */
  transform: scale(1.12);
  transition: transform .9s var(--ease-out), filter .9s var(--ease-out);
  backface-visibility: hidden;
}
.soon-card__media img, .soon-card__media video { -webkit-user-drag: none; }
.soon-card:hover .soon-card__media,
.soon-card.is-open .soon-card__media { transform: scale(1.04); filter: brightness(.55); }
/* keep a little overscan at the end of the zoom-out (1.04, not 1): landing exactly on the
   card edge mid-animation exposed bright hairline seams around the darkened image */
/* strong bottom-to-top fade (dims most of the image, like the poster reference) */
/* multi-image slideshow inside a soon card (2s hold + 1s dissolve, incoming image zooms out).
   All slide transforms carry translateZ(0): GPU-composited scaling — otherwise the
   background-image shimmers/ticks sideways at fractional Windows display scales. */
.soon-card__media.is-slideshow { background-image: none !important; }
.soon-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0; transition: opacity 1s linear, transform 1.1s var(--ease-out);
  transform: translateZ(0) scale(1.16);
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.soon-slide.is-on { opacity: 1; }
.soon-slide.is-base { transform: translateZ(0) scale(1); } /* resting state — exactly like a single-image card */
.soon-slide.is-zoom { animation: soonSlideZoom 4s cubic-bezier(.45, .05, .55, .95) forwards; } /* gentle ease-in start — no kick after the zoom-in hand-off */
@keyframes soonSlideZoom { from { transform: translateZ(0) scale(1.16); } to { transform: translateZ(0) scale(1); } }

.soon-card__shade {
  position: absolute; inset: -2px; pointer-events: none; z-index: 1;
  background: linear-gradient(to top, rgba(8,11,8,.96) 0%, rgba(8,11,8,.78) 32%, rgba(8,11,8,.45) 58%, rgba(8,11,8,.16) 82%, rgba(8,11,8,.04) 100%);
  transition: opacity .6s var(--ease-out);
}
/* copy block: anchored to bottom but lifted up (title sits ~2/3 height like the reference);
   on hover the bottom padding shrinks and the description fills the space below */
.soon-card__overlay {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
  padding: calc(22px * var(--soon-scale)) calc(24px * var(--soon-scale)) calc(118px * var(--soon-scale));
  display: flex; flex-direction: column; gap: calc(10px * var(--soon-scale));
  transition: padding-bottom .65s var(--ease-out);
}
.soon-card:hover .soon-card__overlay,
.soon-card.is-open .soon-card__overlay { padding-bottom: calc(58px * var(--soon-scale)); }
.soon-card__overlay { transition-duration: .9s; }
.soon-card__title { font-size: calc(1.3rem * var(--soon-scale)); font-weight: 800; line-height: 1.5; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
/* the same creamy glowing corner circle as the project cards */
.soon-card__dot {
  position: absolute; bottom: calc(22px * var(--soon-scale)); z-index: 3;
  width: calc(20px * var(--soon-scale)); height: calc(20px * var(--soon-scale)); border-radius: 50%;
  background: radial-gradient(125% 125% at 35% 28%, #fcfdfa, #d7dccf);
  box-shadow: 0 4px 11px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.85);
  transition: width .5s var(--ease-out), height .5s var(--ease-out), box-shadow .55s var(--ease-out);
}
html[dir="rtl"] .soon-card__dot { left: calc(22px * var(--soon-scale)); right: auto; }
html[dir="ltr"] .soon-card__dot { right: calc(22px * var(--soon-scale)); left: auto; }
.soon-card:hover .soon-card__dot,
.soon-card.is-open .soon-card__dot {
  width: calc(27px * var(--soon-scale)); height: calc(27px * var(--soon-scale));
  box-shadow: 0 6px 16px rgba(0,0,0,.48), 0 0 13px rgba(255,255,255,.16), inset 0 1px 0 rgba(255,255,255,.9);
}
/* description: hidden, slides up on hover/tap; inner text auto-scrolls at reading speed.
   Soft fade masks at top+bottom so lines melt in/out instead of being cut. */
.soon-card__descwrap {
  max-height: 0; opacity: 0; overflow: hidden;
  --fade: calc(22px * var(--soon-scale));
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
  transition: max-height .9s var(--ease-out), opacity .85s var(--ease-out);
}
.soon-card:hover .soon-card__descwrap,
.soon-card.is-open .soon-card__descwrap { max-height: var(--descmax, 150px); opacity: 1; }
.soon-card__desc {
  margin: 0; font-size: calc(.95rem * var(--soon-scale)); line-height: 1.9; color: var(--text-soft); text-wrap: pretty;
  padding-block: calc(22px * var(--soon-scale)); /* room for the fade masks so text starts/ends inside them */
  transform: translateY(0);
  transition: transform .45s var(--ease-out); /* quick reset on leave */
}
/* auto-scroll: --scrolldist/--scrolldur set per-card in JS (0 when text fits).
   Gentle ease-in over the first 15%, CONSTANT reading speed through the middle,
   then a soft ease-out over the last 12% so the text settles instead of stopping dead. */
.soon-card:hover .soon-card__desc,
.soon-card.is-open .soon-card__desc {
  transform: translateY(calc(-1 * var(--scrolldist, 0px)));
  transition: transform var(--scrolldur, 0s) cubic-bezier(.33, .05, .67, .95);
  transition: transform var(--scrolldur, 0s) linear(0, 0.0024 2.5%, 0.0096 5%, 0.0217 7.5%, 0.0385 10%, 0.0602 12.5%, 0.0867 15%, 0.9306 88%, 0.961 91%, 0.9827 94%, 0.9957 97%, 1 100%);
}
@media (max-width: 520px) { .soon-track { --soon-w: min(74vw, 310px); } }

/* ---------- SCHOOL (full-bleed image background, rounded card — same pattern as CTA) ---------- */
.school {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(520px, 70vh, 760px);
  display: flex; align-items: center;
  padding-block: clamp(56px, 9vw, 120px);
  border-radius: var(--r-xl) var(--r-xl) 0 0; /* top corners only — the image runs on under the footer */
  z-index: 1;
}
.school__bg { position: absolute; inset: 0; z-index: -2; border-radius: inherit; }

/* ---------- mouse-perspective drift for full-bleed backgrounds (intro / cta / school) ----------
   JS (initBgParallax) lerps transform each frame; base scale hides the drift margins. */
.intro__bg, .cta__bg, .school__bg { transform: scale(1.1); will-change: transform; }
.intro__bg video, .cta__bg video, .school__bg video { will-change: transform; }
/* radial bloom anchored under the copy (RTL = right), fading out toward the image so the text stays readable */
.school::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(125% 138% at 100% 50%,
      var(--bg) 0%, rgba(14,18,14,.82) 28%, rgba(14,18,14,.36) 52%, transparent 76%);
}
html[dir="ltr"] .school::after {
  background: radial-gradient(125% 138% at 0% 50%,
      var(--bg) 0%, rgba(14,18,14,.82) 28%, rgba(14,18,14,.36) 52%, transparent 76%);
}
.school__inner { position: relative; z-index: 1; margin-block-end: clamp(90px, 16vh, 200px); /* copy sits well above the vertical centre */ }
.school-copy { max-width: 600px; }
.school-copy .h2 { margin: 0 0 18px; }
.school-actions { margin-top: 28px; }
@media (max-width: 760px) { .school { min-height: clamp(440px, 66vh, 600px); } }

/* ---------- INNER PAGE HERO (sub pages) ---------- */
.page-hero { padding-top: calc(var(--header-h) + clamp(56px, 9vw, 110px)); padding-bottom: clamp(30px, 5vw, 56px); text-align: center; }
.page-hero .display { max-width: 20ch; margin-inline: auto; }
.page-hero .lead { margin: 16px auto 0; max-width: 52ch; }
.page-hero__glow { position: absolute; inset-inline: 0; top: 0; height: 60%; z-index: -1;
  background: radial-gradient(60% 100% at 50% 0%, rgba(71,210,126,.12), transparent 70%); }

/* media (animated title) variant — start-aligned, never centered */
.page-hero--media { text-align: start; padding-top: calc(var(--header-h) + clamp(40px, 6vw, 72px)); padding-bottom: clamp(40px, 6vw, 72px); }
.page-hero--media .page-hero__glow { background: radial-gradient(55% 100% at var(--glow-x, 18%) 0%, rgba(71,210,126,.12), transparent 70%); }
.page-title-gif { display: flex; justify-content: flex-start; }
.page-title-gif__v { display: block; width: min(560px, 80%); height: auto; aspect-ratio: 639 / 239;
  opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.page-title-gif__v.is-ready { opacity: 1; transform: none; }
/* when the uploaded title source is a GIF/image we swap in an <img>; let it keep its own ratio */
.page-title-gif__img { aspect-ratio: auto; object-fit: contain; }
.page-title-gif__slot { display: flex; align-items: center; justify-content: center; text-align: center;
  width: min(560px, 80%); aspect-ratio: 639 / 239; border-radius: var(--r-lg);
  border: 1.5px dashed var(--border-strong); color: var(--text-faint);
  background: linear-gradient(135deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  font-size: clamp(.95rem, 1.6vw, 1.15rem); padding: 18px; }
@media (prefers-reduced-motion: reduce) { .page-title-gif__v { opacity: 1; transform: none; transition: none; } }
.page-hero--media .lead { margin: clamp(12px, 2vw, 20px) 0 0; max-width: 56ch; }
html[dir="ltr"] .page-hero--media { --glow-x: 18%; }
html[dir="rtl"] .page-hero--media { --glow-x: 82%; }
@media (max-width: 560px) {
  .page-title-gif__v { width: min(420px, 92%); }
}

/* ---------- FILTER BAR ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: clamp(36px, 5vw, 52px); }

/* ---------- SERVICES LIST ---------- */
/* ---------- SERVICES LIST (centered logo, collapse → expand on hover) ---------- */
.svc-list { display: flex; flex-direction: column; gap: clamp(16px, 2vw, 22px); }
.svc-row {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); border: 1px solid var(--border);
  min-height: var(--svc-h, clamp(112px, 11.5vw, 140px));
  display: flex; align-items: center; gap: clamp(18px, 3vw, 34px);
  padding: clamp(20px, 2.8vw, 32px) clamp(24px, 4vw, 48px);
  background: var(--bg-soft);
  transition: border-color .8s var(--ease-out), box-shadow .8s var(--ease-out);
}
/* the uploaded photo/gif fills the card; the shade keeps only the text (start) side readable */
.svc-row__media { position: absolute; inset: -2px; z-index: 0; }
.svc-row__shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
html[dir="rtl"] .svc-row__shade { background: linear-gradient(to left, var(--bg) 30%, rgba(14,18,14,.55) 52%, transparent 86%); }
html[dir="ltr"] .svc-row__shade { background: linear-gradient(to right, var(--bg) 30%, rgba(14,18,14,.55) 52%, transparent 86%); }
/* logo: on the side, vertically centered (top-to-bottom) */
.svc-row__logo { position: relative; z-index: 2; flex: none; align-self: center;
  width: clamp(54px, 6vw, 74px); height: clamp(54px, 6vw, 74px); color: var(--text); opacity: .92;
  background-position: center; background-repeat: no-repeat; background-size: contain; }
.svc-row__logo-fb { width: 100%; height: 100%; }
.svc-row__logo.has-media .svc-row__logo-fb { display: none; }   /* uploaded logo replaces the fallback icon */
.svc-row__body { position: relative; z-index: 2; flex: 1 1 auto; max-width: 62%; align-self: center;
  display: flex; flex-direction: column; }
.svc-row__name { font-size: clamp(1.6rem, 2.7vw, 2.2rem); font-weight: 800; color: var(--accent-bright); }
/* description: the first sentence (summary) always shows; the rest reveals on hover
   with a soft, long ease (both opening and closing). non-hovered rows stay summarized → accordion */
.svc-row__desc { font-size: clamp(1.06rem, 1.5vw, 1.26rem); line-height: 1.85;
  color: var(--text-soft); max-width: 54ch; text-wrap: pretty; margin: 10px 0 0; }
.svc-row__sum { display: block; }
.svc-row__more { display: block; max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 1s cubic-bezier(.33, 0, .2, 1), opacity .85s ease, margin-top 1s cubic-bezier(.33, 0, .2, 1); }
.svc-row.is-open {
  border-color: var(--accent); box-shadow: 0 18px 42px -22px rgba(0,0,0,.7); }
/* the reveal rule `html.reveal-anim [data-reveal]` overrides .svc-row's transition (opacity/transform
   only), so the green border would SNAP on hover. Restate at higher specificity so the stroke
   fades in/out smoothly — in sync with the box open/close (same fix as cards/pills). */
html.reveal-anim .svc-row[data-reveal] {
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out),
              border-color .8s var(--ease-out), box-shadow .8s var(--ease-out); }
.svc-row.is-open .svc-row__more { max-height: var(--more-h, 22em); opacity: 1; margin-top: .35em; }
/* closed card: the summary trails off with an ellipsis to signal there's more on hover */
.svc-row:not(.is-open) .svc-row__sum:not(:last-child)::after {
  content: "…"; color: var(--accent-bright); margin-inline-start: .15em; font-weight: 700; }
/* "مشاهده <service> ←" — the always-visible link into the filtered projects list */
.svc-row__cta {
  display: inline-flex; align-items: center; gap: .5em; align-self: start; width: fit-content;
  margin-top: 16px; font-weight: 800; text-decoration: none; color: var(--text);
  font-size: clamp(1.02rem, 1.4vw, 1.16rem); letter-spacing: 0;
  transition: color .45s var(--ease-out), gap .45s var(--ease-out); }
.svc-row__cta-arrow { width: 1.05em; height: 1.05em; flex: none;
  transition: transform .45s var(--ease-out); }
html[dir="ltr"] .svc-row__cta-arrow { transform: scaleX(-1); }
.svc-row:hover .svc-row__cta, .svc-row.is-open .svc-row__cta { color: var(--accent-bright); }
.svc-row__cta:hover { color: var(--accent-bright); gap: .72em; }
html[dir="rtl"] .svc-row__cta:hover .svc-row__cta-arrow { transform: translateX(-4px); }
html[dir="ltr"] .svc-row__cta:hover .svc-row__cta-arrow { transform: scaleX(-1) translateX(-4px); }
@media (max-width: 640px) {
  /* phone: stacked card — logo on top, then name, summary, CTA. no cramped side-by-side. */
  .svc-row {
    --svc-h: auto; min-height: 0;
    flex-direction: column; align-items: stretch; gap: 12px;
    padding: 22px 20px; border-radius: var(--r-lg);
  }
  /* darken most of the card so text reads over any uploaded photo/gif */
  html[dir="rtl"] .svc-row__shade,
  html[dir="ltr"] .svc-row__shade {
    background: linear-gradient(to top, var(--bg) 30%, rgba(14,18,14,.82) 70%, rgba(14,18,14,.6)); }
  .svc-row__logo { width: 42px; height: 42px; align-self: flex-start; opacity: 1; }
  .svc-row__body { max-width: none; }
  .svc-row__name { font-size: 1.45rem; }
  .svc-row__desc { font-size: 1.02rem; line-height: 1.8; margin-top: 0; max-width: none; }
  .svc-row__cta { margin-top: 6px; font-size: 1.02rem; }
  .svc-row.is-open { box-shadow: 0 14px 32px -20px rgba(0,0,0,.7); }
}
/* touch: tap a card to open it (accordion via .is-open, set in JS) */

/* ---------- DETAIL LAYOUT ---------- */
/* top: breathing space under header → 16:9 film → title (anchored above the description) */
.detail-top { padding-top: calc(var(--header-h) + clamp(48px, 8vw, 104px)); padding-bottom: 0; }
.detail-title { font-size: clamp(1.7rem, 3.4vw, 2.7rem); font-weight: 800; line-height: 1.18;
  /* never truncate — always show the full title, wrapping to a second line if needed */
  text-wrap: balance; margin-top: clamp(26px, 3.4vw, 44px); }
.detail-body-sec { padding-top: clamp(22px, 3vw, 36px); }

/* 16:9 film frame */
.film { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg);
  border: 1px solid var(--border); overflow: hidden; background: #060806; }
/* true fullscreen: fill the screen, no rounded frame */
.film:fullscreen, .film:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; border-radius: 0; }
.film:fullscreen .vplayer__video, .film:-webkit-full-screen .vplayer__video { object-fit: contain; }
/* “cinema” fallback when the native fullscreen API is blocked (e.g. inside a frame) */
.film.is-cinema .vplayer { position: fixed; inset: 0; z-index: 1300; width: 100vw; height: 100vh; border: 0; border-radius: 0; background: #000; }
.film.is-cinema .vplayer__video { object-fit: contain; }
/* floating mini-player (“شناور”): dock to a corner so you can keep watching while scrolling.
   The .film keeps its place in the layout (no jump) — only the inner player floats. */
.film.is-docked .vplayer { position: fixed; z-index: 1250; inset: auto; width: min(360px, 82vw); height: auto; aspect-ratio: 16 / 9;
  inset-block-end: 24px; inset-inline-end: 24px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--accent); box-shadow: 0 24px 60px -16px rgba(0,0,0,.72); background: #060806;
  animation: dockIn .35s var(--ease-out); }
@keyframes dockIn { from { opacity: 0; transform: translateY(20px) scale(.94); } to { opacity: 1; transform: none; } }
.vplayer__dockx { position: absolute; z-index: 7; inset-block-start: 8px; inset-inline-end: 8px;
  width: 30px; height: 30px; border-radius: 50%; display: none; place-items: center; cursor: pointer;
  background: rgba(8,12,8,.6); border: 1px solid rgba(255,255,255,.2); color: var(--text); transition: color .25s, border-color .25s; }
.vplayer__dockx svg { width: 15px; height: 15px; }
.vplayer__dockx:hover { color: var(--accent-bright); border-color: var(--accent); }
.film.is-docked .vplayer__dockx { display: grid; }
.film.is-docked .vplayer__big { display: none; }
/* empty / poster state */
.film__empty { position: absolute; inset: 0; display: grid; place-items: center; cursor: default;
  background-size: cover; background-position: center; }
/* image-only output: a clean cover image (no video) — click to enlarge */
.film__cover { cursor: zoom-in; }
.film__cover::after { content: ""; position: absolute; inset: 0; background: rgba(6,9,6,0); transition: background .4s var(--ease-out); }
.film__cover:hover::after { background: rgba(6,9,6,.22); }
.film__hint { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--text); text-align: center; transition: transform .4s var(--ease-out); }
.film__empty:hover .film__hint { transform: translateY(-4px); }
.film__hint svg { width: 58px; height: 58px; color: var(--accent-bright);
  background: rgba(8,12,8,.5); border-radius: 50%; padding: 14px; box-shadow: 0 0 28px var(--accent-glow); }
.film__hint em { font-style: normal; font-size: 1rem; font-weight: 600; }

/* custom video player */
.vplayer { position: absolute; inset: 0; background: #060806; }
.vplayer__video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; }
.vplayer__big { position: absolute; inset: 0; margin: auto; width: 86px; height: 86px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(8,12,8,.5); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text); box-shadow: 0 0 30px rgba(0,0,0,.5);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), color .35s, border-color .35s; }
.vplayer__big svg { width: 34px; height: 34px; margin-inline-start: 3px; }
.vplayer__big:hover { color: var(--accent-bright); border-color: var(--accent); transform: scale(1.06); }
.vplayer[data-state="playing"] .vplayer__big { opacity: 0; pointer-events: none; transform: scale(.8); }
/* control bar */
.vplayer__bar { position: absolute; inset-inline: 0; inset-block-end: 0; z-index: 5; direction: ltr;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px 13px;
  background: linear-gradient(to top, rgba(4,7,4,.86), rgba(4,7,4,.36) 60%, transparent);
  opacity: 0; transform: translateY(6px); transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); }
.vplayer:hover .vplayer__bar, .vplayer[data-state="paused"] .vplayer__bar, .vplayer[data-state="idle"] .vplayer__bar { opacity: 1; transform: none; }
.vplayer__bar button { color: var(--text); cursor: pointer; display: grid; place-items: center; flex: none;
  transition: color .25s; }
.vplayer__bar button:hover { color: var(--accent-bright); }
.vplayer__pp svg, .vplayer__mute svg, .vplayer__fs svg, .vplayer__pip svg { width: 22px; height: 22px; display: block; }
/* the float button is redundant while the player is already floating */
.film.is-docked .vplayer__pip { display: none; }
.vplayer__t { font-size: .82rem; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums; flex: none; min-width: 36px; text-align: center; }
.vplayer__track { position: relative; flex: 1 1 auto; height: 16px; display: flex; align-items: center; cursor: pointer; }
.vplayer__track::before { content: ""; position: absolute; inset-inline: 0; height: 4px; border-radius: 999px; background: rgba(255,255,255,.22); }
.vplayer__buf { position: absolute; inset-inline-start: 0; height: 4px; width: 0; border-radius: 999px; background: rgba(255,255,255,.3); }
.vplayer__fill { position: absolute; inset-inline-start: 0; height: 4px; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright)); box-shadow: 0 0 8px var(--accent-glow); }
.vplayer__knob { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-bright);
  transform: translate(-50%, -50%); box-shadow: 0 0 10px var(--accent-glow); opacity: 0; transition: opacity .25s; }
.vplayer__track:hover .vplayer__knob, .vplayer:hover .vplayer__knob { opacity: 1; }
/* volume dimmer */
.vplayer__vol { position: relative; display: flex; align-items: center; gap: 0; flex: none; }
.vplayer__voltrack { position: relative; width: 0; height: 14px; display: flex; align-items: center; cursor: pointer;
  overflow: hidden; opacity: 0; transition: width .3s var(--ease-out), opacity .3s var(--ease-out); }
.vplayer__vol:hover .vplayer__voltrack { width: 64px; opacity: 1; margin-inline-start: 8px; }
.vplayer__voltrack::before { content: ""; position: absolute; inset-inline: 0; height: 4px; border-radius: 999px; background: rgba(255,255,255,.22); }
.vplayer__volfill { position: absolute; left: 0; height: 4px; width: 100%; border-radius: 999px; background: var(--accent-bright); }
.vplayer__volknob { position: absolute; top: 50%; left: 100%; width: 11px; height: 11px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); }
/* quality switcher */
.vplayer__quality { position: relative; flex: none; }
.vplayer__gear { display: inline-flex; align-items: center; gap: 6px; }
.vplayer__gear svg { width: 20px; height: 20px; }
.vplayer__qlabel { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vplayer__qmenu { position: absolute; inset-block-end: calc(100% + 10px); inset-inline-end: 0; z-index: 8;
  display: flex; flex-direction: column; min-width: 110px; padding: 6px; border-radius: 12px;
  background: rgba(10,14,10,.94); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.8); }
.vplayer__qmenu[hidden] { display: none; }
.vplayer__qmenu button { padding: 9px 12px; border-radius: 8px; text-align: start; color: var(--text-soft);
  font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.vplayer__qmenu button:hover { background: rgba(255,255,255,.08); color: var(--text); }
.vplayer__qmenu button.is-on { color: var(--accent-bright); }
.vplayer__qmenu button.is-on::after { content: " ✓"; }

.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.detail-aside { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 20px; }
.toc { padding: 24px; }
.toc h4, .learn h4, .svc-box h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
/* TOC heading doubles as a tap-target on mobile (collapsible box) */
.toc__head { width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  font-size: 1.05rem; font-weight: 700; color: var(--text); background: none; border: 0; padding: 0; text-align: start; cursor: default; }
.toc__caret { display: none; margin-inline-start: auto; width: 18px; height: 18px; color: var(--accent-bright);
  transition: transform .35s var(--ease-out); flex: none; }
.toc ul { display: flex; flex-direction: column; gap: 4px; }
.toc a { color: var(--text-muted); font-size: .94rem; padding: 8px 12px; border-radius: 8px; display: block; transition: all .2s; border-inline-start: 2px solid transparent; }
/* active state always applies; hover only on real pointer devices so a tap on touch
   doesn't leave a second item stuck-highlighted alongside the scroll-spy active one */
.toc a.active { color: var(--text); background: var(--surface); border-inline-start-color: var(--accent); }
@media (hover: hover) {
  .toc a:hover { color: var(--text); background: var(--surface); border-inline-start-color: var(--accent); }
}
.learn { padding: 24px; }
.learn ul { display: flex; flex-direction: column; gap: 12px; }
.learn li { color: var(--text-soft); font-size: .92rem; padding-inline-start: 26px; position: relative; line-height: 1.7; }
.learn li::before { content: ""; position: absolute; inset-inline-start: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.svc-box { padding: 24px; }
.svc-box__item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.svc-box__item:last-child { border-bottom: none; }
.svc-box__item h5 { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; font-weight: 700; margin-bottom: 8px; }
.svc-box__item h5 svg { width: 22px; height: 22px; color: var(--accent); }
.svc-box__item p { color: var(--text-muted); font-size: .88rem; line-height: 1.8; }

.article-body section[id] { scroll-margin-top: calc(var(--header-h) + 24px); }
.article-body h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); font-weight: 800; margin: 40px 0 16px; }
.article-body h2:first-child,
.article-body section:first-child h2 { margin-top: 0; }
.article-body p { color: var(--text-soft); font-size: clamp(1.12rem, 1.5vw, 1.32rem); line-height: 2.05; margin-bottom: 18px; text-wrap: pretty; }
.article-body .accent-word { color: var(--accent); }

/* ---------- GALLERY (hover lift like home-page logos, click to enlarge) ---------- */
/* legacy cover + simple gallery cells still used by article.html */
.detail-hero-img { aspect-ratio: 21/9; border-radius: var(--r-lg); border: 1px solid var(--border); margin-bottom: clamp(34px, 5vw, 56px); }
.gallery-grid > .ph { aspect-ratio: 4 / 3; border-radius: var(--r-md); }
.gallery-wrap { margin-top: clamp(48px, 6vw, 80px); }
.gallery-wrap .h3 { margin-bottom: clamp(20px, 2.6vw, 32px); }
/* smaller thumbnails — more, smaller cells */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: clamp(12px, 1.3vw, 18px); }
.gcard { position: relative; isolation: isolate; cursor: pointer; }
.gcard__img { aspect-ratio: 4 / 3; border-radius: var(--r-md); border: 1px solid var(--border);
  background-size: cover; background-position: center;
  transition: transform .5s var(--ease-out), border-color .5s var(--ease-out), box-shadow .55s var(--ease-out), filter .5s var(--ease-out); }
/* same lift as the home-page logo cards — but no extra background panel */
.gcard:hover .gcard__img { transform: translateY(-10px); border-color: var(--accent);
  box-shadow: 0 26px 44px -24px rgba(0,0,0,.72); filter: brightness(1.04); }
.gcard__img--empty { display: grid; place-items: center; }
@media (max-width: 520px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- LIGHTBOX ---------- */
.lightbox { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: clamp(20px, 4vw, 60px); }
.lightbox[hidden] { display: none; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(4,7,4,.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lightbox__inner { position: relative; z-index: 1; width: min(1100px, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: lbIn .4s var(--ease-out); }
@keyframes lbIn { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
.lightbox__stage { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-lg); border: 1px solid var(--border);
  background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #060806; }
/* arrows live in a centered row BELOW the image (never on top of it); close sits below them.
   force LTR so ‹ is always on the left (= previous) and › on the right (= next) */
.lightbox__bar { display: flex; direction: ltr; align-items: center; justify-content: center; gap: 22px; }
.lightbox__close { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid var(--border); color: var(--text); transition: color .3s, border-color .3s, background .3s; }
.lightbox__close svg { width: 20px; height: 20px; }
.lightbox__close:hover { color: var(--accent-bright); border-color: var(--accent); background: rgba(255,255,255,.12); }
/* prev / next arrows (also driven by ← → keys) — inline, below the image */
.lightbox__nav { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none;
  background: rgba(10,14,10,.6); border: 1px solid rgba(255,255,255,.18); color: var(--text);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: color .3s, border-color .3s, background .3s, transform .3s; }
.lightbox__nav svg { width: 26px; height: 26px; }
.lightbox__nav:hover { color: var(--accent-bright); border-color: var(--accent); background: rgba(10,14,10,.8); transform: translateY(-2px); }
/* single-image mode (a film-less cover) — hide prev/next */
.lightbox.is-single .lightbox__bar { display: none; }

/* ---------- RELATED PROJECTS (no background, centered pill title, horizontal scroller) ---------- */
.related-sec { background: transparent; padding-block: clamp(48px, 7vw, 96px); overflow: hidden; }
.related-head { display: flex; justify-content: center; margin-bottom: clamp(32px, 4vw, 52px); }
/* horizontal swipe row, like the home "coming soon" row */
.related-scroller { overflow-x: hidden; cursor: grab; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none; }
.related-scroller::-webkit-scrollbar { display: none; }
.related-scroller.is-dragging { cursor: grabbing; }
.related-scroller.is-dragging .pcard { pointer-events: none; }
/* the related cards are heavy glass panels (backdrop-filter); their long hover
   transitions fight the 1:1 drag and make it feel choppy. Freeze every card
   transition while dragging and promote the track to its own layer so the
   scroll repaints cheaply — this is what makes it glide like the "soon" row. */
.related-scroller.is-dragging .pcard,
.related-scroller.is-dragging .pcard * { transition: none !important; }
.related-track { will-change: transform; }
.related-scroller.is-dragging .related-track { will-change: scroll-position; }
.related-track { display: flex; align-items: stretch; gap: clamp(18px, 2vw, 28px); padding-inline: clamp(20px, 5vw, 80px); padding-block: 34px 44px; width: max-content; }
.related-track .pcard { flex: 0 0 clamp(300px, 26vw, 380px); width: clamp(300px, 26vw, 380px); }
@media (hover: none) {
  .related-scroller { overflow-x: auto; scroll-snap-type: x mandatory; }
  .related-track .pcard { scroll-snap-align: center; }
}
/* phone: related cards match the project-listing card size (near full-width, one per view) */
@media (max-width: 560px) {
  .related-track { gap: 16px; padding-inline: 7vw; padding-block: 22px 30px; align-items: stretch; }
  .related-track .pcard { flex: 0 0 86vw; width: 86vw; max-width: 440px; }
  .related-track .pcard__title { font-size: 1.5rem; }
  /* same fixed excerpt height as the listing cards so every card is equal height
     and the corner circle lands at the same spot on all of them */
  .related-track .pcard__excerpt { font-size: 1.02rem; min-height: calc(1.02rem * 1.65 * 4); }
}

/* on touch there is no hover, so keep the volume slider always visible & tappable */
@media (hover: none) {
  .vplayer__voltrack { width: 52px; opacity: 1; margin-inline-start: 8px; }
}

@media (max-width: 860px) {
  /* stack columns and let aside children order independently around the body:
     TOC + “what you'll learn” come BEFORE the text, services come AFTER it.
     every block is full-width (like the services box) — align-items:stretch + width:100% */
  .detail-grid { display: flex; flex-direction: column; align-items: stretch; gap: clamp(22px, 4vw, 32px); }
  .detail-aside { display: contents; }
  .detail-grid #detail-toc { order: 1; }
  .detail-grid .learn { order: 2; }
  .detail-grid .article-body { order: 3; }
  .detail-grid .svc-box { order: 4; }
  .detail-grid #detail-toc, .detail-grid .learn, .detail-grid .svc-box,
  .detail-grid .toc, .detail-grid .glass { width: 100%; }
  /* TOC becomes a tap-to-open list box */
  .toc__head { cursor: pointer; margin-bottom: 0; }
  .toc__caret { display: block; }
  .toc ul { overflow: hidden; max-height: 0; opacity: 0; margin-top: 0;
    transition: max-height .4s var(--ease-out), opacity .3s var(--ease-out), margin-top .4s var(--ease-out); }
  .toc.is-open ul { max-height: 60vh; opacity: 1; margin-top: 14px; }
  .toc.is-open .toc__caret { transform: rotate(180deg); }
}

/* ---- phone typography + control sizing for the detail pages ---- */
@media (max-width: 560px) {
  .detail-top { padding-top: calc(var(--header-h) + 26px); }
  .detail-title { font-size: 1.5rem; margin-top: 18px; text-align: center; }
  .article-body h2 { font-size: 1.28rem; margin: 30px 0 12px; }
  .article-body p { font-size: 1.04rem; line-height: 1.95; }
  .toc, .learn, .svc-box { padding: 18px; }
  .toc h4, .learn h4, .svc-box h4 { font-size: 1rem; }
  .gallery-wrap .h3 { font-size: 1.45rem; }
  /* tidy the player control bar so icons never crowd/overflow */
  .vplayer__bar { gap: 9px; padding: 11px 11px 10px; }
  .vplayer__t { min-width: 30px; font-size: .74rem; }
  .vplayer__pp svg, .vplayer__mute svg, .vplayer__fs svg { width: 20px; height: 20px; }
  .vplayer__gear svg { width: 18px; height: 18px; }
  .vplayer__big { width: 70px; height: 70px; }
  .vplayer__big svg { width: 28px; height: 28px; }
  .lightbox__nav { width: 48px; height: 48px; }
  .lightbox__nav svg { width: 23px; height: 23px; }
}

/* ---------- CONTACT / FORMS ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr .9fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.form-tabs { position: relative; display: inline-flex; gap: 6px; padding: 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); margin-bottom: 28px; }
.form-tab { position: relative; z-index: 1; padding: 11px 24px; border-radius: var(--r-pill); font-weight: 600; font-size: .95rem; color: var(--text-muted); transition: color .4s var(--ease-out); }
.form-tab.is-active { color: #06160d; background: transparent; }
/* the green pill slides left/right behind the active tab — no cut, fully eased */
.form-tabs__thumb { position: absolute; top: 6px; bottom: 6px; left: 0; width: 0; z-index: 0;
  border-radius: var(--r-pill); background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  box-shadow: 0 6px 16px -8px var(--accent-glow); will-change: transform, width;
  transition: transform .5s var(--ease-out), width .5s var(--ease-out); }

/* both forms share one grid cell so the panel swap is a smooth simultaneous crossfade (no height jump) */
.form-stack { display: grid; }
.form-stack > .form-panel { grid-area: 1 / 1; }
.form-panel { padding: clamp(24px, 3vw, 36px);
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }
.form-panel.is-hidden { opacity: 0; transform: translateY(14px) scale(.99); pointer-events: none; }
.form-panel[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label { font-size: .9rem; font-weight: 600; color: var(--text-soft); }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: .98rem; transition: border-color .2s, box-shadow .2s; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field textarea { resize: vertical; min-height: 120px; line-height: 1.8; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.form-note { margin-top: 6px; padding: 14px 18px; border-radius: var(--r-md); background: var(--accent-tint); border: 1px solid var(--accent-dim); color: var(--accent-bright); font-size: .92rem; font-weight: 600; opacity: 0; max-height: 0; overflow: hidden; transition: opacity .3s, max-height .3s, margin .3s; }
.form-note.show { opacity: 1; max-height: 80px; margin-top: 16px; }

.contact-info { display: flex; flex-direction: column; gap: 18px; }
.info-card { padding: 24px; display: flex; gap: 16px; align-items: flex-start; }
.info-card__icon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-tint); border: 1px solid var(--accent-dim); display: grid; place-items: center; flex: none; }
.info-card__icon svg { width: 22px; height: 22px; color: var(--accent); }
.info-card h4 { font-size: .82rem; color: var(--text-faint); font-weight: 600; margin-bottom: 6px; }
.info-card p, .info-card a { color: var(--text); font-size: 1rem; font-weight: 600; line-height: 1.7; }
.info-card .addr { font-weight: 400; color: var(--text-soft); font-size: .92rem; }
.map-ph { position: relative; overflow: hidden; aspect-ratio: 16/10; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--bg-soft); }
.map-ph__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* ---------- SEARCHABLE COMBOBOX (skill field) ---------- */
.combo { position: relative; }
/* multi-select field box: holds chips + the search input, looks like a normal field */
.combo__box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 8px 44px 8px 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color .2s, box-shadow .2s; cursor: text; }
.combo.is-open .combo__box, .combo__box:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.combo__input {
  flex: 1 1 120px; min-width: 110px; width: auto !important;
  padding: 5px 6px !important; margin: 0; min-height: 0;
  background: transparent !important; border: none !important; box-shadow: none !important;
  color: var(--text); font-size: .98rem; outline: none; }
.combo__chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 7px 6px 12px; border-radius: 999px;
  background: var(--accent-tint); border: 1px solid var(--accent-dim);
  color: var(--accent-bright); font-size: .86rem; font-weight: 600;
  white-space: nowrap; animation: comboChipIn .32s var(--ease-out) backwards; }
.combo__chip button {
  display: inline-grid; place-items: center; width: 18px; height: 18px;
  padding: 0; border-radius: 50%; line-height: 0;
  background: color-mix(in oklab, var(--accent) 24%, transparent); color: var(--accent-bright);
  transition: background .18s, color .18s; }
.combo__chip button svg { width: 11px; height: 11px; display: block; }
.combo__chip button:hover { background: var(--accent); color: #06120b; }
@keyframes comboChipIn { from { opacity: 0; transform: translateY(5px) scale(.82); } to { opacity: 1; transform: none; } }
.combo__caret { position: absolute; inset-inline-end: 16px; top: 26px; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-faint); pointer-events: none;
  transition: transform .35s var(--ease-out), color .35s var(--ease-out); }
.combo.is-open .combo__caret { transform: translateY(-50%) rotate(180deg); color: var(--accent-bright); }
.combo__list {
  position: absolute; inset-inline: 0; top: calc(100% + 8px); z-index: 40;
  max-height: 264px; overflow-y: auto; overflow-x: hidden; padding: 6px;
  background: color-mix(in oklab, var(--bg-soft) 92%, #000 8%);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: 0 24px 50px -22px rgba(0,0,0,.85);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  opacity: 0; transform: translateY(-8px) scale(.985); transform-origin: top;
  pointer-events: none; visibility: hidden;
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out), visibility 0s linear .28s; }
.combo.is-open .combo__list { opacity: 1; transform: none; pointer-events: auto; visibility: visible;
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out); }
.combo__group { padding: 10px 12px 6px; font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  color: var(--accent-bright); text-transform: none; opacity: .9; }
.combo__group:not(:first-child) { border-top: 1px solid var(--border); margin-top: 4px; }
.combo__opt { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px;
  font-size: .96rem; color: var(--text-soft); cursor: pointer; transition: background .18s, color .18s; }
.combo__opt:hover, .combo__opt.is-active { background: var(--accent-tint); color: var(--text); }
.combo__opt.is-selected { color: var(--text); }
.combo__opt.is-selected::after { content: "\2713"; margin-inline-start: auto; color: var(--accent-bright); font-weight: 700; }
.combo__empty { padding: 14px 12px; font-size: .92rem; color: var(--text-faint); text-align: center; }

/* list opens with each row sliding in from alternating sides, cascading top to bottom */
.combo__list > li { --i: 0; --from: -26px; }
.combo__list > li:nth-child(even) { --from: 26px; }
.combo.is-anim.is-open .combo__list > li {
  animation: comboRowIn .46s var(--ease-out) backwards;
  animation-delay: calc(var(--i) * 0.038s); }
@keyframes comboRowIn {
  from { opacity: 0; transform: translateX(var(--from)); }
  to   { opacity: 1; transform: translateX(0); } }

/* phone: standard stacked contact layout — full-width split tabs, snug panel + cards */
@media (max-width: 560px) {
  .contact-grid { gap: 22px; }
  .form-tabs { display: flex; width: 100%; gap: 4px; margin-bottom: 20px; }
  .form-tab { flex: 1; text-align: center; padding: 12px 8px; font-size: .92rem; }
  .form-panel { padding: 20px 16px; }
  .field { margin-bottom: 14px; }
  .field-row { gap: 12px; }
  .info-card { padding: 18px; gap: 14px; }
  .info-card__icon { width: 42px; height: 42px; }
  .contact-info { gap: 14px; }
}
