/* Portfolio interactive module */
#portfolio-home,
.portfolio-page{
  width: 100%;
  scroll-margin-top: 92px;
  padding: clamp(42px, 7vw, 100px) 0;
  background: linear-gradient(135deg, rgba(15, 8, 25, .96), rgba(0, 0, 0, .92) 48%, rgba(234, 220, 255, .14)), #08060c;
  color: #fff;
  overflow: hidden;
}

.portfolio-page{
  min-height: 100vh;
  padding-top: clamp(26px, 4vw, 54px);
}

#portfolio-home,
#portfolio-home *,
.portfolio-page,
.portfolio-page *{
  cursor: auto;
}

.portfolio-page a,
.portfolio-page button,
#portfolio-home a,
#portfolio-home button{
  cursor: pointer;
}

.portfolio-pointer{
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10000;
  width: 18px;
  height: 18px;
  border: 2px solid #eadcff;
  border-radius: 50%;
  background: rgba(234, 220, 255, .18);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(1);
  transition: width .18s ease, height .18s ease, opacity .18s ease, background .18s ease, border-color .18s ease;
  box-shadow: 0 0 0 1px rgba(18,10,29,.5), 0 0 24px rgba(234,220,255,.28);
}

.portfolio-pointer.is-visible{
  opacity: 1;
}

.portfolio-pointer.is-active{
  width: 34px;
  height: 34px;
  background: rgba(234, 220, 255, .08);
  border-color: #fff;
}

@media (pointer: coarse), (max-width: 780px){
  .portfolio-pointer{
    display: none;
  }
}

@media (prefers-reduced-motion: reduce){
  .portfolio-title-broken::before,
  .portfolio-title-broken::after,
  .portfolio-swipe-hint span{
    animation: none;
  }
}

.portfolio-shell{
  width: min(1180px, 92vw);
  margin-inline: auto;
  min-width: 0;
}

.portfolio-nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(34px, 6vw, 76px);
}

.portfolio-nav > a:first-child{
  display: inline-flex;
  align-items: center;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid rgba(234,220,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
}

.portfolio-nav img{
  width: clamp(142px, 18vw, 210px);
  height: auto;
}

.portfolio-back{
  color: #fff;
  text-decoration: none;
  font-family: monospace;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  padding: 10px 14px;
}

.portfolio-header{
  display: grid;
  gap: clamp(10px, 1.4vw, 18px);
  margin-bottom: clamp(24px, 4vw, 52px);
}

.portfolio-page .portfolio-header{
  max-width: 980px;
}

.portfolio-kicker{
  width: fit-content;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  color: #eadcff;
  font-family: monospace;
  text-transform: uppercase;
}

.portfolio-title{
  margin: 0;
  font-family: var(--FONT-SOVIETIC), "Bebas Neue", system-ui, sans-serif;
  font-size: clamp(3.8rem, 11vw, 10rem);
  line-height: .82;
  letter-spacing: 0;
  color: #fff;
  text-transform: uppercase;
}

.portfolio-title-broken{
  position: relative;
  width: fit-content;
  max-width: 100%;
  isolation: isolate;
  text-shadow: 4px 0 0 rgba(234,220,255,.14), -3px 3px 0 rgba(255,255,255,.08);
}

.portfolio-title-broken::before,
.portfolio-title-broken::after{
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  color: #fff;
  opacity: .72;
}

.portfolio-title-broken::before{
  clip-path: polygon(0 7%, 100% 0, 100% 21%, 0 27%, 0 36%, 100% 29%, 100% 43%, 0 50%);
  transform: translate(-7px, -3px);
  text-shadow: 5px 0 0 #eadcff;
  animation: titleBrokenShift 3.8s steps(2, end) infinite;
}

.portfolio-title-broken::after{
  clip-path: polygon(0 58%, 100% 51%, 100% 64%, 0 70%, 0 82%, 100% 77%, 100% 91%, 0 100%);
  transform: translate(6px, 4px);
  text-shadow: -5px 0 0 rgba(255,255,255,.42);
  animation: titleBrokenShift 4.6s steps(2, end) infinite reverse;
}

@keyframes titleBrokenShift{
  0%,
  76%,
  100%{
    transform: translate(0, 0);
  }

  80%{
    transform: translate(9px, -3px);
  }

  84%{
    transform: translate(-6px, 4px);
  }
}

.portfolio-page .portfolio-title{
  font-size: clamp(4.4rem, 13vw, 13rem);
}

.portfolio-live-title{
  margin: 0;
  color: #eadcff;
  font-family: monospace;
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  font-weight: 900;
  text-transform: uppercase;
}

.portfolio-sub{
  max-width: 720px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-family: Montserrat, sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.55;
}

.portfolio-stage{
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}

.portfolio-sidebar{
  display: grid;
  gap: 16px;
}

.portfolio-viewer{
  min-width: 0;
  display: grid;
  gap: 14px;
}

.portfolio-panel{
  position: sticky;
  top: 110px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(234,220,255,.18), rgba(255,255,255,.04)), rgba(255,255,255,.06);
  box-shadow: 0 18px 50px rgba(0,0,0,.32);
}

