/* ImagiNagari Media House: studio layout (loader, hero, work grid, cursor, numbers) */
html.js.is-loading,
html.js.is-loading body {
  overflow: hidden;
}

/* ---------- Loader ---------- */
.ig-pre {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--ig-gutter);
  color: var(--ig-ink);
  background: var(--ig-ground);
  transition: clip-path 0.9s cubic-bezier(0.7, 0, 0.2, 1);
  clip-path: inset(0 0 0 0);
}

html.js .ig-pre {
  display: flex;
}

html.is-ready .ig-pre {
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
}

.ig-pre__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(60vw, 26rem);
  height: auto;
  transform: translate(-50%, -50%);
}

.ig-pre__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  font-family: var(--ig-mono);
  font-size: 0.8rem;
  color: var(--ig-muted);
}

.ig-pre__num {
  color: var(--ig-ink);
  font-family: var(--ig-display);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 300;
  line-height: 0.85;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.ig-pre__bar {
  height: 2px;
  margin-top: 1.25rem;
  background: var(--ig-line);
}

.ig-pre__bar span {
  display: block;
  height: 100%;
  background: var(--ig-spectrum);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ---------- Cursor follower (mouse devices only) ---------- */
.ig-cursor {
  position: fixed;
  z-index: 150;
  top: 0;
  left: 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border: 1px solid rgba(244, 240, 232, 0.55);
  border-radius: 50%;
  color: var(--ig-ground);
  font-family: var(--ig-mono);
  font-size: 0.7rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition:
    width 0.35s var(--ig-ease),
    height 0.35s var(--ig-ease),
    margin 0.35s var(--ig-ease),
    background-color 0.35s var(--ig-ease),
    border-color 0.35s var(--ig-ease),
    opacity 0.3s;
  will-change: transform;
}

.ig-cursor span {
  opacity: 0;
  transition: opacity 0.2s;
}

html.has-cursor .ig-cursor {
  display: flex;
}

.ig-cursor.is-on {
  opacity: 1;
}

.ig-cursor.is-link {
  width: 3.75rem;
  height: 3.75rem;
  margin: -1.875rem 0 0 -1.875rem;
  border-color: var(--ig-accent);
}

.ig-cursor.is-play {
  width: 5.5rem;
  height: 5.5rem;
  margin: -2.75rem 0 0 -2.75rem;
  border-color: transparent;
  background: var(--ig-ink);
}

.ig-cursor.is-play span {
  opacity: 1;
}

/* ---------- Hero ---------- */
.ig-hero {
  --px: 0.5;
  --py: 0.5;
  --mx: 50%;
  --my: 40%;
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100dvh;
  padding: 8rem var(--ig-gutter) clamp(3rem, 7vw, 6rem);
  overflow: hidden;
  background: var(--ig-ground);
  isolation: isolate;
}

.ig-hero__media,
.ig-hero__media video,
.ig-hero__media img,
.ig-hero__shade,
.ig-hero__glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ig-hero__media {
  z-index: -4;
  background:
    radial-gradient(60% 70% at 78% 40%, rgba(194, 42, 134, 0.5), transparent 70%),
    radial-gradient(50% 60% at 60% 75%, rgba(61, 85, 196, 0.5), transparent 70%),
    radial-gradient(40% 50% at 92% 80%, rgba(243, 154, 31, 0.35), transparent 70%),
    var(--ig-ground);
}

.ig-hero__media video,
.ig-hero__media img {
  display: block;
  object-fit: cover;
  transform: scale(1.06) translate(calc((var(--px) - 0.5) * -1.5%), calc((var(--py) - 0.5) * -1.5%));
  transition: transform 0.9s var(--ig-ease);
}

.ig-hero__shade {
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(10, 13, 31, 0.88) 0%, rgba(10, 13, 31, 0.55) 45%, rgba(10, 13, 31, 0.15) 100%),
    linear-gradient(0deg, rgba(10, 13, 31, 0.95) 0%, rgba(10, 13, 31, 0) 45%);
}

.ig-hero__glow {
  z-index: -2;
  background: radial-gradient(34rem circle at var(--mx) var(--my), rgba(224, 52, 143, 0.26), rgba(61, 85, 196, 0.12) 45%, transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.ig-hero__ghost {
  position: absolute;
  z-index: -1;
  right: -2vw;
  bottom: 34%;
  margin: 0;
  color: transparent;
  font-size: clamp(6rem, 21vw, 24rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.05em;
  white-space: nowrap;
  -webkit-text-stroke: 1px rgba(244, 240, 232, 0.16);
  transform: translate(calc((var(--px) - 0.5) * -60px), calc((var(--py) - 0.5) * -30px));
  transition: transform 0.8s var(--ig-ease);
  pointer-events: none;
  user-select: none;
}

.ig-hero__inner {
  width: 100%;
}

.ig-hero__kicker {
  margin: 0 0 1.5rem;
  color: var(--ig-accent);
  font-family: var(--ig-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ig-hero__title {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(3.1rem, 7.2vw, 7.5rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.ig-hero__title span {
  display: inline-block;
}

.ig-hero__title em {
  font-style: normal;
  color: transparent;
  background: var(--ig-spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  padding-right: 0.06em;
}

html.js .ig-hero__title span,
html.js .ig-hero__kicker,
html.js .ig-hero__foot {
  opacity: 0;
  filter: blur(14px);
  transform: translateY(0.35em);
}

html.js.is-ready .ig-hero__title span,
html.js.is-ready .ig-hero__kicker,
html.js.is-ready .ig-hero__foot {
  animation: ig-blur-in 1s var(--ig-ease) forwards;
  animation-delay: calc(0.45s + var(--i, 0) * 0.09s);
}

@keyframes ig-blur-in {
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

.ig-hero__foot {
  --i: 7;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(2rem, 4vw, 3.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--ig-line);
}

.ig-hero__lede {
  max-width: 34rem;
  margin: 0;
  color: var(--ig-ink);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.55;
  opacity: 0.88;
}

.ig-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

/* ---------- Marquee ---------- */
.ig-marquee {
  overflow: hidden;
  padding: 1.4rem 0;
  border-top: 1px solid var(--ig-line);
  border-bottom: 1px solid var(--ig-line);
  background: var(--ig-ground);
}

.ig-marquee__track {
  display: flex;
  width: max-content;
  animation: ig-marquee 36s linear infinite;
}

.ig-marquee:hover .ig-marquee__track {
  animation-play-state: paused;
}

.ig-marquee__track span {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.ig-marquee__track span::after {
  width: 0.75rem;
  height: 0.9rem;
  content: "";
  background: var(--ig-spectrum);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

@keyframes ig-marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Work grid ---------- */
.ig-work2__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
}

.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.2vw, 2.25rem) clamp(1rem, 1.8vw, 1.75rem);
  grid-auto-flow: dense;
  perspective: 1400px;
}

.ig-card {
  display: block;
  padding: 0;
  border: 0;
  color: var(--ig-ink);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  animation: ig-card-in 0.7s var(--ig-ease) both;
  animation-delay: calc(var(--n, 0) * 0.05s);
}

.ig-card--wide {
  display: flex;
  flex-direction: column;
  grid-column: span 2;
  grid-row: span 2;
}

.ig-card--right {
  grid-column: 2 / span 2;
}

@keyframes ig-card-in {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
}

.ig-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--ig-panel);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ig-ease);
}

.ig-card--wide .ig-card__media {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
}

.ig-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ig-ease), filter 0.5s;
  filter: saturate(0.9) brightness(0.9);
}

.ig-card:hover .ig-card__media img,
.ig-card:focus-visible .ig-card__media img {
  transform: scale(1.06);
  filter: none;
}

.ig-card__media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(22rem circle at var(--gx, 50%) var(--gy, 50%), rgba(244, 240, 232, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.ig-card:hover .ig-card__media::after {
  opacity: 1;
}

.ig-card__play {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: var(--ig-ink);
  clip-path: polygon(0 0, calc(100% - 0.7rem) 0, 100% 0.7rem, 100% 100%, 0 100%);
  transition: transform 0.35s var(--ig-ease);
}

.ig-card__play::before {
  width: 0.8rem;
  height: 0.95rem;
  content: "";
  background: var(--ig-spectrum);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.ig-card:hover .ig-card__play {
  transform: scale(1.1);
}

.ig-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
}

.ig-card__title {
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.ig-card__note {
  flex: none;
  color: var(--ig-muted);
  font-family: var(--ig-mono);
  font-size: 0.74rem;
}

.ig-card:focus-visible {
  outline: 2px solid var(--ig-accent);
  outline-offset: 6px;
}

.ig-work2__more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 2.5rem;
}

/* ---------- Video modal ---------- */
.ig-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem clamp(1rem, 5vw, 4rem) 2rem;
  background: rgba(6, 8, 20, 0.92);
  backdrop-filter: blur(12px);
}

.ig-modal[hidden] {
  display: none;
}

.ig-modal__box {
  width: min(100%, 76rem, calc((100dvh - 9rem) * 1.7778));
}

.ig-modal__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.ig-modal__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ig-modal__caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.9rem 0 0;
  font-size: 1.1rem;
}

.ig-modal__caption span {
  color: var(--ig-muted);
  font-family: var(--ig-mono);
  font-size: 0.78rem;
}

.ig-modal__close {
  position: absolute;
  top: 1.25rem;
  right: clamp(1rem, 5vw, 4rem);
}

/* ---------- Numbers ---------- */
.ig-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2rem;
  margin: 0;
  padding: clamp(3rem, 6vw, 5rem) var(--ig-gutter);
  border-top: 1px solid var(--ig-line);
  background: var(--ig-ground);
}

.ig-stats[hidden] {
  display: none;
}

.ig-stat dd {
  width: max-content;
  margin: 0;
  color: transparent;
  background: var(--ig-spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.ig-stat dt {
  margin-top: 0.75rem;
  color: var(--ig-muted);
  font-family: var(--ig-mono);
  font-size: 0.8rem;
}

/* ---------- Scroll reveal ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.9s var(--ig-ease), transform 0.9s var(--ig-ease);
  transition-delay: calc(var(--d, 0) * 0.08s);
}

html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

[data-magnetic] {
  will-change: transform;
}

/* Header gets a solid back once the page scrolls */
.ig-header {
  transition: background-color 0.4s var(--ig-ease);
}

html.is-scrolled .ig-header {
  background: rgba(10, 13, 31, 0.86);
  backdrop-filter: blur(12px);
}

@media (max-width: 860px) {
  .ig-hero {
    padding-top: 6.5rem;
  }

  .ig-hero__ghost {
    bottom: 48%;
  }

  .ig-hero__shade {
    background: linear-gradient(0deg, rgba(10, 13, 31, 0.96) 0%, rgba(10, 13, 31, 0.55) 60%, rgba(10, 13, 31, 0.5) 100%);
  }

  .ig-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ig-card--wide,
  .ig-card--right {
    display: block;
    grid-column: auto;
    grid-row: auto;
  }

  .ig-card--wide .ig-card__media {
    flex: none;
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js .ig-hero__title span,
  html.js .ig-hero__kicker,
  html.js .ig-hero__foot,
  html.js [data-reveal] {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .ig-marquee__track {
    animation: none;
  }

  .ig-hero__media video,
  .ig-hero__media img,
  .ig-hero__ghost,
  .ig-card__media {
    transform: none;
  }
}

/* ---------- Phone layout (added after phone review) ---------- */
@media (max-width: 860px) {
  .ig-header {
    height: 3.75rem;
    padding: 0 1.1rem;
  }

  .ig-header__logo img {
    height: 2.1rem;
  }

  .ig-navcta {
    height: 2.4rem;
    padding: 0 0.8rem;
    font-size: 0.72rem;
  }

  .ig-section {
    padding: 4rem 1.25rem;
  }

  .ig-h2 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .ig-lede {
    font-size: 1rem;
  }

  /* Hero */
  .ig-hero {
    min-height: 100svh;
    padding: 5.5rem 1.25rem 2.25rem;
  }

  .ig-hero__ghost {
    display: none;
  }

  .ig-hero__media video,
  .ig-hero__media img {
    object-position: 70% 50%;
    transform: none;
  }

  .ig-hero__shade {
    background: linear-gradient(0deg, rgba(10, 13, 31, 0.97) 0%, rgba(10, 13, 31, 0.75) 42%, rgba(10, 13, 31, 0.15) 75%, rgba(10, 13, 31, 0.45) 100%);
  }

  .ig-hero__kicker {
    margin-bottom: 1rem;
    font-size: 0.68rem;
  }

  .ig-hero__title {
    max-width: none;
    font-size: clamp(2.6rem, 12.5vw, 4rem);
    line-height: 0.98;
  }

  .ig-hero__foot {
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }

  .ig-hero__lede {
    font-size: 1rem;
  }

  .ig-hero__actions {
    width: 100%;
    gap: 1rem;
  }

  .ig-shardcta {
    flex: 1;
    justify-content: center;
    height: 3.25rem;
  }

  /* Moving strip */
  .ig-marquee {
    padding: 1rem 0;
  }

  .ig-marquee__track span {
    gap: 1.5rem;
    padding-right: 1.5rem;
    font-size: 1.1rem;
  }

  /* Work */
  .ig-work2__head {
    gap: 1.25rem;
    margin-bottom: 1.75rem;
  }

  .ig-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .ig-tabs::-webkit-scrollbar {
    display: none;
  }

  .ig-tab {
    flex: none;
    padding: 0.75rem 0.85rem;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  .ig-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 0.75rem;
  }

  .ig-card--wide,
  .ig-card--right {
    grid-column: 1 / -1;
  }

  .ig-card__meta {
    display: block;
    margin-top: 0.5rem;
  }

  .ig-card__title {
    display: block;
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .ig-card--wide .ig-card__title {
    font-size: 1.1rem;
  }

  .ig-card__note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.66rem;
  }

  .ig-card__play {
    bottom: 0.5rem;
    left: 0.5rem;
    width: 2.1rem;
    height: 2.1rem;
  }

  .ig-card--wide .ig-card__play {
    bottom: 0.75rem;
    left: 0.75rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .ig-work2__more {
    flex-direction: column;
    gap: 0;
    margin-top: 1.5rem;
  }

  /* Numbers */
  .ig-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 2.75rem 1.25rem;
  }

  .ig-stat dd {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .ig-stat dt {
    margin-top: 0.4rem;
    font-size: 0.66rem;
    line-height: 1.35;
  }

  /* Services */
  .ig-services {
    margin-top: 2rem;
  }

  .ig-service {
    padding: 1.4rem 0;
  }

  .ig-service h3 {
    font-size: 1.35rem;
  }

  .ig-service p {
    font-size: 0.95rem;
  }

  /* Process */
  .ig-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1rem;
    margin-top: 2rem;
  }

  .ig-step {
    padding-top: 1rem;
  }

  .ig-step::before {
    font-size: 3rem;
  }

  .ig-step h3 {
    margin-top: 0.75rem;
    font-size: 1.1rem;
  }

  .ig-step p {
    font-size: 0.9rem;
  }

  /* About */
  .ig-about__statement {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .ig-facts {
    gap: 1rem;
    margin-top: 2rem;
  }

  .ig-facts dd {
    font-size: 1rem;
  }

  /* Contact */
  .ig-contact__link {
    margin-top: 2rem;
    font-size: clamp(1.45rem, 7.4vw, 2.2rem);
  }

  .ig-contact__alt {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  /* Footer */
  .ig-footer {
    padding: 0 1.25rem calc(2rem + env(safe-area-inset-bottom));
  }

  .ig-footer__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .ig-footer__row img {
    height: 3.5rem;
  }

  /* Video pop-up */
  .ig-modal {
    padding: 4.5rem 0.75rem 1.5rem;
  }

  .ig-modal__box {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .ig-navcta {
    padding: 0 0.6rem;
    font-size: 0.66rem;
  }

  .ig-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}
