/* ============================================
   NARCY STUDIOS — SERVICES SPLIT VIEWER
   Loads after styles.css. Uses its tokens.
   Nothing here edits styles.css or main.js.
   ============================================ */

/* --- sticky prerequisites ---------------------------------------
   position:sticky dies if any ancestor is a scroll container.
   styles.css sets overflow:hidden on body and .section, which does
   exactly that. overflow:clip clips identically WITHOUT creating a
   scroll container, so sticky survives and the decos stay contained. */
body { overflow-x: clip; }
.section.svc-scroll { overflow: visible; }

.svc-scroll { border-top: 2px solid var(--ink); }

.svc-scroll__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding: 0 var(--gutter);
}

/* ---------- sticky stage ---------- */
.svc-stage {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}
.svc-stage__frame {
  position: relative;
  border: 2px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
}
.svc-stage__media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: var(--stage-ar, 4 / 5);
  max-height: min(58vh, 560px);
  height: auto;
  margin: 0 auto;
  transition: aspect-ratio 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.svc-stage__track {
  position: absolute;
  top: -7%;
  left: 0;
  width: 100%;
  height: 114%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.svc-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.svc-layer.is-on { opacity: 1; }
/* cutouts and wide posters are matted, not cropped */
.svc-layer.fit-contain { object-fit: contain; padding: 12%; }
.svc-layer.fit-fill { object-fit: cover; padding: 0; }

.svc-stage__bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.svc-stage__bar span,
.svc-stage__bar em { transition: opacity 0.3s ease; }
.svc-stage.is-swapping .svc-stage__bar span,
.svc-stage.is-swapping .svc-stage__bar em { opacity: 0; }
.svc-stage__bar em { color: var(--signal); font-style: normal; }
.svc-stage__idx {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  background: var(--signal);
  color: var(--paper);
  padding: 5px 9px;
}
.svc-stage__dots { display: flex; gap: 6px; margin-top: 12px; }
.svc-stage__dots button {
  flex: 1;
  height: 4px;
  border: none;
  padding: 0;
  background: var(--line-soft);
  cursor: pointer;
  transition: background 0.25s ease;
}
.svc-stage__dots button:hover { background: rgba(17, 17, 16, 0.4); }
.svc-stage__dots button.on { background: var(--signal); }

/* ---------- scrolling entries ---------- */
.svc-entries { padding: 0 0 40px; }

.svc-entry {
  padding: 56px 0 56px 26px;
  border-left: 2px solid var(--line-soft);
  scroll-margin-top: calc(var(--header-h) + 20px);
  transition: border-color 0.4s ease;
}
.svc-entry.is-active { border-left-color: var(--signal); }

.svc-entry__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--signal);
}
.svc-entry h3 {
  font-family: var(--display);
  font-size: clamp(24px, 3.4vw, 42px);
  text-transform: uppercase;
  line-height: 1;
  margin: 10px 0 14px;
  opacity: 0.34;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.svc-entry.is-active h3 { opacity: 1; }

.svc-entry .desc { max-width: 480px; color: rgba(17, 17, 16, 0.85); }
.svc-entry .fit { margin-top: 22px; }
.svc-entry .fit h5 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--signal);
}
.svc-entry .fit li {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  list-style: none;
}
.svc-entry .fit li::before { content: '\2192\00a0'; font-weight: 700; }
.svc-entry .fit ul { padding: 0; margin: 0; }
.svc-entry .fit li a { text-decoration: underline; }

/* scope box inside T-05 */
.svc-entry .scope-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 2px solid var(--ink);
  margin-top: 18px;
  max-width: 520px;
}
.svc-entry .scope-box > div { background: var(--paper); padding: 16px; }
.svc-entry .scope-box .mono { display: block; color: var(--signal); margin-bottom: 8px; }
.svc-entry .scope-box p { font-size: 13px; line-height: 1.5; }

/* inline image: mobile only */
.svc-entry__inline { display: none; margin: 0 0 18px; border: 2px solid var(--ink); }
.svc-entry__inline img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--paper); }
.svc-entry__inline img.fit-contain { object-fit: contain; padding: 12%; background: var(--paper); }
.svc-entry__inline figcaption {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.svc-entry__inline figcaption em { color: var(--signal); font-style: normal; }

@media (max-width: 900px) {
  .svc-scroll__inner { grid-template-columns: 1fr; gap: 0; }
  .svc-stage { display: none; }
  .svc-entry { padding: 36px 0 36px 18px; }
  .svc-entry h3 { opacity: 1; }
  .svc-entry__inline { display: block; }
  .svc-entry .desc { max-width: none; }
  .svc-entry .scope-box { grid-template-columns: 1fr; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-layer, .svc-entry h3, .svc-entry { transition: none; }
  .svc-stage__track { transform: none !important; }
}

/* ============================================
   CLICKABLE STAGE + INLINE MEDIA
   Uses the lightbox and cursor from archive.css / archive.js
   ============================================ */
.svc-stage__frame { cursor: pointer; }
.svc-entry__inline { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .svc-stage__frame, .svc-stage__frame *,
  .svc-entry__inline, .svc-entry__inline * { cursor: none; }
}

/* corner ticks, same affordance language as the archive */
.svc-stage__frame::after,
.svc-entry__inline::after {
  content: '';
  position: absolute;
  inset: 12px;
  pointer-events: none;
  z-index: 4;
  background:
    linear-gradient(var(--signal), var(--signal)) 0 0/18px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 0 0/2px 18px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 100% 0/18px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 100% 0/2px 18px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 0 100%/18px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 0 100%/2px 18px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 100% 100%/18px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 100% 100%/2px 18px no-repeat;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.svc-stage__frame:hover::after,
.svc-entry__inline:hover::after { opacity: 1; transform: none; }
.svc-entry__inline { position: relative; }

/* play badge appears only while the active service is the video track */
.svc-stage__play {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 3;
  pointer-events: none;
}
.svc-stage.has-video .svc-stage__play { display: grid; }
.svc-stage__play i {
  width: 72px;
  height: 72px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: rgba(17, 17, 16, 0.46);
  display: grid;
  place-items: center;
  transition: 0.3s;
}
.svc-stage__play i::before {
  content: '';
  border-left: 19px solid var(--paper);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 5px;
}
.svc-stage__frame:hover .svc-stage__play i {
  background: var(--signal);
  border-color: var(--signal);
  transform: scale(1.07);
}

/* touch: no hover, so the affordance stays visible */
.svc-media-badge {
  display: none;
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 4;
  width: 28px;
  height: 28px;
  background: var(--signal);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 28px;
  text-align: center;
}
@media (hover: none) {
  .svc-media-badge { display: block; }
  .svc-stage__frame::after, .svc-entry__inline::after { opacity: 0.55; transform: none; }
}
