/* ============================================
   NARCY STUDIOS — ARCHIVE
   Sectioned adaptive gallery + lightbox + player
   Loads after styles.css. Uses its tokens.
   ============================================ */

/* ---------- group header ---------- */
.arc-group { border-top: 2px solid var(--ink); position: relative; }
.arc-group:first-of-type { border-top: 2px solid var(--ink); }

.arc-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  padding: 36px var(--gutter) 20px;
}
.arc-head__id {
  font-family: var(--display);
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 0.82;
  color: var(--signal);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.arc-head__mid { min-width: 0; }
.arc-head__name {
  font-family: var(--display);
  font-size: clamp(17px, 2.3vw, 30px);
  line-height: 1;
  text-transform: uppercase;
}
.arc-head__rule {
  height: 2px;
  background: var(--ink);
  margin-top: 12px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.arc-group.in .arc-head__rule { transform: scaleX(1); }
.arc-head__meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.arc-head__meta b {
  display: block;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0;
}
.arc-head__note {
  padding: 0 var(--gutter) 22px;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(17, 17, 16, 0.72);
}

/* ---------- adaptive justified gallery ----------
   Each frame's width tracks its own aspect ratio, so every frame in a
   row lands at the same height with no cropping and no dead space.   */
.arc-gal {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 var(--gutter) 44px;
}
.arc-gal::after { content: ''; flex-grow: 1e9; flex-basis: 0; height: 0; }

.arc-frame {
  flex-grow: var(--ar, 1);
  flex-basis: calc(var(--ar, 1) * 230px);
  position: relative;
  border: 1px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.arc-frame img,
.arc-frame video {
  display: block;
  width: 100%;
  aspect-ratio: var(--ar, 1);
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.arc-frame:hover { border-color: var(--signal); transform: translateY(-3px); }
.arc-frame:hover img,
.arc-frame:hover video { transform: scale(1.03); }
.arc-frame:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.arc-frame.contain img { object-fit: contain; padding: 6%; }

/* cutout galleries: every box the same shape, artwork centred and matted.
   Trimmed PNG/WebP cutouts run edge to edge otherwise, and each one has a
   different bounding box, so the frames come out different sizes. */
.arc-gal.is-cutout .arc-frame {
  flex-grow: 0;
  flex-basis: 260px;
  max-width: 320px;
}
.arc-gal.is-cutout .arc-frame img {
  object-fit: contain;
  padding: 13%;
  background: var(--paper);
}
@media (max-width: 600px) {
  .arc-gal.is-cutout .arc-frame { flex-basis: 150px; max-width: none; }
  .arc-gal.is-cutout .arc-frame img { padding: 10%; }
}

/* corner ticks: the affordance, no instructions */
.arc-frame::after {
  content: '';
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(var(--signal), var(--signal)) 0 0/16px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 0 0/2px 16px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 100% 0/16px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 100% 0/2px 16px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 0 100%/16px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 0 100%/2px 16px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 100% 100%/16px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) 100% 100%/2px 16px no-repeat;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.arc-frame:hover::after { opacity: 1; transform: none; }
@keyframes tickHint {
  0%, 100% { opacity: 0; transform: scale(1.05); }
  25%, 55% { opacity: 1; transform: none; }
}
.arc-frame.hint::after { animation: tickHint 2.6s ease 2; }

.arc-frame__tag {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 4px 7px;
  opacity: 0;
  transform: translateY(-4px);
  transition: 0.25s ease;
}
.arc-frame:hover .arc-frame__tag {
  opacity: 1;
  transform: none;
  background: var(--signal);
  color: var(--paper);
  border-color: var(--signal);
}
.arc-frame__note {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--signal);
  color: var(--paper);
  padding: 4px 8px;
}

/* video tiles */
.arc-frame--video .arc-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  pointer-events: none;
}
.arc-frame--video .arc-play i {
  width: 58px;
  height: 58px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 16, 0.42);
  transition: 0.3s;
}
.arc-frame--video .arc-play i::before {
  content: '';
  border-left: 15px solid var(--paper);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}
.arc-frame--video:hover .arc-play i {
  background: var(--signal);
  border-color: var(--signal);
  transform: scale(1.08);
}

/* touch: no hover, so the affordance has to stay put */
.arc-frame__badge {
  display: none;
  position: absolute;
  bottom: 9px;
  right: 9px;
  z-index: 3;
  width: 26px;
  height: 26px;
  background: var(--signal);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 26px;
  text-align: center;
}
@media (hover: none) {
  .arc-frame__badge { display: block; }
  .arc-frame::after { opacity: 0.55; transform: none; }
}
@media (max-width: 600px) {
  .arc-head { grid-template-columns: 1fr; gap: 8px; padding-bottom: 14px; }
  .arc-head__meta { text-align: left; }
  .arc-head__meta b { display: inline; margin-right: 6px; }
  .arc-gal { gap: 10px; }
  .arc-frame { flex-basis: calc(var(--ar, 1) * 150px); }
}

/* ---------- cursor ---------- */
@media (hover: hover) and (pointer: fine) {
  .arc-gal, .arc-gal * { cursor: none; }
}
#nrcCur {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;
  pointer-events: none;
  width: 78px;
  height: 78px;
  margin: -39px 0 0 -39px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s, color 0.2s, border-color 0.2s;
}
#nrcCur.on { opacity: 1; }
#nrcCur.video { background: var(--signal); color: var(--paper); border-color: var(--signal); }
#nrcCur b { display: block; font-size: 19px; line-height: 1; margin-bottom: 2px; font-weight: 400; }