.portfolio-panel h3{
  margin: 0;
  font-family: var(--FONT-SOVIETIC), "Bebas Neue", system-ui, sans-serif;
  font-size: clamp(2.3rem, 4.8vw, 4.5rem);
  line-height: .88;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portfolio-panel p{
  margin: 0;
  color: rgba(255,255,255,.76);
  font-family: Montserrat, sans-serif;
  line-height: 1.5;
}

.portfolio-count,
.portfolio-meta{
  font-family: monospace;
  color: #eadcff;
}

.portfolio-meta{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.25);
}

.portfolio-cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 14px;
  border: 2px solid #eadcff;
  border-radius: 8px;
  color: #120a1d;
  background: #eadcff;
  text-decoration: none;
  font-family: monospace;
  font-weight: 900;
}

.portfolio-actions{
  display: grid;
  gap: 8px;
}

.portfolio-browser{
  grid-column: 2;
  width: 100%;
  --desktop-preview-width: 1440px;
  --desktop-preview-height: 900px;
  --desktop-preview-scale: 1;
  height: calc(38px + (var(--desktop-preview-height) * var(--desktop-preview-scale)));
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: #f8f4ff;
  box-shadow: 0 22px 70px rgba(0,0,0,.42);
}

.portfolio-view-toggle{
  grid-column: 2;
  width: fit-content;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.portfolio-viewport{
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  color: rgba(255,255,255,.78);
  background: transparent;
  font-family: monospace;
  font-weight: 900;
}

.portfolio-viewport.is-active,
.portfolio-viewport:hover{
  color: #120a1d;
  background: #eadcff;
}

.portfolio-browser.is-mobile{
  width: min(100%, 390px);
  height: auto;
  max-height: none;
  justify-self: center;
  min-height: 740px;
  border-radius: 28px;
  border-width: 10px;
  background: #120a1d;
}

.portfolio-browser.is-mobile .portfolio-browser-bar{
  height: 32px;
  justify-content: center;
  background: #120a1d;
  border-bottom-color: rgba(255,255,255,.16);
}

.portfolio-browser.is-mobile .portfolio-browser-bar span{
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
}

.portfolio-browser.is-mobile .portfolio-browser-bar span:nth-child(2),
.portfolio-browser.is-mobile .portfolio-browser-bar span:nth-child(3){
  display: none;
}

.portfolio-browser.is-mobile iframe{
  height: 708px;
  border-radius: 0 0 18px 18px;
}

.portfolio-browser-bar{
  height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(0,0,0,.12);
  background: #eadcff;
}

.portfolio-browser-bar span,
.portfolio-card-top span{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
  background: #120a1d;
  opacity: .9;
}

.portfolio-browser iframe{
  width: var(--desktop-preview-width);
  height: var(--desktop-preview-height);
  min-height: 0;
  display: block;
  border: 0;
  background: #fff;
  transform: scale(var(--desktop-preview-scale));
  transform-origin: top left;
}

.portfolio-browser.is-mobile iframe{
  width: 100%;
  transform: none;
}

.portfolio-controls{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portfolio-filter{
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-family: monospace;
  cursor: pointer;
}

.portfolio-filter.is-active,
.portfolio-filter:hover{
  background: #fff;
  color: #120a1d;
}

.portfolio-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(168px, auto);
  gap: clamp(10px, 1.4vw, 16px);
}

#portfolio-home .portfolio-controls,
#portfolio-home .portfolio-grid{
  grid-column: 2;
}

