/* ===================== Reset & base ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  --bg: #000;
  --fg: #fff;
  --muted: #b9b9b9;
  --pill-bg: #fff;
  --pill-fg: #111;
  --font-display: "Afacad", sans-serif;
  --font-body: "Afacad", sans-serif;
  --gutter: clamp(24px, 6vw, 96px);
}

html { scroll-behavior: auto; }

body{
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

/* ===================== Fixed scrub video ===================== */
.bg-video-layer{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  background: #000;
}

.bg-video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: opacity .5s ease;
}

.bg-video-fallback{
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, #2c2c2c 0%, #0c0c0c 55%, #000 100%);
  opacity: 0;
  transition: opacity .4s ease;
}
.bg-video-layer.no-video .bg-video-fallback{ opacity: 1; }
.bg-video-layer.no-video .bg-video{ opacity: 0; }

.bg-scrim{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.15) 40%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}

/* ===================== Preloader ===================== */
.preloader{
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .6s ease, visibility .6s ease;
}
.preloader.hidden{ opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-bar{
  width: 180px;
  height: 3px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  overflow: hidden;
}
.preloader-bar span{
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width .2s ease;
}

/* ===================== Layout scaffolding ===================== */
main{ position: relative; z-index: 1; }

.stage{
  position: relative;
  width: 100%;
}

.stage-inner{
  position: relative;
  min-height: 100vh;
  width: 100%;
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ===================== Reveal-on-scroll base state ===================== */
[data-reveal]{
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}
[data-reveal].is-revealed{
  animation: revealIn .9s cubic-bezier(.16,.84,.32,1) forwards;
}
@keyframes revealIn{
  to{ opacity: 1; transform: translateY(0); }
}

.stage-panel-1 [data-reveal],
.stage-panel-2 [data-reveal]{
  transform: translateY(80px);
}
.stage-panel-1 [data-reveal].is-revealed,
.stage-panel-2 [data-reveal].is-revealed{
  animation-name: revealInStrong;
  animation-duration: 1.3s;
}
@keyframes revealInStrong{
  to{ opacity: 1; transform: translateY(0); }
}

/* ===================== STAGE 1+2 pinned crossfade wrapper ===================== */
.video-stages{
  position: relative;
  height: 650vh; /* scroll distance for the whole hero -> about crossfade */
}
.video-stages-pin{
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}
.stage-panel{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage-panel-2{ opacity: 0; pointer-events: none; }

/* ===================== STAGE 1 : HERO ===================== */
.stage-panel-1 .stage-inner{ justify-content: center; align-items: center; }

.hero-row{
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-hello{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 42px);
}
.hero-im{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 1;
}
.hero-badges{ display: flex; gap: 14px; margin-left: 8px; }
.badge{
  width: clamp(48px, 5vw, 72px);
  height: clamp(48px, 5vw, 72px);
  border-radius: 50%;
  border: 1.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0,0,0,.2);
}
.badge svg{ width: 46%; height: 46%; }
.badge-figma{ background: #fff; border-color: #fff; }
.badge-figma svg{ width: 44%; height: 44%; }

.hero-bottom-row{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 0;
}

.contact-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 230px;
  padding: 22px 28px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-weight: 500;
  text-decoration: none;
  transition: gap .3s ease;
  box-sizing: border-box;
}
.contact-pill svg{
  width: 20px;
  height: 20px;
  opacity: 1;
  transition: width .3s ease, opacity .3s ease, margin .3s ease;
}
.contact-pill:hover{
  gap: 0;
}
.contact-pill:hover svg{
  width: 0;
  opacity: 0;
  margin: 0;
  overflow: hidden;
}

.hero-name{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 1;
  margin-top: -0.12em;
}

.copyright{
  position: absolute;
  left: var(--gutter);
  bottom: clamp(20px, 4vh, 48px);
  font-size: 18px;
  color: var(--muted);
}

.stage-panel-1 .copyright{
  position: absolute;
  left: 0;
  bottom: clamp(20px, 4vh, 48px);
  width: 100%;
  text-align: center;
  margin-top: 0;
}

/* ===================== STAGE 2 : ABOUT ===================== */
.stage-2{ min-height: 100vh; }
.about-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  column-gap: 40px;
  row-gap: 32px;
}
.about-left-col{
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.about-left{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.2;
}
.ring-icon{
  width: clamp(70px, 8vw, 110px);
  color: #fff;
}
.about-right{
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  align-self: end;
  text-align: left;
  max-width: 360px;
}
.about-right h3{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.3;
}
.about-right em{ font-style: italic; font-weight: 500; }
.underline-strong{ text-decoration: underline; text-underline-offset: 8px; }

.about-note{
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 22px;
}
.about-note .dash{
  width: 32px;
  height: 2px;
  background: var(--muted);
  margin-top: 10px;
  flex-shrink: 0;
}
.about-note p{
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  max-width: 250px;
}

/* ===================== STAGE 3 : PINNED PORTFOLIO ===================== */
.stage-3{ height: 700vh; } /* scroll distance consumed while pinned + images travel */

.stage3-pin{
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.works-title{
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}

.works-kicker{
  display: block;
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 26px);
  margin-bottom: 6px;
}
.works-title h2{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 7vw, 96px);
  margin-top: -0.15em;
  line-height: 1;
}

.works-track{
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.work-card{
  position: absolute;
  width: clamp(220px, 24vw, 420px);
  aspect-ratio: 4/3;
  top: 50%; /* vertical travel is driven in px via JS, relative to viewport height */
  will-change: transform;
  opacity: 0;
  pointer-events: auto;
}
.work-card-visual{
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transition: transform .5s ease;
}
.work-card:hover .work-card-visual{ transform: scale(1.2); }
.work-card img{ width: 100%; height: 100%; object-fit: cover; display: block; }

.work-card{ pointer-events: auto; }
.work-card img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.work-card:hover img{ transform: scale(1.2); }

.work-card:nth-child(3n+1){ left: 2%; z-index: 1; }
.work-card:nth-child(3n+2){ left: 68%; z-index: 2; }
.work-card:nth-child(3n){ left: 39%; z-index: 3; }

/* ===================== STAGE 4 : CTA ===================== */
.stage-4{ min-height: 100vh; opacity: 0; will-change: opacity; }
.cta-inner{ justify-content: flex-end; }
.cta-bottom-row{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin-top: auto;
}
.cta-text h2{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.15;
  max-width: 720px;
}
.cta-text h2 em{ font-style: italic; }
.cta-text .about-note{ justify-content: flex-end; margin-top: 20px; }
.cta-text .about-note p{ max-width: 320px; }
.cta-text .about-note strong{ color: #fff; font-weight: 500; }

/* ===================== ROTATING HIRE-ME BADGE ===================== */
.rotate-badge{
  position: absolute;
  top: clamp(20px, 4vh, 48px);
  right: var(--gutter);
  width: clamp(160px, 16vw, 230px);
  height: clamp(160px, 16vw, 230px);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  background: rgba(112,112,112,.02);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.rotate-badge-ring{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: rotateRing 10s linear infinite;
}
@keyframes rotateRing{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}
.rotate-badge-icon{
  position: relative;
  z-index: 1;
  width: 38%;
  height: 38%;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s ease;
}
.rotate-badge-icon svg{ width: 46%; height: 46%; }
.rotate-badge:hover .rotate-badge-icon{ transform: rotate(45deg); }

/* ===================== WORK IMAGE POPUP ===================== */
.work-modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.work-modal.is-open{
  opacity: 1;
  pointer-events: auto;
}
.work-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(6px);
}
.work-modal-content{
  position: relative;
  max-width: min(820px, 85vw);
  max-height: 78vh;
  transform: scale(0.94);
  transition: transform .35s cubic-bezier(.16,.84,.32,1);
}
.work-modal.is-open .work-modal-content{
  transform: scale(1);
}
.work-modal-img{
  display: block;
  width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.work-modal-close{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.5);
  color: #fff;
  cursor: pointer;
}
.work-modal-close svg{ width: 18px; height: 18px; }

body.modal-open{ overflow: hidden; }

@media (max-width: 560px){
  .work-modal-close{ top: -40px; }
}

/* ===================== STAGE 4 FOOTER ===================== */
.stage-4 .stage-inner{ position: relative; }
.cta-footer{
  position: static;
  margin-top: 0;
  text-align: right;
  white-space: nowrap;
}

/* ===================== CONTACT POPUP ===================== */
.contact-modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.contact-modal.is-open{
  opacity: 1;
  pointer-events: auto;
}
.contact-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(8px);
}
.contact-modal-content{
  position: relative;
  width: min(480px, 92vw);
  padding: 32px 28px 28px;
  border-radius: 20px;
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  text-align: center;
  transform: scale(0.94);
  transition: transform .35s cubic-bezier(.16,.84,.32,1);
}
.contact-modal.is-open .contact-modal-content{
  transform: scale(1);
}
.contact-modal-title{
  color: #fff;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  margin: 0 0 28px;
}
.contact-modal-close{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
}
.contact-modal-close svg{ width: 16px; height: 16px; }

.contact-modal-options{
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-option{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  transition: background .25s ease;
}
.contact-option:hover{ background: rgba(255, 255, 255, 0.12); }
.contact-option svg{ width: 18px; height: 18px; flex: 0 0 auto; opacity: .8; }
.contact-option strong{ font-weight: 600; }
.contact-option-label{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.contact-option-label svg{ width: 15px; height: 15px; }
.contact-option-value{
  font-size: 16px;
  font-weight: 500;
  word-break: break-word;
}

body.contact-modal-open{ overflow: hidden; }

/* Stack top-down instead of side-by-side on narrow screens */
@media (max-width: 560px){
  .contact-modal-content{
    padding: 32px 22px 24px;
  }
}

/* ===================== NAVBAR ===================== */
.navbar{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 100%);
  transition: transform .4s cubic-bezier(.65,0,.35,1);
}
.navbar.nav-hidden{
  transform: translateY(-100%);
}

/* --- language switch --- */
.lang-switch{
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 150px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(96,96,96,1);
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}
.lang-switch-thumb{
  position: absolute;
  top: 4px;
  left: 4px;
  width: 66px;
  height: 32px;
  border-radius: 16px;
  background: #fff;
  transition: transform .35s cubic-bezier(.65,0,.35,1);
}
.lang-switch.is-en .lang-switch-thumb{
  transform: translateX(76px);
}
.lang-switch-text{
  position: relative;
  width: 100%;
  height: 100%;
}
.lang-option{
  position: absolute;
  top: 0;
  width: 76px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  transition: opacity .3s ease;
}
.lang-option.lang-id{ right: 0; opacity: 1; }
.lang-option.lang-en{ left: 0; opacity: 0; }
.lang-switch.is-en .lang-option.lang-id{ opacity: 0; }
.lang-switch.is-en .lang-option.lang-en{ opacity: 1; }

/* --- center logo mark --- */
.navbar-logo{
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.navbar-logo svg{ width: 100%; height: 100%; }

/* --- contact button with hover lift, matching the reference video --- */
.navbar-contact{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 40px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .35s ease;
  box-sizing: border-box;
}
.navbar-contact:hover{
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}

/* ===================== I18N TOGGLE ===================== */
.i18n-en{ display: none; }
html.lang-en .i18n-id{ display: none; }
html.lang-en .i18n-en{ display: inline; }

/* ===================== Responsive ===================== */
@media (max-width: 900px){
  .about-grid{ grid-template-columns: 1fr; }
  .about-left, .ring-icon, .about-right{ grid-column: 1; justify-self: start; text-align: left; }
  .about-right{ margin-top: 24px; }
  .about-note{ justify-content: flex-start; }
  .about-note p{ max-width: 100%; }
  .ring-icon{ margin: 24px 0; }

  .work-card{ width: 60vw; }

  .work-card:nth-child(n){
    left: 50%;
    margin-left: -30vw; /* half of 60vw — keeps it centered */
  }

  /* Disable the desktop hover-zoom in this range too — see Fix 2 below */
  .work-card:hover .work-card-visual,
  .work-card:hover img{
    transform: none;
  }
}

/* ===================== ABOUT SPLIT (mobile only) ===================== */
.about-sub-1, .about-sub-2{ display: contents; }

@media (max-width: 560px){
  .about-grid{ position: relative; height: 100vh; overflow: hidden; display: block; }
  .about-sub-1, .about-sub-2{
    display: flex;
    align-items: flex-end;
    position: absolute;
    inset: 0;
    padding: var(--gutter);
  }
  .about-sub-2{ opacity: 0; }
  .about-left-col{ align-self: flex-end; }
  .ring-icon{ width: 36px; }
  .about-left-col{ gap: 4px; }
  .about-right h3{ font-size: 36px; }
  .about-left{ order: 2; }
  .ring-icon{ order: 1; }
  .about-note{ justify-content: flex-end; }
  .about-note p{ max-width: 250px; }
}

@media (max-width: 560px){
  :root{ --gutter: 32px; }
  .cta-inner{ justify-content: center; }
  .video-stages{ height: 1200vh; }

  /* Mobile keeps the EXACT SAME pinned/scrubbed mechanism as desktop —
     only sizing/positioning is different here. Cards are still
     absolutely positioned and animated continuously via JS, so there
     are no gaps where the title could "peek through" between cards. */
  .work-card{
    width: 92vw;
  }

  .work-card:nth-child(n){
    left: 50%;
    margin-left: -46vw; /* or whatever value you landed on */
  }

  .work-card img{
    object-fit: cover;
    object-position: top;
  }

  .navbar{ gap: 12px; padding: 14px var(--gutter); }

  .navbar{ gap: 12px; padding: 14px var(--gutter); }
  .lang-switch{ width: 100px; height: 36px; }
  .lang-switch-thumb{ width: 42px; height: 28px; top: 4px; left: 4px; }
  .lang-switch.is-en .lang-switch-thumb{ transform: translateX(50px); }
  .lang-option{ width: 50px; font-size: 11px; }
  .navbar-logo{ width: 40px; height: 40px; }
  .navbar-contact{ width: 100px; height: 36px; font-size: 12px; }

  /* --- Hero: badges on top, "Hello, I'm" below, then CZsLazy, then pill --- */
  .hero-row{
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 18px;
  }
  .hero-badges{
    order: -1;
    flex-basis: 100%;
    justify-content: center;
    width: auto;
    margin-left: 0;
    margin-top: 0;
  }
  .hero-bottom-row{
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }
  .hero-name{ order: -1; }
  .contact-pill{ width: auto; }
  .hero-hello{ font-size: 32px; }
  .hero-im{ font-size: 80px; }
  .hero-name{ font-size: 80px; }

  /* --- Stage 4 mobile layout --- */
  .rotate-badge{
    top: auto;
    bottom: 42vh;
    right: 6%;
    width: 150px;
    height: 150px;
  }
  .cta-bottom-row{
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }
  .cta-text .about-note{
    align-items: flex-start;
  }
  .cta-footer{
    position: static;
    align-self: center;
    text-align: center;
    width: 100%;
    margin-top: 12px;
  }
  .cta-text h2{ font-size: 36px; }
}

@media (prefers-reduced-motion: reduce){
  [data-reveal]{ opacity: 1; transform: none; animation: none; }
}

/* Stage 2 -> Stage 3: extra blank scroll space before the portfolio pin begins */
.stage3-gap{
  height: 60vh;
  width: 100%;
}
