/* Edit styles and real insights, one pair at a time (#kurgu) — the founder, 2026-10-12: the
 * homepage's «تحول» gives way to the CV page's two showcases joined in one neat section: an edit
 * sample in one frame and a real insight in the other, side by side, moving on together and looping,
 * with a dotted rule between them so neither reads as the other's result. No plans button.
 * Markup: tools/collab-reel/build-collab-reel.mjs (data from the CV page and its media manifest);
 * behaviour: sinora-collab-reel.js. Theme root and fa/, equal.
 *
 * V2: the section frame (§7.2), one section one screen ≥1200 (§5.3: a 1280 × 720 composition at
 * --u = 1px that shrinks with the width and the room under the header), the house spring and
 * ease (§6), liquid-glass controls (§4). A pair arrives as a material: opacity, a small scale and
 * a blur that clears; transform, opacity and filter only. Reduced motion: no autoplay, instant
 * changes, a play button on the edit frame.
 *
 * Scoping: the theme sets h1–h6 with `!important` and sinora-redesign.css gives every button a
 * transition at (1,2,0); so the headline goes through the id and the controls through
 * `#kurgu.snx-cr`. */

#kurgu.snx-cr {
  --cr-dots: rgba(230, 186, 90, .5);
  --cr-frame: #0d0e0d;
  --u: 1px;
  container-type: inline-size;
  padding-block: 72px;
}
#kurgu .snx-disp { font-family: var(--f-disp) !important; font-weight: var(--disp-w) !important; letter-spacing: var(--disp-track); word-spacing: var(--disp-ws); }

/* ───────────────────────── one column (phones, tablets, portrait) ───────────────────────── */
/* the frames come right under the headline (V2 §5.4); the words that support them after */
#kurgu .cr__in { display: grid; grid-template-areas: "head" "stage" "body"; row-gap: 26px; }
#kurgu .cr__head { grid-area: head; text-align: center; }
#kurgu .cr__head .snx-eyebrow { justify-content: center; margin-bottom: 16px !important; }
#kurgu .cr__stage { grid-area: stage; }
#kurgu .cr__body { grid-area: body; text-align: center; }
#kurgu .cr-h { font-size: 30px; white-space: normal; }
#kurgu.snx--tr .cr-h { font-size: 29px; }
#kurgu .cr-lead { font-size: 15px; }
#kurgu .cr-facts { display: flex; justify-content: center; gap: 28px; margin: 18px 0 0; }
#kurgu .cr-facts div { display: grid; gap: 2px; text-align: start; }
#kurgu .cr-facts dt { color: var(--gold); font-size: 24px; font-weight: 800; line-height: 1.2; }
#kurgu .cr-facts dd { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

#kurgu .cr__stage { position: relative; width: min(100%, 560px); margin-inline: auto; }
/* the two frames and the dotted rule between them: a label row, then the frames */
#kurgu .cr-pair { --gap: 30px; --lab: 38px; --lab-gap: 8px; position: relative; display: grid; grid-template-columns: 1fr var(--gap) 1fr; }
#kurgu .cr-box { grid-row: 1; margin: 0; min-width: 0; }
#kurgu .cr-box--reel { grid-column: 1; }
#kurgu .cr-box--ins { grid-column: 3; }
#kurgu .cr-rule { position: absolute; inset-inline-start: calc(50% - 1px); top: calc(var(--lab) + var(--lab-gap) + 18px); bottom: 18px; width: 2px; pointer-events: none;
  background: radial-gradient(circle, var(--cr-dots) 1px, transparent 1.4px) center top / 2px 9px repeat-y; opacity: .8; }

/* one column: the name over its detail; a wide screen sets them side by side */
#kurgu .cr-label { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 1px; height: var(--lab); margin-bottom: var(--lab-gap); white-space: nowrap; overflow: hidden; }
#kurgu .cr-label b { color: var(--gold); font-size: 12.5px; font-weight: 700; }
#kurgu .cr-label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* a frame: 9:16, a gold hairline, the layers stacked in it */
#kurgu .cr-frame { position: relative; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; isolation: isolate; background: var(--cr-frame);
  box-shadow: 0 34px 80px rgba(0, 0, 0, .5); -webkit-user-select: none; user-select: none; }
