/* ==========================================================================
   CASE DRAWER & HOVER INTERACTIONS (HOBRO DIGITAL SPEC)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CARD HOVER MORPH (--clip-radius)
   -------------------------------------------------------------------------- */
.work-case {
  cursor: pointer;
  position: relative;
}

.work-case__media {
  --clip-top: 0%;
  --clip-right: 0%;
  --clip-bottom: 0%;
  --clip-left: 0%;
  --clip-radius: 0px;
  clip-path: inset(var(--clip-top) var(--clip-right) var(--clip-bottom) var(--clip-left) round var(--clip-radius));
  transition: clip-path 0.1s ease;
  overflow: hidden;
  display: block;
}

.work-case:hover .work-case__media {
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   3. BODY & HEADER LOCKING WHEN POPUP IS OPEN
   -------------------------------------------------------------------------- */
body.is-popup-open {
  overflow: hidden !important;
}

body.is-popup-open .site-nav,
body.is-popup-open header:not(.popup__top),
body.is-popup-open .site-nav__toggle {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease;
}

/* --------------------------------------------------------------------------
   4. POPUP DRAWER CONTAINER
   -------------------------------------------------------------------------- */
.popup {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: #000000;
  color: #ffffff;
  z-index: 99999;
  display: none;
  transform: none;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.popup.active {
  display: block;
}

.popup-scroll-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.popup-scroll-container::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   5. TOP BAR & CLOSE BUTTON (CENTERED ON TOP, EXACT HOBRO SPEC)
   -------------------------------------------------------------------------- */
.popup__top {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(14px, 2vw, 24px) 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 70%, rgba(0, 0, 0, 0) 100%);
  z-index: 50;
  pointer-events: none;
}

.popup__close-btn {
  pointer-events: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: clamp(44px, 3.8vw, 56px);
  height: clamp(44px, 3.8vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  outline: none;
  opacity: 0;
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.popup__close-btn svg {
  width: 12px;
  height: 12px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup__close-btn:hover {
  border-color: #ffffff;
  transform: scale(1.08);
  background-color: rgba(255, 255, 255, 0.1);
}

.popup__close-btn:hover svg {
  transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   6. GRID LAYOUT (DESKTOP SPLIT 2-COLUMN, IDENTICAL TO HOBRO)
   -------------------------------------------------------------------------- */
.popup__container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4.5vw, 72px) clamp(60px, 8vw, 120px);
  display: grid;
  grid-template-columns: minmax(320px, 44%) minmax(400px, 56%);
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(40px, 6vw, 100px);
  row-gap: 0;
  align-items: start;
  box-sizing: border-box;
}

/* LEFT COLUMN: STICKY HEADER & INFO */
.popup__header {
  grid-area: 1 / 1 / 2 / 2;
  position: sticky;
  top: clamp(60px, 7vw, 100px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.2vw, 32px);
  margin-bottom: clamp(24px, 3vw, 40px);
}

.popup__description {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.8vw, 24px);
}

.popup__meta-eyebrow {
  display: none; /* Hobro does not show eyebrow above title */
}

/* EXACT HOBRO TITLE TYPOGRAPHY (Grotesque Sans, tight tracking) */
.popup__title {
  margin: 0;
  font-family: var(--font-body, 'Archivo', sans-serif);
  font-size: clamp(40px, 4.4vw, 68px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.popup__text {
  font-family: var(--font-body, 'Archivo', sans-serif);
  font-size: clamp(14px, 1.0vw, 16px);
  line-height: 1.62;
  color: rgba(255, 255, 255, 0.76);
  max-width: 540px;
  font-weight: 400;
}

.popup__text p {
  margin: 0 0 16px 0;
}

.popup__text p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   5. LINE-BY-LINE TEXT REVEAL MASK (AWWWARDS / HOBRO SIGNATURE)
   -------------------------------------------------------------------------- */
.popup-line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.06em;
}

.popup-line-inner {
  display: block;
  opacity: 0;
  will-change: transform, opacity;
}

.popup__title .popup-line-mask {
  padding-bottom: 0.16em;
  margin-bottom: -0.08em;
}

.popup__title .popup-line-inner {
  font-weight: 500;
  letter-spacing: -0.025em;
}

/* TAGS PILL LIST (EXACT HOBRO SPEC) */
.popup__tags {
  display: flex;
  flex-wrap: wrap;
}

.tags__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 500px;
}

.tags__item {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background-color: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-body, 'Archivo', sans-serif);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
  user-select: none;
}

.tags__item:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* CTA BUTTON WITH 8 CONCENTRIC ARCS (EXACT HOBRO SPEC) */
.popup__button {
  grid-area: 2 / 1 / 3 / 2;
  position: sticky;
  align-self: start;
  margin-top: 16px;
}

.cta.cta--popup {
  display: inline-block;
  position: relative;
}

.cta__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.5vw, 32px);
  text-decoration: none;
  color: #ffffff;
  padding: 10px 0;
  cursor: pointer;
  position: relative;
}

.cta__arcs {
  position: relative;
  width: clamp(26px, 2.6vw, 42px);
  height: clamp(64px, 7vw, 110px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta__arc {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.cta__arc:first-child {
  opacity: 1;
}

.cta__arcs--right {
  transform: rotate(180deg);
}

.cta__text {
  font-family: var(--font-body, 'Archivo', sans-serif);
  font-size: clamp(32px, 3.6vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1;
  transition: transform 0.3s ease;
}

.cta__link:hover .cta__text {
  transform: scale(1.02);
}

/* Tooltip hint */
.cta__hint {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  padding: 6px 14px;
  background-color: #ffffff;
  color: #000000;
  font-family: var(--font-body, 'Archivo', sans-serif);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  z-index: 100002;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   7. RIGHT COLUMN: GALLERY OF IMAGES (HOBRO SPEC)
   -------------------------------------------------------------------------- */
.popup__images {
  grid-area: 1 / 2 / 5 / 3;
  width: 100%;
}

.popup-scroll-content {
  width: 100%;
}

.gallery {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4.5vw, 64px);
}

.gallery__item {
  width: 100%;
  position: relative;
  background-color: #080808;
  border-radius: 8px;
  overflow: hidden;
}

.gallery__item--cover {
  position: relative;
  width: 100%;
  display: block;
  overflow: hidden;
  border-radius: 8px;
}

/* Curtains for theatrical reveal */
.js-popup-curtain {
  position: absolute;
  inset: 0;
  background-color: #000000;
  z-index: 2;
  transform-origin: top center;
  transform: scaleY(1);
}

.gallery__item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  background-color: #0e0e0e;
}

/* --------------------------------------------------------------------------
   8. MOBILE RESPONSIVENESS (1-COLUMN LINEAR WITH MOMENTUM TOUCH)
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .popup__container {
    display: flex;
    flex-direction: column;
    row-gap: 32px;
    padding: 0 20px 80px;
  }

  .popup__header {
    position: static;
    margin-bottom: 0;
    order: 1;
  }

  .popup__images {
    order: 2;
    width: 100%;
  }

  .popup__button {
    order: 3;
    position: static;
    margin-top: 24px;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .popup__close-btn {
    width: 48px;
    height: 48px;
  }
}