.portfolio-page .portfolio-stage{
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
}

.portfolio-page .portfolio-sidebar{
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.portfolio-page .portfolio-panel{
  position: relative;
  top: auto;
  min-height: auto;
  justify-content: start;
}

.portfolio-page .portfolio-panel h2{
  margin: 0;
  font-family: var(--FONT-SOVIETIC), "Bebas Neue", system-ui, sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  line-height: .88;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portfolio-page .portfolio-grid{
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  gap: 10px;
}

.portfolio-page .portfolio-card{
  min-height: auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px 12px;
  padding: 14px;
  background: rgba(255,255,255,.055);
}

.portfolio-page .portfolio-card-top{
  display: none;
}

.portfolio-page .portfolio-card strong{
  min-width: 0;
  overflow: visible;
  font-size: clamp(1.25rem, 1.85vw, 2rem);
  line-height: .95;
  white-space: normal;
}

.portfolio-page .portfolio-card small{
  justify-self: end;
  max-width: none;
  font-size: .72rem;
  white-space: nowrap;
  padding: 5px 8px;
  border: 1px solid rgba(234,220,255,.26);
  border-radius: 999px;
}

.portfolio-card-desc{
  display: none;
}

.portfolio-page .portfolio-card-desc{
  grid-column: 1 / -1;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgba(255,255,255,.7);
  font-family: Montserrat, sans-serif;
  font-size: .86rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.portfolio-page .portfolio-card em{
  grid-column: 1 / -1;
  max-width: 100%;
  font-size: .76rem;
  overflow: hidden;
  color: rgba(234,220,255,.82);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-page .portfolio-grid{
  grid-auto-rows: auto;
}

.portfolio-card{
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 0;
  background: #141019;
  color: #fff;
  cursor: pointer;
  isolation: isolate;
  transition: transform .35s ease, opacity .25s ease, border-color .25s ease;
  text-align: left;
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 168px;
  padding: 14px;
}

.portfolio-card-top{
  display: flex;
  gap: 6px;
}

.portfolio-card strong{
  font-family: var(--FONT-SOVIETIC), "Bebas Neue", system-ui, sans-serif;
  font-size: clamp(1.6rem, 2.8vw, 2.7rem);
  line-height: .9;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portfolio-card small,
.portfolio-card em{
  font-family: monospace;
  font-style: normal;
  color: rgba(255,255,255,.72);
}

.portfolio-card em{
  overflow-wrap: anywhere;
}

.portfolio-card:hover,
.portfolio-card.is-active{
  transform: translateY(-5px);
  border-color: #eadcff;
}

.portfolio-card.is-hidden{
  display: none;
}

.portfolio-mobile-showcase{
  display: none;
}

.portfolio-swipe-hint{
  display: none;
}

@media (max-width: 980px){
  .portfolio-stage{
    grid-template-columns: 1fr;
  }

  .portfolio-page .portfolio-stage{
    grid-template-columns: 1fr;
  }

  .portfolio-panel,
  .portfolio-browser,
  .portfolio-controls,
  .portfolio-grid,
  .portfolio-sidebar,
  .portfolio-viewer,
  .portfolio-view-toggle{
    grid-column: 1;
  }

  .portfolio-page .portfolio-sidebar{
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .portfolio-panel{
    position: relative;
    top: auto;
    min-height: auto;
  }
}

@media (max-width: 720px){
  #portfolio-home,
  .portfolio-page{
    padding-block: 38px;
    overflow-x: clip;
  }

  .portfolio-shell{
    width: min(100% - 28px, 1180px);
  }

  .portfolio-page .portfolio-stage{
    display: none;
  }

  .portfolio-mobile-showcase{
    display: grid;
    gap: 14px;
    margin-top: 28px;
  }

  .portfolio-swipe-hint{
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid rgba(234,220,255,.35);
    border-radius: 999px;
    color: #eadcff;
    background: rgba(234,220,255,.08);
    font-family: monospace;
    font-size: .84rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .portfolio-swipe-hint span{
    display: inline-block;
    font-size: 1.1rem;
    animation: swipeHintNudge 1.45s ease-in-out infinite;
  }

  .portfolio-mobile-track{
    display: flex;
    gap: 16px;
    width: 100%;
    margin-left: 0;
    padding: 6px 0 22px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scrollbar-width: thin;
  }

  .portfolio-mobile-card{
    flex: 0 0 min(100%, 370px);
    max-width: 100%;
    min-width: 0;
    scroll-snap-align: start;
    display: grid;
    grid-template-rows: 214px auto auto;
    align-items: start;
    gap: 14px;
  }

  .portfolio-mobile-info{
    display: grid;
    gap: 8px;
    padding: 0 4px;
    align-content: start;
  }

  .portfolio-mobile-info span,
  .portfolio-mobile-link{
    color: #eadcff;
    font-family: monospace;
    font-weight: 900;
  }

  .portfolio-mobile-info h3{
    margin: 0;
    color: #fff;
    font-family: var(--FONT-SOVIETIC), "Bebas Neue", system-ui, sans-serif;
    font-size: clamp(2.05rem, 10.5vw, 3.35rem);
    line-height: .9;
    letter-spacing: 0;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  .portfolio-mobile-info p{
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: rgba(255,255,255,.74);
    font-family: Montserrat, sans-serif;
    line-height: 1.45;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .portfolio-mobile-phone{
    --mobile-preview-width: 390px;
    --mobile-preview-scale: 1;
    height: min(68vh, 650px);
    min-height: 510px;
    overflow: hidden;
    border: 8px solid #53475f;
    border-radius: 28px;
    background: #120a1d;
    box-shadow: 0 24px 68px rgba(0,0,0,.46);
  }

  .portfolio-mobile-speaker{
    width: 42px;
    height: 5px;
    margin: 12px auto 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.72);
  }

  .portfolio-mobile-phone iframe{
    width: var(--mobile-preview-width);
    height: calc((100% - 27px) / var(--mobile-preview-scale));
    display: block;
    border: 0;
    border-radius: 0 0 18px 18px;
    background: #fff;
    transform: scale(var(--mobile-preview-scale));
    transform-origin: top left;
  }

  .portfolio-mobile-link{
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid rgba(234,220,255,.72);
    border-radius: 8px;
    background: #eadcff;
    color: #120a1d;
    box-shadow: 0 14px 32px rgba(234,220,255,.16);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  }

  .portfolio-mobile-link:hover{
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 18px 38px rgba(234,220,255,.22);
  }

  .portfolio-title,
  .portfolio-page .portfolio-title{
    max-width: 100%;
    font-size: clamp(2.8rem, 14.5vw, 4.45rem);
    line-height: .88;
    overflow-wrap: anywhere;
  }

  .portfolio-sub{
    max-width: 100%;
    font-size: .98rem;
  }

  .portfolio-nav{
    align-items: flex-start;
    flex-direction: column;
  }

  .portfolio-nav > a:first-child{
    min-height: 50px;
    padding: 8px 12px;
  }

  .portfolio-controls{
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .portfolio-filter{
    flex: 0 0 auto;
  }

  .portfolio-grid,
  .portfolio-page .portfolio-grid{
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .portfolio-browser,
  .portfolio-browser iframe{
    min-height: 520px;
    height: 520px;
  }

  .portfolio-browser.is-mobile{
    min-height: 650px;
  }

  .portfolio-browser.is-mobile iframe{
    min-height: auto;
    height: 618px;
  }
}

@keyframes swipeHintNudge{
  0%,
  100%{
    transform: translateX(0);
  }

  50%{
    transform: translateX(5px);
  }
}

@media (max-width: 430px){
  .portfolio-shell{
    width: min(100% - 22px, 1180px);
  }

  .portfolio-title,
  .portfolio-page .portfolio-title{
    font-size: clamp(2.45rem, 13.2vw, 3.5rem);
  }

  .portfolio-live-title{
    font-size: .92rem;
  }

  .portfolio-mobile-card{
    flex-basis: 100%;
    grid-template-rows: 224px auto auto;
  }

  .portfolio-mobile-phone{
    min-height: 470px;
    height: min(66vh, 600px);
    border-width: 7px;
    border-radius: 24px;
  }
}