#kurgu .cr-frame::after { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(145deg, rgba(247, 215, 133, .5), rgba(230, 186, 90, .14) 38%, rgba(230, 186, 90, .05) 62%, rgba(247, 215, 133, .36));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
#kurgu .cr-box--ins .cr-frame { background: radial-gradient(120% 80% at 50% 40%, #151816, #0b0c0b 70%); }

/* a pair arrives as a material and leaves the same way, both frames at once */
#kurgu .cr-layer { position: absolute; inset: 0; z-index: 1; opacity: 0; transform: scale(1.018); filter: blur(8px);
  transition: opacity .32s ease, transform .56s var(--spring), filter .42s ease; pointer-events: none; }
#kurgu .cr-layer.is-on { z-index: 2; opacity: 1; transform: none; filter: none; }
#kurgu .cr-layer.is-off { transform: scale(.985); filter: blur(5px); transition: opacity .22s ease-in, transform .22s ease-in, filter .22s ease-in; }
#kurgu .cr-layer :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#kurgu .cr-box--reel .cr-layer :is(img, video) { object-fit: cover; }
#kurgu .cr-box--ins .cr-layer img { object-fit: contain; }
#kurgu .cr-layer video { opacity: 0; transition: opacity .25s ease; }
#kurgu .cr-layer video.is-ready { opacity: 1; }

/* the clip's own time, as a gold hairline at the frame's foot */
#kurgu .cr-meter { position: absolute; inset-inline: 14px; bottom: 12px; z-index: 6; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .16); overflow: hidden; pointer-events: none; }
#kurgu .cr-meter i { position: absolute; inset: 0; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .25s linear; }
#kurgu.snx--tr .cr-meter i { transform-origin: left; }

/* reduced motion, or a browser that would not autoplay: the clip waits for a press */
#kurgu.snx-cr .cr-play { position: absolute; inset: 0; z-index: 7; margin: auto; display: grid; place-items: center; width: 64px; height: 64px; padding: 0; border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%; background: rgba(9, 10, 9, .55); color: var(--ink); cursor: pointer; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform .1s ease-out; }
#kurgu.snx-cr .cr-play:active { transform: scale(.97); }
#kurgu .cr-play svg { width: 24px; height: 24px; fill: currentColor; }

/* the controls: one row of liquid glass under both frames */
#kurgu .cr-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
#kurgu.snx-cr .cr-btn { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0; border-radius: 999px; cursor: pointer; color: var(--ink); font: inherit; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .055); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); -webkit-tap-highlight-color: transparent; transition: transform .1s ease-out, background-color .2s ease, border-color .2s ease; }
#kurgu.snx-cr .cr-btn:hover { background: rgba(255, 255, 255, .09); border-color: rgba(232, 212, 168, .3); }
#kurgu.snx-cr .cr-btn:active { transform: scale(.97); }
#kurgu.snx-cr .cr-btn:focus-visible, #kurgu.snx-cr .cr-play:focus-visible { outline: 2px solid var(--edge); outline-offset: 3px; }
#kurgu .cr-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#kurgu.snx--fa .cr-btn[data-cr-step="-1"] svg { transform: scaleX(-1); }
#kurgu.snx--tr .cr-btn[data-cr-step="1"] svg { transform: scaleX(-1); }
#kurgu.snx-cr .cr-sound { grid-auto-flow: column; gap: 8px; padding-inline: 16px; }
#kurgu .cr-pause .cr-i-play, #kurgu .cr-pause[aria-pressed="true"] .cr-i-pause { display: none; }
#kurgu .cr-pause[aria-pressed="true"] .cr-i-play { display: block; }
#kurgu .cr-sound .cr-loud, #kurgu .cr-sound[aria-pressed="true"] .cr-mute { display: none; }
#kurgu .cr-sound[aria-pressed="true"] .cr-loud { display: block; }
#kurgu .cr-sound[aria-pressed="true"] { border-color: rgba(232, 212, 168, .42); color: var(--edge); }
#kurgu .cr-status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@container (max-width: 380px) {
  #kurgu .cr-pair { --gap: 22px; }
  #kurgu .cr-frame { border-radius: 18px; }
}

