/* =============================================================
   ARTWORK VIEWER — Scroll-driven side-by-side layout
   ============================================================= */

html, body {
  overflow: hidden;
  height: 100%;
}

/* ── Page Header ──────────────────────────────────────────── */
.aw-nav {
  position: fixed;
  inset: 0 0 auto;
  height: var(--nav-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(8,8,8,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.aw-back {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.aw-back:hover { color: var(--text); }
.aw-back-arrow { font-size: 16px; }

.aw-nav-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* ── Intro Screen ─────────────────────────────────────────── */
.aw-intro {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  background: var(--bg);
  text-align: center;
  padding: 40px 24px;
  transition: opacity 0.5s, transform 0.5s;
}
.aw-intro.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

.aw-intro-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.aw-intro-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 8vw, 96px);
  font-weight: 500;
  line-height: 1;
  color: var(--text);
}

.aw-intro-desc {
  max-width: 50ch;
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.65;
  color: var(--text-muted);
}

.aw-intro-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
}
.aw-intro-scroll-hint {
  width: 28px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 999px;
  position: relative;
}
.aw-intro-scroll-hint::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 999px;
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0%   { opacity: 1; top: 6px; }
  80%  { opacity: 0; top: 24px; }
  100% { opacity: 0; top: 6px; }
}

/* ── Viewer Layout ────────────────────────────────────────── */
.aw-viewer {
  position: fixed;
  inset: var(--nav-h) 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.aw-viewer.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Left Panel: Sticky text ──────────────────────────────── */
.aw-text-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 52px 48px 48px;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.aw-counter {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.aw-counter-track {
  flex: 1;
  height: 1px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  max-width: 80px;
}
.aw-counter-fill {
  height: 100%;
  background: var(--text-muted);
  border-radius: 999px;
  transition: width 0.4s var(--ease-out);
}

.aw-project-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 500;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 24px;
}

.aw-caption-wrap {
  position: relative;
  min-height: 120px;
}

.aw-caption {
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.7;
  color: rgba(240,237,232,0.75);
  position: absolute;
  inset: 0;
  transition: opacity 0.35s, transform 0.35s var(--ease-out);
}
.aw-caption.leaving {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}
.aw-caption.entering {
  opacity: 0;
  transform: translateY(12px);
}
.aw-caption.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Navigation dots */
.aw-dots {
  display: flex;
  gap: 6px;
  margin-top: 40px;
}
.aw-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
  border: none;
}
.aw-dot.active {
  background: var(--text);
  transform: scale(1.3);
}

/* Prev/Next hint */
.aw-nav-hint {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}
.aw-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.aw-nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
.aw-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Right Panel: Scrollable images ──────────────────────── */
.aw-scroll-panel {
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  background: #080808;
}

/* Hide scrollbar but keep functionality */
.aw-scroll-panel::-webkit-scrollbar { display: none; }
.aw-scroll-panel { scrollbar-width: none; -ms-overflow-style: none; }

.aw-slide {
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.aw-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.aw-slide.in-view img {
  opacity: 1;
  transform: scale(1);
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .aw-viewer {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .aw-text-panel {
    padding: 24px 20px 16px;
    justify-content: flex-start;
    overflow-y: auto;
    max-height: 40vh;
    order: 2;
  }

  .aw-scroll-panel {
    order: 1;
    max-height: 55vh;
  }

  .aw-slide { padding: 12px; }
  .aw-dots { margin-top: 16px; }
  .aw-nav-hint { margin-top: 12px; }
  .aw-caption-wrap { min-height: 80px; }
  .aw-project-title { font-size: clamp(22px, 6vw, 32px); margin-bottom: 12px; }
}

@media (max-width: 480px) {
  .aw-intro-title { font-size: clamp(36px, 12vw, 64px); }
}

/* ── Back to collection link (inside text panel) ── */
.aw-back-collection {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.aw-back-collection:hover {
  color: var(--text);
  border-color: var(--border);
}

/* ── Responsive fixes ── */
@media (max-width: 900px) {
  .aw-viewer {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  /* Image on top, text below */
  #awScrollPanel { order: 1; max-height: 55dvh; min-height: 40dvh; }
  .aw-text-panel  { order: 2; max-height: none; overflow-y: auto; padding: 20px 20px 32px; }

  .aw-project-title { font-size: clamp(20px, 5vw, 30px); margin-bottom: 10px; }
  .aw-caption-wrap  { min-height: 60px; }
  .aw-nav-hint, .aw-dots { margin-top: 12px; }
  .aw-back-collection { margin-top: 16px; }
}

@media (max-width: 480px) {
  .aw-nav { padding: 0 14px; }
  .aw-nav-title { font-size: 13px; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .aw-intro { padding: 40px 20px; }
  .aw-intro-title { font-size: clamp(36px, 12vw, 60px); }
  .aw-text-panel { padding: 16px 16px 28px; }
}
