/* Nikhaar (निखार): the upscaling page. A large stage with zoom and pan, a
   before/after slider once it is done, and the choices beside it (under it on
   a phone). Colours from imagine.css's tokens. */

.nk-page { background: #0b0710; color: var(--im-text, #f4e9e4); min-height: 100vh; }
.nk-main { max-width: 1320px; margin: 0 auto; padding: calc(var(--kz-nav-h, 72px) + 18px) 20px 40px; }
.nk-head { margin-bottom: 14px; }
.nk-title { margin: 0; font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 600; color: var(--im-gold-hi, #e9c08a); }
.nk-title-dev { font-family: inherit; font-size: 1.1rem; color: var(--im-gold, #d8a35e); opacity: 0.8; margin-left: 6px; }
.nk-sub { margin: 2px 0 0; font-size: 0.92rem; color: rgba(244,233,228,0.6); }

.nk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }

/* The stage: the picture fitted, then zoomed and panned as one canvas. */
.nk-stage-wrap { min-width: 0; }
.nk-stage { position: relative; height: min(76vh, 900px); border-radius: 14px; overflow: hidden; touch-action: none;
  background: radial-gradient(ellipse at center, rgba(42,18,28,0.6), rgba(8,5,10,0.95)); border: 1px solid var(--im-border, rgba(216,163,94,0.14));
  cursor: grab; user-select: none; }
.nk-stage:active { cursor: grabbing; }
.nk-canvas { position: absolute; inset: 0; transform-origin: 0 0; display: flex; align-items: center; justify-content: center; will-change: transform; }
.nk-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; pointer-events: none; }
.nk-after-clip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.nk-stage-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; max-width: 80%;
  text-align: center; font-size: 0.9rem; color: rgba(244,233,228,0.7); }

/* Before / after. */
.nk-split { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; pointer-events: none; }
.nk-split-line { position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: rgba(255,255,255,0.85); box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.nk-split-handle { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(14,10,12,0.75); color: #fff; font-size: 1rem; cursor: ew-resize; pointer-events: auto;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); touch-action: none; }
.nk-tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  background: rgba(14,10,12,0.7); color: #fff; white-space: nowrap; }
.nk-tag--before { right: 12px; }
.nk-tag--after { left: 12px; color: var(--im-gold-hi, #e9c08a); }

.nk-zoom { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.nk-zoom-btn { min-width: 34px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--im-border, rgba(216,163,94,0.14));
  background: rgba(42,18,28,0.55); color: var(--im-text, #f4e9e4); font: inherit; font-size: 0.85rem; cursor: pointer; }
.nk-zoom-btn:hover { border-color: rgba(216,163,94,0.4); }
.nk-zoom-val { min-width: 44px; text-align: center; font-size: 0.78rem; color: rgba(244,233,228,0.6); }

/* The panel. */
.nk-panel { padding: 18px; border-radius: 14px; background: var(--im-surface, rgba(42,18,28,0.55)); border: 1px solid var(--im-border, rgba(216,163,94,0.14)); }
.nk-k { margin: 0 0 8px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--im-gold, #d8a35e); }
.nk-k + .nk-note { margin-top: -2px; }
.nk-note { margin: 10px 0; font-size: 0.8rem; line-height: 1.5; color: rgba(244,233,228,0.65); }
.nk-choices { display: grid; gap: 8px; margin-bottom: 16px; }
.nk-choice { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--im-border, rgba(216,163,94,0.14));
  background: rgba(8,5,10,0.4); color: var(--im-text, #f4e9e4); font: inherit; cursor: pointer; }
.nk-choice b { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.nk-choice span { font-size: 0.76rem; line-height: 1.45; color: rgba(244,233,228,0.6); }
.nk-choice.is-on { border-color: var(--im-gold, #d8a35e); background: var(--im-gold-lo, rgba(216,163,94,0.12)); }
.nk-sizes { display: flex; gap: 8px; }
.nk-size { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--im-border, rgba(216,163,94,0.14)); background: rgba(8,5,10,0.4);
  color: var(--im-text, #f4e9e4); font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; }
.nk-size small { display: block; margin-top: 2px; font-size: 0.7rem; font-weight: 500; color: var(--im-gold, #d8a35e); }
.nk-size.is-on { border-color: var(--im-gold, #d8a35e); background: var(--im-gold-lo, rgba(216,163,94,0.12)); }
.nk-go { display: block; width: 100%; margin-top: 6px; padding: 12px; border-radius: 12px; border: 0; cursor: pointer; text-align: center;
  background: linear-gradient(120deg, #f3d7a6, #d8a35e); color: #150a0e; font: inherit; font-size: 0.95rem; font-weight: 700; text-decoration: none; }
.nk-go span { margin-left: 6px; opacity: 0.8; }
.nk-go:hover { filter: brightness(1.06); }
.nk-go[aria-disabled="true"] { filter: grayscale(0.8) brightness(0.7); cursor: help; }
.nk-wallet { margin: 8px 0 0; font-size: 0.74rem; text-align: center; color: rgba(244,233,228,0.5); }
.nk-btn2 { display: block; margin-top: 8px; padding: 10px; border-radius: 12px; text-align: center; text-decoration: none; font-size: 0.86rem;
  border: 1px solid rgba(216,163,94,0.4); color: var(--im-gold, #d8a35e); }
.nk-link, .nk-link-btn { display: inline-block; margin-top: 10px; padding: 0; border: 0; background: none; font: inherit; font-size: 0.82rem;
  color: var(--im-gold, #d8a35e); text-decoration: underline; cursor: pointer; }
.nk-block.is-locked { opacity: 0.55; }
.nk-lock { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(244,233,228,0.08); font-size: 0.82rem; color: rgba(244,233,228,0.75); }
.nk-lock p { margin: 0; }
.nk-working { text-align: center; }
.nk-mithu { display: block; margin: 0 auto 8px; }
.nk-progress { height: 6px; border-radius: 999px; background: rgba(244,233,228,0.08); overflow: hidden; }
.nk-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d8a35e, #f3d7a6); transition: width 0.3s linear; }

@media (max-width: 860px) {
  .nk-layout { grid-template-columns: 1fr; }
  .nk-stage { height: 62vh; }
}
@media (max-width: 560px) {
  .nk-main { padding-left: 16px; padding-right: 16px; }
  .nk-title { font-size: 1.6rem; }
  .nk-stage { height: 56vh; }
}

/* Choose a picture: two ways in on the empty stage, and the picker */
.nk-pick { position: absolute; left: 50%; top: calc(50% + 46px); transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: max-content; max-width: 90%; z-index: 2; }
.nk-pick-btn { padding: 11px 18px; border-radius: 999px; cursor: pointer; font: 600 0.88rem Inter, system-ui, sans-serif;
  color: #1a0f08; background: linear-gradient(135deg, #fff1d2, #d8a35e); border: 0; box-shadow: 0 10px 24px -12px rgba(216,163,94,0.8); }
.nk-pick-btn + .nk-pick-btn { color: #f4e9e4; background: rgba(255,255,255,0.06); border: 1px solid rgba(216,163,94,0.4); box-shadow: none; }
.nk-pick-btn:hover { filter: brightness(1.08); }
.nk-change { margin-left: auto; padding: 0 12px; width: auto; }
.nk-picker { position: fixed; inset: 0; margin: auto; width: min(920px, calc(100vw - 32px)); height: fit-content; max-height: min(86vh, 900px); padding: 18px; border-radius: 18px;
  color: #f4e9e4; background: #140c12; border: 1px solid rgba(216,163,94,0.25); box-shadow: 0 40px 80px -20px rgba(0,0,0,0.85); }
.nk-picker::backdrop { background: rgba(5,3,6,0.7); backdrop-filter: blur(4px); }
.nk-picker-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.nk-picker-head h2 { margin: 0; font: 600 1.1rem Inter, system-ui, sans-serif; }
.nk-picker-tabs { display: flex; gap: 6px; }
.nk-picker-tabs button { padding: 6px 14px; border-radius: 999px; cursor: pointer; font: 500 0.82rem Inter, system-ui, sans-serif;
  color: rgba(244,233,228,0.75); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); }
.nk-picker-tabs button[aria-selected="true"] { color: #1a0f08; background: #d8a35e; border-color: #d8a35e; }
.nk-picker-x { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.3rem; line-height: 1;
  color: #f4e9e4; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }
.nk-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; overflow-y: auto; max-height: calc(86vh - 150px); }
.nk-picker-grid > .nk-note { grid-column: 1 / -1; text-align: center; padding: 30px 0; }
.nk-picker-tile { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: #1e1420;
  border: 1px solid rgba(216,163,94,0.14); text-decoration: none; }
.nk-picker-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.nk-picker-tile:hover img, .nk-picker-tile:focus-visible img { transform: scale(1.05); }
.nk-picker-tile:focus-visible { outline: 2px solid #d8a35e; outline-offset: 2px; }
.nk-picker-tile span { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 3px 8px; border-radius: 8px; font: 500 0.7rem/1.35 Inter, system-ui, sans-serif;
  color: #fff; background: rgba(10,6,8,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nk-picker-more { display: block; margin: 14px auto 0; padding: 9px 20px; border-radius: 999px; cursor: pointer; font: 600 0.84rem Inter, system-ui, sans-serif;
  color: #f4e9e4; background: rgba(255,255,255,0.06); border: 1px solid rgba(216,163,94,0.35); }

/* No picture yet: no zoom controls (nothing to zoom). */
.nk-stage-wrap:has(.nk-pick:not([hidden])) .nk-zoom { display: none; }
/* base.css pads every <section> 120px for the old homepage; not this one. */
.nk-stage-wrap { padding: 0; }
/* No picture yet: the card says what to do, so the side panel (which only
   repeats it) waits, and the card stands centred. */
.nk-layout:has(.nk-pick:not([hidden])) .nk-panel { display: none; }
.nk-layout:has(.nk-pick:not([hidden])) { grid-template-columns: minmax(0, 560px); justify-content: center; }

/* While a picture is lifted: our K forming in dots over the picture, dimmed so it still shows (kz-forming.js) */
.kz-forming { position: absolute; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; transition: opacity .35s ease; }
.kz-forming--over { background: rgba(12,9,11,0.72); }
.kz-forming canvas { position: absolute; inset: 0; }
.kz-forming-label { position: absolute; left: 16px; top: 14px; font: 500 13px/1 Inter, system-ui, sans-serif; color: rgba(244,233,228,0.8); }
.kz-forming-pct { position: absolute; right: 14px; bottom: 14px; padding: 6px 11px; border-radius: 999px; background: rgba(255,255,255,0.92);
  color: #1d1420; font: 600 12px/1 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.kz-forming.is-out { opacity: 0; }
/* Music while you wait (kz-forming.js): off until asked for, remembered */
.kz-forming-sound { position: absolute; right: 12px; top: 10px; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); background: rgba(20,14,18,0.6); color: rgba(244,233,228,0.8);
  font: 500 12px/1 Inter, system-ui, sans-serif; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kz-forming-sound:hover { color: #f4e9e4; border-color: rgba(216,163,94,0.55); }
.kz-forming-sound.is-on { color: #1d1420; background: linear-gradient(135deg, #e3b877, #c9935a); border-color: transparent; }
.kz-forming-sound:focus-visible { outline: 2px solid #d8a35e; outline-offset: 2px; }