/* ---------- lightbox ---------- */
body.lb-open { overflow: hidden; }
.lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17, 17, 16, 0.94);
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 56px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lb.open { opacity: 1; pointer-events: auto; }
.lb__stage {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  transform: scale(0.96);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.lb.open .lb__stage { transform: none; }
.lb__media { border: 2px solid var(--paper); background: var(--ink); line-height: 0; }
.lb__media.on-paper { background: var(--paper); padding: clamp(18px, 4vw, 46px); }
.lb__media.on-paper img { max-height: 68vh; }
.lb__media img { max-width: min(92vw, 1500px); max-height: 78vh; width: auto; height: auto; display: block; }
.lb__media .np { border: 0; }
.lb__bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
}
.lb__bar em { color: var(--signal); font-style: normal; }
.lb__foot {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}
.lb__cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 13px 22px;
  border: 1px solid var(--paper);
  background: none;
  color: var(--paper);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.lb__cta:hover { background: var(--signal); border-color: var(--signal); color: var(--paper); }
.lb__cta b { font-weight: 400; color: var(--signal); }
.lb__cta:hover b { color: var(--paper); }
.lb__x, .lb__nav {
  position: fixed;
  background: none;
  border: 1px solid rgba(239, 237, 230, 0.5);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 16px;
  width: 46px;
  height: 46px;
  cursor: pointer;
  transition: 0.2s;
  z-index: 2;
}
.lb__x:hover, .lb__nav:hover { background: var(--signal); border-color: var(--signal); }
.lb__x { top: 20px; right: 20px; }
.lb__nav { top: 50%; margin-top: -23px; }
.lb__prev { left: 20px; }
.lb__next { right: 20px; }
.lb__hint {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(239, 237, 230, 0.45);
}
@media (max-width: 640px) {
  .lb__nav { display: none; }
  .lb__media img { max-height: 66vh; }
  .np video { max-height: 52vh; }
}