/* ──────────── a landscape screen ≥1024: the 1280 × 720 composition at --u = 1px ──────────── */
@media (min-width: 1024px) and (min-aspect-ratio: 5/6) {
  #kurgu.snx-cr {
    --cr-head: calc(max(clamp(128px, 11vw, 176px) * 370 / 1200, 44px) + 29px);
    --u: clamp(.6px, min(calc(100cqw / 1280), calc((100svh - var(--cr-head) - 24px) / 720)), 1px);
    display: grid; align-items: center; min-height: calc(100svh - var(--cr-head)); padding-block: calc(24 * var(--u));
  }
  #kurgu .cr__in { grid-template-columns: calc(500 * var(--u)) calc(680 * var(--u)); grid-template-rows: 1fr 1fr; grid-template-areas: "head stage" "body stage"; row-gap: 0;
    column-gap: calc(100 * var(--u)); justify-content: center; align-items: center; width: auto; margin-inline: auto; }
  #kurgu .cr__head { align-self: end; text-align: start; }
  #kurgu .cr__head .snx-eyebrow { justify-content: flex-start; margin-bottom: calc(22 * var(--u)) !important; }
  #kurgu .cr__body { align-self: start; text-align: start; }
  #kurgu .cr-h { font-size: calc(46 * var(--u)); }
  #kurgu.snx--tr .cr-h { font-size: calc(44 * var(--u)); }
  #kurgu .cr-lead { padding-top: calc(26 * var(--u)); font-size: max(15px, calc(19 * var(--u))); }
  #kurgu .cr-facts { justify-content: flex-start; gap: calc(44 * var(--u)); margin-top: calc(36 * var(--u)); padding-top: calc(28 * var(--u)); border-top: 1px solid var(--hair); }
  #kurgu .cr-facts dt { font-size: calc(34 * var(--u)); }
  #kurgu .cr-facts dd { font-size: max(12.5px, calc(14 * var(--u))); }
  #kurgu .cr__stage { width: calc(680 * var(--u)); }
  #kurgu .cr-pair { --gap: calc(70 * var(--u)); --lab: max(24px, calc(28 * var(--u))); --lab-gap: calc(12 * var(--u)); grid-template-columns: calc(305 * var(--u)) var(--gap) calc(305 * var(--u)); }
  #kurgu .cr-frame { border-radius: calc(28 * var(--u)); }
  #kurgu .cr-label { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
  #kurgu .cr-label b { font-size: max(12.5px, calc(14 * var(--u))); }
  #kurgu .cr-label span { font-size: max(11.5px, calc(13 * var(--u))); }
  #kurgu .cr-controls { margin-top: calc(22 * var(--u)); }
  #kurgu.snx-cr .cr-btn { min-width: max(44px, calc(46 * var(--u))); height: max(44px, calc(46 * var(--u))); }
}

@media (prefers-reduced-motion: reduce) {
  #kurgu .cr-layer, #kurgu .cr-layer.is-off { transform: none; filter: none; transition: opacity .2s ease; }
  #kurgu .cr-meter i { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  #kurgu.snx-cr .cr-btn, #kurgu.snx-cr .cr-play { -webkit-backdrop-filter: none; backdrop-filter: none; background: #1a1b1a; }
}
@media (prefers-contrast: more) {
  #kurgu .cr-rule { --cr-dots: rgba(245, 210, 138, .95); }
  #kurgu.snx-cr .cr-btn { border-color: rgba(255, 255, 255, .5); }
}
@media (forced-colors: active) {
  #kurgu.snx-cr .cr-btn, #kurgu.snx-cr .cr-play { border: 2px solid ButtonText; }
  #kurgu .cr-rule { background: GrayText; width: 1px; }
}