/* ---------- custom player ---------- */
.np { background: var(--ink); position: relative; line-height: 0; user-select: none; }
.np__stage { position: relative; line-height: 0; }
.np video {
  display: block;
  max-width: min(92vw, 1500px);
  max-height: 70vh;
  width: auto;
  height: auto;
  background: #000;
}
.np__big {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 86px;
  height: 86px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: rgba(17, 17, 16, 0.5);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.2s, border-color 0.2s;
}
.np__big::before {
  content: '';
  border-left: 22px solid var(--paper);
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  margin-left: 6px;
}
.np__big:hover { background: var(--signal); border-color: var(--signal); transform: scale(1.06); }
.np[data-state="playing"] .np__big { opacity: 0; pointer-events: none; transform: scale(1.3); }
.np__load {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(239, 237, 230, 0.18);
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.2s;
}
.np.is-waiting .np__load { opacity: 1; }
.np__load::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34%;
  background: var(--signal);
  animation: npLoad 1.1s linear infinite;
}
@keyframes npLoad { 0% { left: -34%; } 100% { left: 100%; } }

.np__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--ink);
  border-top: 2px solid var(--paper);
  line-height: 1;
}
.np__btn {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid rgba(239, 237, 230, 0.42);
  background: none;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.np__btn:hover { background: var(--signal); border-color: var(--signal); }
.np__btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.np__ico {
  display: block;
  width: 0;
  height: 0;
  border-left: 11px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  margin-left: 3px;
}
.np[data-state="playing"] .np__play .np__ico {
  width: 11px;
  height: 14px;
  border: none;
  margin: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0/3.5px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0/3.5px 100% no-repeat;
}
.np__scrub { position: relative; flex: 1; height: 26px; min-width: 60px; display: flex; align-items: center; }
.np__track { position: absolute; left: 0; right: 0; height: 4px; background: rgba(239, 237, 230, 0.22); }
.np__buffer { position: absolute; left: 0; height: 4px; width: 0; background: rgba(239, 237, 230, 0.38); }
.np__played { position: absolute; left: 0; height: 4px; width: 0; background: var(--signal); }
.np__range {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}
.np__range:focus { outline: none; }
.np__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--paper);
  border: 2px solid var(--signal);
  border-radius: 0;
  cursor: pointer;
}
.np__range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--paper);
  border: 2px solid var(--signal);
  border-radius: 0;
  cursor: pointer;
}
.np__time {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--paper);
  white-space: nowrap;
  flex: none;
}
.np__time i { color: rgba(239, 237, 230, 0.45); font-style: normal; }
.np__vol {
  -webkit-appearance: none;
  appearance: none;
  width: 62px;
  height: 4px;
  background: rgba(239, 237, 230, 0.22);
  flex: none;
  cursor: pointer;
}
.np__vol::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 14px; background: var(--paper); border-radius: 0; }
.np__vol::-moz-range-thumb { width: 10px; height: 14px; background: var(--paper); border: none; border-radius: 0; }
@media (max-width: 700px) {
  .np__vol { display: none; }
  .np__bar { gap: 7px; padding: 9px 8px; }
  .np__time { font-size: 10px; }
}

/* fullscreen — these selectors must stay in SEPARATE rules.
   Comma-joining them makes browsers drop the whole rule. */
.np:fullscreen { width: 100vw; height: 100vh; display: flex; flex-direction: column; background: var(--ink); }
.np:-webkit-full-screen { width: 100vw; height: 100vh; display: flex; flex-direction: column; background: var(--ink); }
.np:fullscreen .np__stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.np:-webkit-full-screen .np__stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.np:fullscreen video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.np:-webkit-full-screen video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.np:fullscreen .np__bar { flex: none; padding: 16px clamp(16px, 4vw, 44px); }
.np:-webkit-full-screen .np__bar { flex: none; padding: 16px clamp(16px, 4vw, 44px); }
.np:fullscreen .np__big { width: 104px; height: 104px; }
.np:-webkit-full-screen .np__big { width: 104px; height: 104px; }
.np::backdrop { background: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .arc-frame, .arc-frame::after, .arc-frame img, .arc-frame video,
  .arc-head__rule, .lb, .lb__stage, #nrcCur { animation: none !important; transition: none !important; }
}
